【转载】 共享相关任务表征,一文读懂深度神经网络多任务学习

原文地址:

https://www.jiqizhixin.com/articles/2017-06-23-5

------------------------------------------------------------------------------------

 

 

 

共享相关任务表征,一文读懂深度神经网络多任务学习

近日,自然语言处理方向博士生、AYLIEN 研究科学家 Sebastian Ruder 在其同名博客上发表了一篇长文,从多任务学习 MTL 的背景、现状、动机、方法、机制、实践等方面,全面而详实地对深度神经网络多任务学习(Multi-Task Learning in Deep Neural Networks)进行了深度介绍。机器之心对该文进行了编译,原文链接请见文末。

目录

 

1.介绍

2.动机

3.两种深度学习 MTL 方法

  • Hard 参数共享
  • Soft 参数共享

4.为什么 MTL 有效

  • 隐式数据增加
  • 注意力机制
  • 窃听
  • 表征偏置
  • 正则化

5.非神经模型中的 MTL

  • 块稀疏正则化
  • 学习任务的关系

6.最近 MTL 的深度学习研究

  • 深度关系网络
  • 全自适应特征共享
  • 十字绣网络
  • 低监督
  • 联合多任务模型
  • 权重损失与不确定性
  • MTL 的张量因子分解
  • 水闸网络
  • 我应该在模型中共享什么

7.辅助任务

  • 相关任务
  • 对抗性
  • 提示
  • 注意力机制
  • 量子平滑
  • 预测输入
  • 使用未来预测现在
  • 表征学习
  • 哪些辅助任务有帮助?

8.结论

 

介绍

 

在机器学习(ML)中,通常的关注点是对特定度量进行优化,度量有很多种,例如特定基准或商业 KPI 的分数。为了做到这一点,我们通常训练一个模型或模型组合来执行目标任务。然后,我们微调这些模型,直到模型的结果不能继续优化。虽然通常可以通过这种方式使模型达到可接受的性能,但是由于我们的关注点集中在单个任务上,我们忽略了可能帮助优化度量指标的其它信息。具体来说,这些信息来自相关任务的训练信号。通过共享相关任务之间的表征,可以使我们的模型更好地概括原始任务。这种方法被称为多任务学习(MTL),这正是本文的主题。

MTL 有很多形式:联合学习(joint learning)、自主学习(learning to learn)和带有辅助任务的学习(learning with auxiliary task)等都可以指 MTL。一般来说,优化多个损失函数就等同于进行多任务学习(与单任务学习相反)。这些情况有助于你明确地思考如何在 MTL 方面做尝试并从中获得启发。

即使只优化一个损失函数(如在典型情况下),也有可能借助辅助任务来改善原任务模型。Rich Caruana [1] 简要总结了 MTL 的目标:「MTL 通过利用包含在相关任务训练信号中的特定领域的信息来改进泛化能力」。

 

在本文中,我将尝试概括一下多任务学习的现状,特别是当涉及到具有深度神经网络的 MTL 时。我将首先从不同的角度阐述 MTL 的动机。然后,我将介绍 MTL 在深度学习中最常用的两种方法。随后,我将描述 MTL 的机制,并阐述为什么 MTL 在实践中效果良好。在研究更先进的基于神经网络的 MTL 方法之前,我将通过讨论 MTL 的文献来提供一些背景。然后,我将介绍一些最近提出的更强大的深度神经网络 MTL 方法。最后,我将讨论常用的辅助任务类型,并讨论什么是一个好的 MTL 辅助任务。

动机

多任务学习的动机有不同的方式:从生物学的角度,多任务学习可以看作是受到人类学习的启发。对于学习新任务,我们经常应用通过学习相关任务获得的知识。例如,宝宝首先学会识别面部,然后可以应用这些知识来识别其它对象。

 

从教学的角度,我们经常通过学习任务来获得必要的技能,以便掌握更复杂的技术。学习武术(比如柔道)的恰当方式也适用于学习编程。

 

以流行文化为例,一个例子是《空手道少年(1984)》(感谢 Margaret Mitchell 与 Adrian Benton 提供灵感)。在电影中,老师宫城先生教导了空手道孩子看起来是无关紧要的任务,如打地板和给车打蜡。事后看来,这些可以让他掌握与学习空手道相关的宝贵技巧。

 

最后,从机器学习的角度:我们可以将多任务学习看作归纳转移的一种形式。归纳传递可以通过引入归纳偏置(inductive bias)来帮助改进模型,这导致模型比其它模型更喜欢某些假设。例如,一种常见形式的归纳偏置是 L1 正则化,这导致偏好稀疏解。在 MTL 模型下,归纳偏置由辅助任务提供,这导致模型更喜欢假设而不是解释多个任务。正如我们将在下面看到的,这通常会导致更好的一般化解决方案。

 

两种深度学习 MTL 方法 

到目前为止,我们只研究了 MTL 的理论动机。为了使 MTL 的思想更具体化,现在我们来看一下在深度神经网络中执行多任务学习的两种最常用的方法。在深度学习中,多任务学习通常通过隐藏层的 Hard 或 Soft 参数共享来完成。

Hard 参数共享

共享 Hard 参数是神经网络 MTL 最常用的方法,可以追溯到 [2]。在实际应用中,通常通过在所有任务之间共享隐藏层,同时保留几个特定任务的输出层来实现。

                                         

                                                图 1:深度神经网络多任务学习的 Hard 参数共享

 

共享 Hard 参数大大降低了过拟合的风险。实际上,[3] 表明过拟合共享参数的风险为 O(N)——其中 N 是任务数——小于过拟合特定任务参数,即输出层。这很直观:我们同时学习的工作越多,我们的模型找到一个含有所有任务的表征就越困难,而过拟合我们原始任务的可能性就越小。

Soft 参数共享

另一方面,在共享 Soft 参数时,每个任务都有自己的参数和模型。模型参数之间的距离是正则化的,以便鼓励参数相似化。例如使用 L2 距离进行正则化 [4],而 [5] 使用迹范数(trace norm)。

                                          

                                                     图 2:深度神经网络多任务学习的 Soft 参数共享

 

约束深度神经网络 Soft 参数共享的思想受到了 MTL 正则化技术的极大启发,这种思想已经用于其它模型开发,我们将在下面讨论。

为什么 MTL 有效?

 即使多任务学习获得的归纳偏置看起来是可信的,为了更好地了解 MTL,我们仍需要阐述它所基于的机制。其中大部分最初都是由 Caruana(1998)提出的。对于所有例子,假设我们有两个相关的任务 A 和 B,它们依赖于一个共同的隐藏层表征 F。

隐式数据增加

 MTL 有效地增加了我们用于训练模型的样本大小。由于所有任务不同程度地存在噪声,当在某些任务 A 上训练模型时,我们的目标是为任务 A 学习一个很好的表征,理想情况下,这个表征能忽略与数据相关的噪声并具有良好的泛化性。由于不同的任务具有不同的噪声模式,所以同时学习两个任务的模型能够学习更一般的表征。只学习任务 A 有可能过拟合任务 A,而联合地学习 A 和 B 使模型能够通过平均噪声模式获得更好的表征。

注意力机制

 如果一个任务非常嘈杂或数据量有限并且高维,模型可能难以区分相关与不相关的特征。MTL 可以帮助模型将注意力集中在重要的特征上,因为其它任务将为这些特征的相关性或不相关性提供额外的证据。

窃听(eavesdroping)

 某特征 G 很容易被任务 B 学习,但是难以被另一个任务 A 学习。这可能是因为 A 以更复杂的方式与特征进行交互,或者因为其它特征阻碍了模型学习 G 的能力。通过 MTL,我们可以允许模型「窃听」,即通过任务 B 学习 G。最简单的方法是通过提示(hint)[6],即直接训练模型来预测最重要的特征。

表征偏置

 MTL 任务偏好其它任务也偏好的表征,这造成模型偏差。这将有助于模型在将来泛化到新任务,因为在足够数量的训练任务上表现很好的假设空间也将很好地用于学习具有相同环境的新任务 [7]。

正则化

最后,MTL 通过引入归纳偏置作为正则化项。因此,它降低了过拟合的风险以及模型的 Rademacher 复杂度(即适合随机噪声的能力)。

非神经模型中的 MTL

为了更好地了解深度神经网络中的 MTL,我们将研究关于 MTL 在线性模型、核函数方法和贝叶斯算法方面的论文。特别地,我们将讨论一直以来在多任务学习的历史中普遍存在的两个主要思想:通过范数正则化制造各任务间的稀疏性对任务间的关系进行建模

参考文献

 

1. Caruana, R. (1998). Multitask Learning. Autonomous Agents and Multi-Agent Systems, 27(1), 95–133. https://doi.org/10.1016/j.csl.2009.08.003 

2. Caruana, R. "Multitask learning: A knowledge-based source of inductive bias." Proceedings of the Tenth International Conference on Machine Learning. 1993. 

3. Baxter, J. (1997). A Bayesian/information theoretic model of learning to learn via multiple task sampling. Machine Learning, 28, 7–39. Retrieved from http://link.springer.com/article/10.1023/A:1007327622663 

4. Duong, L., Cohn, T., Bird, S., & Cook, P. (2015). Low Resource Dependency Parsing: Cross-lingual Parameter Sharing in a Neural Network Parser. Proceedings of the 53rd Annual Meeting of the Association for Computational Linguistics and the 7th International Joint Conference on Natural Language Processing (Short Papers), 845–850. 

5. Yang, Y., & Hospedales, T. M. (2017). Trace Norm Regularised Deep Multi-Task Learning. In Workshop track - ICLR 2017. Retrieved from http://arxiv.org/abs/1606.04038 

6. Abu-Mostafa, Y. S. (1990). Learning from hints in neural networks. Journal of Complexity, 6(2), 192–198. https://doi.org/10.1016/0885-064X(90)90006-Y 

7. Baxter, J. (2000). A Model of Inductive Bias Learning. Journal of Artificial Intelligence Research, 12, 149–198. 

8. Argyriou, A., & Pontil, M. (2007). Multi-Task Feature Learning. In Advances in Neural Information Processing Systems. http://doi.org/10.1007/s10994-007-5040-8 

9. C.Zhang and J.Huang. Model selection consistency of the lasso selection in high-dimensional linear regression. Annals of Statistics, 36:1567–1594, 2008 

10. Yuan, Ming, and Yi Lin. "Model selection and estimation in regression with grouped variables." Journal of the Royal Statistical Society: Series B (Statistical Methodology) 68.1 (2006): 49-67. 

11. Lounici, K., Pontil, M., Tsybakov, A. B., & van de Geer, S. (2009). Taking Advantage of Sparsity in Multi-Task Learning. Stat, (1). Retrieved from http://arxiv.org/pdf/0903.1468 

12. Negahban, S., & Wainwright, M. J. (2008). Joint support recovery under high-dimensional scaling : Benefits and perils of ℓ1,∞ℓ1,∞-regularization. Advances in Neural Information Processing Systems, 1161–1168. 

13. Jalali, A., Ravikumar, P., Sanghavi, S., & Ruan, C. (2010). A Dirty Model for Multi-task Learning. Advances in Neural Information Processing Systems. Retrieved from https://papers.nips.cc/paper/4125-a-dirty-model-for-multi-task-learning.pdf 

14. Liu, S., Pan, S. J., & Ho, Q. (2016). Distributed Multi-task Relationship Learning. In Proceedings of the 19th International Conference on Artificial Intelligence and Statistics (AISTATS) (pp. 751–760). Retrieved from http://arxiv.org/abs/1612.04022 

15. Evgeniou, T., Micchelli, C., & Pontil, M. (2005). Learning multiple tasks with kernel methods. Journal of Machine Learning Research, 6, 615–637. Retrieved from http://discovery.ucl.ac.uk/13423/ 

16. Evgeniou, T., & Pontil, M. (2004). Regularized multi-task learning. International Conference on Knowledge Discovery and Data Mining, 109. https://doi.org/10.1145/1014052.1014067 

17. Jacob, L., Vert, J., Bach, F. R., & Vert, J. (2009). Clustered Multi-Task Learning: A Convex Formulation. Advances in Neural Information Processing Systems 21, 745–752. Retrieved from http://eprints.pascal-network.org/archive/00004705/%5Cnhttp://papers.nips.cc/paper/3499-clustered-multi-task-learning-a-convex-formulation.pdf 

18. Kim, S., & Xing, E. P. (2010). Tree-Guided Group Lasso for Multi-Task Regression with Structured Sparsity. 27th International Conference on Machine Learning, 1–14. https://doi.org/10.1214/12-AOAS549 

19. Chen, X., Kim, S., Lin, Q., Carbonell, J. G., & Xing, E. P. (2010). Graph-Structured Multi-task Regression and an Efficient Optimization Method for General Fused Lasso, 1–21. https://doi.org/10.1146/annurev.arplant.56.032604.144204 

20. Thrun, S., & O』Sullivan, J. (1996). Discovering Structure in Multiple Learning Tasks: The TC Algorithm. Proceedings of the Thirteenth International Conference on Machine Learning, 28(1), 5–5. Retrieved from http://scholar.google.com/scholar?cluster=956054018507723832&hl=en 

21. Ando, R. K., & Tong, Z. (2005). A Framework for Learning Predictive Structures from Multiple Tasks and Unlabeled Data. Journal of Machine Learning Research, 6, 1817–1853. 

22. Heskes, T. (2000). Empirical Bayes for Learning to Learn. Proceedings of the Seventeenth International Conference on Machine Learning, 367–364. 

23. Lawrence, N. D., & Platt, J. C. (2004). Learning to learn with the informative vector machine. Twenty-First International Conference on Machine Learning - ICML 』04, 65. https://doi.org/10.1145/1015330.1015382 

24. Yu, K., Tresp, V., & Schwaighofer, A. (2005). Learning Gaussian processes from multiple tasks. Proceedings of the International Conference on Machine Learning (ICML), 22, 1012–1019. https://doi.org/10.1145/1102351.1102479 

25. Bakker, B., & Heskes, T. (2003). Task Clustering and Gating for Bayesian Multitask Learning. Journal of Machine Learning Research, 1(1), 83–99. https://doi.org/10.1162/153244304322765658 

26. Xue, Y., Liao, X., Carin, L., & Krishnapuram, B. (2007). Multi-Task Learning for Classification with Dirichlet Process Priors. Journal of Machine Learning Research, 8, 35–63. 

27. Daumé III, H. (2009). Bayesian multitask learning with latent hierarchies, 135–142. Retrieved from http://dl.acm.org.sci-hub.io/citation.cfm?id=1795131 

28. Zhang, Y., & Yeung, D. (2010). A Convex Formulation for Learning Task Relationships in Multi-Task Learning. Uai, 733–442. 

29. Cavallanti, G., Cesa-Bianchi, N., & Gentile, C. (2010). Linear Algorithms for Online Multitask Classification. Journal of Machine Learning Research, 11, 2901–2934. 

30. Saha, A., Rai, P., Daumé, H., & Venkatasubramanian, S. (2011). Online learning of multiple tasks and their relationships. Journal of Machine Learning Research, 15, 643–651. Retrieved from http://www.scopus.com/inward/record.url?eid=2-s2.0-84862275213&partnerID=tZOtx3y1 

31. Kang, Z., Grauman, K., & Sha, F. (2011). Learning with whom to share in multi-task feature learning. Proceedings of the 28th International Conference on Machine Learning, (4), 4–5. Retrieved from http://machinelearning.wustl.edu/mlpapers/paper*files/ICML2011Kang*344.pdf 

32. Kumar, A., & Daumé III, H. (2012). Learning Task Grouping and Overlap in Multi-task Learning. Proceedings of the 29th International Conference on Machine Learning, 1383–1390. 

33. Crammer, K., & Mansour, Y. (2012). Learning Multiple Tasks Using Shared Hypotheses. Neural Information Processing Systems (NIPS), 1484–1492 

34. Long, M., & Wang, J. (2015). Learning Multiple Tasks with Deep Relationship Networks. arXiv Preprint arXiv:1506.02117. Retrieved from http://arxiv.org/abs/1506.02117 

35. Lu, Y., Kumar, A., Zhai, S., Cheng, Y., Javidi, T., & Feris, R. (2016). Fully-adaptive Feature Sharing in Multi-Task Networks with Applications in Person Attribute Classification. Retrieved from http://arxiv.org/abs/1611.05377 

36. Misra, I., Shrivastava, A., Gupta, A., & Hebert, M. (2016). Cross-stitch Networks for Multi-task Learning. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition. https://doi.org/10.1109/CVPR.2016.433 

37. Søgaard, A., & Goldberg, Y. (2016). Deep multi-task learning with low level tasks supervised at lower layers. Proceedings of the 54th Annual Meeting of the Association for Computational Linguistics, 231–235. 

38. Hashimoto, K., Xiong, C., Tsuruoka, Y., & Socher, R. (2016). A Joint Many-Task Model: Growing a Neural Network for Multiple NLP Tasks. arXiv Preprint arXiv:1611.01587. Retrieved from http://arxiv.org/abs/1611.01587 

39. Kendall, A., Gal, Y., & Cipolla, R. (2017). Multi-Task Learning Using Uncertainty to Weigh Losses for Scene Geometry and Semantics. Retrieved from http://arxiv.org/abs/1705.07115 

40. Yang, Y., & Hospedales, T. (2017). Deep Multi-task Representation Learning: A Tensor Factorisation Approach. In ICLR 2017. https://doi.org/10.1002/joe.20070 

41. Ruder, S., Bingel, J., Augenstein, I., & Søgaard, A. (2017). Sluice networks: Learning what to share between loosely related tasks. Retrieved from http://arxiv.org/abs/1705.08142 

42. Zhang, Z., Luo, P., Loy, C. C., & Tang, X. (2014). Facial Landmark Detection by Deep Multi-task Learning. In European Conference on Computer Vision (pp. 94–108). https://doi.org/10.1007/978-3-319-10599-4_7 

43. Liu, X., Gao, J., He, X., Deng, L., Duh, K., & Wang, Y.-Y. (2015). Representation Learning Using Multi-Task Deep Neural Networks for Semantic Classification and Information Retrieval. Naacl-2015, 912–921. 

44. Girshick, R. (2015). Fast R-CNN. In Proceedings of the IEEE International Conference on Computer Vision (pp. 1440–1448). https://doi.org/10.1109/iccv.2015.169 

45. Arık, S. Ö., Chrzanowski, M., Coates, A., Diamos, G., Gibiansky, A., Kang, Y., … Shoeybi, M. (2017). Deep Voice: Real-time Neural Text-to-Speech. In ICML 2017. 

46. Ganin, Y., & Lempitsky, V. (2015). Unsupervised Domain Adaptation by Backpropagation. In Proceedings of the 32nd International Conference on Machine Learning. (Vol. 37). 

47. Yu, J., & Jiang, J. (2016). Learning Sentence Embeddings with Auxiliary Tasks for Cross-Domain Sentiment Classification. Proceedings of the 2016 Conference on Empirical Methods in Natural Language Processing (EMNLP2016), 236–246. Retrieved from http://www.aclweb.org/anthology/D/D16/D16-1023.pdf 

48. Cheng, H., Fang, H., & Ostendorf, M. (2015). Open-Domain Name Error Detection using a Multi-Task RNN. In Proceedings of the 2015 Conference on Empirical Methods in Natural Language Processing (pp. 737–746). 

49. Caruana, R., & Sa, V. R. de. (1997). Promoting poor features to supervisors: Some inputs work better as outputs. Advances in Neural Information Processing Systems 9: Proceedings of The 1996 Conference, 9, 389. Retrieved from http://scholar.google.com/scholar?start=20&q=author:%22Rich+Caruana%22&hl=en#6 

50. Rei, M. (2017). Semi-supervised Multitask Learning for Sequence Labeling. In ACL 2017. 

51. Ben-David, S., & Schuller, R. (2003). Exploiting task relatedness for multiple task learning. Learning Theory and Kernel Machines, 567–580. https://doi.org/10.1007/978-3-540-45167-9_41 

52. Alonso, H. M., & Plank, B. (2017). When is multitask learning effective? Multitask learning for semantic sequence prediction under varying data conditions. In EACL. Retrieved from http://arxiv.org/abs/1612.02251 

53. Bingel, J., & Søgaard, A. (2017). Identifying beneficial task relations for multi-task learning in deep neural networks. In EACL. Retrieved from http://arxiv.org/abs/1702.08303 

 

原文链接:http://sebastianruder.com/multi-task/index.html

----------------------------------------------------------------------------------------

猜你喜欢

转载自www.cnblogs.com/devilmaycry812839668/p/10810367.html