arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2511.06232cs.LGcs.AI
收藏

缩放定律与上下文学习:一个统一的理论框架

Scaling Laws and In-Context Learning: A Unified Theoretical Framework

Sushant Mehta, Ishan Gupta

AI总结:

本文提出统一理论框架,揭示Transformer上下文学习性能随深度、宽度、上下文长度和数据量呈幂律缩放,并给出最优深度-宽度分配及ICL涌现的充要条件。

摘要:

上下文学习(ICL)使大语言模型能够在不更新参数的情况下,通过演示适应新任务。尽管已有大量实证研究,但对 ICL 在规模扩展中如何涌现的原理性理解仍然较为缺乏。我们提出了一个统一的理论框架,将缩放定律与 Transformer 中 ICL 的涌现联系起来。我们的分析表明,ICL 性能与模型深度 $L$、宽度 $d$、上下文长度 $k$ 和训练数据 $D$ 之间遵循幂律关系,其指数由任务结构决定。我们证明,在特定条件下,Transformer 在其前向传播中实现了基于梯度的元学习,其有效学习率为 $η_{\text{eff}} = Θ(1/\sqrt{Ld})$。我们展示了在临界规模处出现的尖锐相变,并推导出在固定参数预算 $N = Ld$ 下最优的深度-宽度分配,倾向于 $L^* \propto N^{2/3}$、$d^* \propto N^{1/3}$。在合成任务上的系统性实验验证了我们的预测,测得的缩放指数与理论高度吻合。这项工作为 ICL 的涌现提供了必要条件和充分条件,并确立了 Transformer 在上下文中能够学习到什么的基本计算极限。

英文摘要:

In-context learning (ICL) enables large language models to adapt to new tasks from demonstrations without parameter updates. Despite extensive empirical studies, a principled understanding of ICL emergence at scale remains more elusive. We present a unified theoretical framework connecting scaling laws to ICL emergence in transformers. Our analysis establishes that ICL performance follows power-law relationships with model depth $L$, width $d$, context length $k$, and training data $D$, with exponents determined by task structure. We show that under specific conditions, transformers implement gradient-based metalearning in their forward pass, with an effective learning rate $η_{\text{eff}} = Θ(1/\sqrt{Ld})$. We demonstrate sharp phase transitions at critical scales and derive optimal depth-width allocations favoring $L^* \propto N^{2/3}$, $d^* \propto N^{1/3}$ for the fixed parameter budget $N = Ld$. Systematic experiments on synthetic tasks validate our predictions, with measured scaling exponents closely matching theory. This work provides both necessary and sufficient conditions for the emergence of ICLs and establishes fundamental computational limits on what transformers can learn in-context.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑