Skip to main content
QUICK REVIEW

[论文解读] The Transient Nature of Emergent In-Context Learning in Transformers

Aaditya K. Singh, Stephanie C. Y. Chan|arXiv (Cornell University)|Nov 14, 2023
Neural Networks and Applications被引用 4
一句话总结

该论文表明,变压器模型中的上下文学习(ICL)通常具有暂时性,即在训练过程中仅短暂出现,随后被参数中的学习(IWL)所取代,即使损失持续下降也是如此。作者证明,L2正则化可稳定ICL,防止其消失,并为实现无需早停的持久ICL提供了路径。

ABSTRACT

Transformer neural networks can exhibit a surprising capacity for in-context learning (ICL) despite not being explicitly trained for it. Prior work has provided a deeper understanding of how ICL emerges in transformers, e.g. through the lens of mechanistic interpretability, Bayesian inference, or by examining the distributional properties of training data. However, in each of these cases, ICL is treated largely as a persistent phenomenon; namely, once ICL emerges, it is assumed to persist asymptotically. Here, we show that the emergence of ICL during transformer training is, in fact, often transient. We train transformers on synthetic data designed so that both ICL and in-weights learning (IWL) strategies can lead to correct predictions. We find that ICL first emerges, then disappears and gives way to IWL, all while the training loss decreases, indicating an asymptotic preference for IWL. The transient nature of ICL is observed in transformers across a range of model sizes and datasets, raising the question of how much to "overtrain" transformers when seeking compact, cheaper-to-run models. We find that L2 regularization may offer a path to more persistent ICL that removes the need for early stopping based on ICL-style validation tasks. Finally, we present initial evidence that ICL transience may be caused by competition between ICL and IWL circuits.

研究动机与目标

  • 研究变压器中的上下文学习(ICL)在训练过程中是持久现象还是暂时现象。
  • 考察ICL在何种条件下出现并随后消失,即使训练损失持续下降。
  • 探讨由于优化动力学,IWL是否在渐近意义上主导ICL。
  • 评估正则化技术(如L2)是否可稳定ICL并防止其暂时性。
  • 研究变压器残差流中ICL与IWL电路之间潜在的竞争关系。

提出的方法

  • 作者在合成的、突发式少样本分类数据集上训练变压器模型,其中ICL和IWL均为实现高准确率的可行策略。
  • 他们使用独立的评估头在整个训练过程中独立测量ICL和IWL的性能,追踪准确率随时间的变化。
  • 他们监控训练损失,并在多个模型规模和数据分布上评估模型行为,以评估泛化能力。
  • 他们在训练中应用L2正则化,以测试其对稳定ICL和防止其消失的影响。
  • 他们分析残差流中ICL与IWL电路之间的竞争,假设资源限制最终使IWL占优。
  • 他们将实验扩展到语言模型的标记嵌入,以在更接近真实大语言模型的设置中测试ICL的暂时性。

实验结果

研究问题

  • RQ1在变压器中,上下文学习(ICL)是否在渐近意义上持久存在,还是在训练过程中出现后又消失?
  • RQ2为何ICL在训练损失持续下降(表明持续优化)的情况下仍会消失?
  • RQ3ICL与参数内学习(IWL)电路之间是否存在竞争,从而解释ICL的暂时性?
  • RQ4正则化技术(如L2正则化)是否可稳定ICL并防止其消失?
  • RQ5数据分布(如突发性、类别偏移)在多大程度上影响ICL的出现与暂时性?

主要发现

  • ICL在训练初期出现,但随后完全消失,即使训练损失持续下降,表明ICL并非渐近优选。
  • 随着训练推进,参数内学习(IWL)始终超越ICL,表明在标准交叉熵训练下,IWL在渐近意义上占优。
  • ICL的暂时性行为在多个模型规模和数据集上均被观察到,表明这是变压器中的普遍现象。
  • L2正则化能有效稳定ICL,防止其消失,并实现无需早停的持久上下文学习。
  • 结果表明,残差流中ICL与IWL电路之间的竞争可能是ICL暂时性的根本原因,由于软注意力机制在匹配上下文方面存在局限,IWL最终占据主导。
  • 初步证据表明,正则化可缓解ICL的暂时性,但代价是IWL性能的降低。

更好的研究,从现在开始

从阅读论文到最终审阅,大幅缩短您的研究时间。

无需绑定信用卡

本解读由 AI 生成,并经人工编辑审核。