English

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

Machine Learning 2025-11-11 v1 Artificial Intelligence

Abstract

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 LL, width dd, context length kk, and training data DD, 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 ηeff=Θ(1/Ld)\eta_{\text{eff}} = \Theta(1/\sqrt{Ld}). We demonstrate sharp phase transitions at critical scales and derive optimal depth-width allocations favoring LN2/3L^* \propto N^{2/3}, dN1/3d^* \propto N^{1/3} for the fixed parameter budget N=LdN = 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.

Keywords

Cite

@article{arxiv.2511.06232,
  title  = {Scaling Laws and In-Context Learning: A Unified Theoretical Framework},
  author = {Sushant Mehta and Ishan Gupta},
  journal= {arXiv preprint arXiv:2511.06232},
  year   = {2025}
}
R2 v1 2026-07-01T07:28:03.523Z