arXiv:2410.14086cs.LGcs.AI2024-10ICML被引 7

用上下文学习解释简单模型为何泛化更好,揭示其内在压缩机制。

In-context learning and Occam's razor

  • 通过预序编码视角,将上下文学习的损失函数与数据压缩关联
  • 最小化预测损失可同时降低训练误差与隐式模型复杂度
  • 为提升当前上下文学习方法提供理论依据和改进方向

机器学习的核心目标是泛化。尽管没有免费午餐定理表明在无额外假设下无法获得泛化保证,但实践中简单模型往往具有最佳泛化性能,这符合奥卡姆剃刀原则。然而,当前大多数方法仅最小化训练误差,仅通过正则化或架构设计间接鼓励简单性。本文揭示了奥卡姆剃刀与上下文学习之间的联系:Transformer等序列模型在推理时从序列中过往观测值动态学习的能力。我们证明,用于训练上下文学习者的下一个词预测损失,等价于一种称为预序编码的数据压缩技术;最小化该损失即同时最小化训练误差与从上下文中隐式学习到的模型复杂度。我们的理论及实证实验不仅为上下文学习提供了规范性解释,还揭示了现有方法的局限性,并指出了改进路径。代码已开源:https://github.com/3rdCore/PrequentialCode。

原文摘要 · Abstract (English)

A central goal of machine learning is generalization. While the No Free Lunch Theorem states that we cannot obtain theoretical guarantees for generalization without further assumptions, in practice we observe that simple models which explain the training data generalize best: a principle called Occam's razor. Despite the need for simple models, most current approaches in machine learning only minimize the training error, and at best indirectly promote simplicity through regularization or architecture design. Here, we draw a connection between Occam's razor and in-context learning: an emergent ability of certain sequence models like Transformers to learn at inference time from past observations in a sequence. In particular, we show that the next-token prediction loss used to train in-context learners is directly equivalent to a data compression technique called prequential coding, and that minimizing this loss amounts to jointly minimizing both the training error and the complexity of the model that was implicitly learned from context. Our theory and the empirical experiments we use to support it not only provide a normative account of in-context learning, but also elucidate the shortcomings of current in-context learning methods, suggesting ways in which they can be improved. We make our code available at https://github.com/3rdCore/PrequentialCode.

上下文学习奥卡姆剃刀模型压缩预序编码

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。