An Information-Theoretic Analysis of In-Context Learning
Hong Jun Jeon, Jason D. Lee, Qi Lei, Benjamin Van Roy
Abstract
Previous theoretical results pertaining to metalearning on sequences build on contrived assumptions and are somewhat convoluted. We introduce new information-theoretic tools that lead to an elegant and very general decomposition of error into three components: irreducible error, meta-learning error, and intra-task error. These tools unify analyses across many meta-learning challenges. To illustrate, we apply them to establish new results about in-context learning with transformers. Our theoretical results characterizes how error decays in both the number of training sequences and sequence lengths. Our results are very general; for example, they avoid contrived mixing time assumptions made by all prior results that establish decay of error with sequence length. An Information-Theoretic Analysis of ICL provide concrete examples which resemble learning from data generated by a deep transformer model and in the appendix we provide simpler problem instances for reference (logistic regression, linear representation learning). Related Works In-context Learning and Transformer. LLMs based on the transformer architecture (Vaswani et al., 2023) have exhibited the ability to learn from data within the context of a prompt (Brown et al., 2020) . This phenomenon, referred to as in-context learning (ICL), has received significant empirical investigation (
Ask Lune
Know this paper in minutes, not an afternoon.
Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.
21 top-tier papers have cited it since. Know what they found before your reviewers do.
Lune can draw on
the full paper · the top-tier papers that cite it · related work
Free to start. No credit card required.
Lineage
- Unveiling Induction Heads: Provable Training Dynamics and Feature Learning in Transformers cites An Explanation of In-context Learning as Implicit Bayesian Inference
- Unveiling Induction Heads: Provable Training Dynamics and Feature Learning in Transformers cites Language Models are Few-Shot Learners
- Unveiling Induction Heads: Provable Training Dynamics and Feature Learning in Transformers cites Transformers Learn In-Context by Gradient Descent
- Fantastically Ordered Prompts and Where to Find Them: Overcoming Few-Shot Prompt Order Sensitivity cites Language Models are Few-Shot Learners
- An Explanation of In-context Learning as Implicit Bayesian Inference cites Language Models are Few-Shot Learners
- Can large language models explore in-context? cites An Explanation of In-context Learning as Implicit Bayesian Inference
- Can large language models explore in-context? cites Language Models are Few-Shot Learners
- Can large language models explore in-context? cites Transformers Learn In-Context by Gradient Descent
- Can large language models explore in-context? cites What Can Transformers Learn In-Context? A Case Study of Simple Function Classes
- Dual Operating Modes of In-Context Learning cites An Explanation of In-context Learning as Implicit Bayesian Inference
- Dual Operating Modes of In-Context Learning cites Language Models are Few-Shot Learners
- Dual Operating Modes of In-Context Learning cites Transformers Learn In-Context by Gradient Descent
- Dual Operating Modes of In-Context Learning cites What Can Transformers Learn In-Context? A Case Study of Simple Function Classes
- Estimating the Hallucination Rate of Generative AI cites Fantastically Ordered Prompts and Where to Find Them: Overcoming Few-Shot Prompt Order Sensitivity
- Estimating the Hallucination Rate of Generative AI cites An Explanation of In-context Learning as Implicit Bayesian Inference
- Estimating the Hallucination Rate of Generative AI cites Language Models are Few-Shot Learners
- Estimating the Hallucination Rate of Generative AI cites Transformers Learn In-Context by Gradient Descent
- Estimating the Hallucination Rate of Generative AI cites Many-Shot In-Context Learning
- Transformers Learn In-Context by Gradient Descent cites Language Models are Few-Shot Learners
- Transformers Learn In-Context by Gradient Descent cites What Can Transformers Learn In-Context? A Case Study of Simple Function Classes
- What Can Transformers Learn In-Context? A Case Study of Simple Function Classes cites Fantastically Ordered Prompts and Where to Find Them: Overcoming Few-Shot Prompt Order Sensitivity
- What Can Transformers Learn In-Context? A Case Study of Simple Function Classes cites An Explanation of In-context Learning as Implicit Bayesian Inference
- What Can Transformers Learn In-Context? A Case Study of Simple Function Classes cites Language Models are Few-Shot Learners
- Many-Shot In-Context Learning cites Fantastically Ordered Prompts and Where to Find Them: Overcoming Few-Shot Prompt Order Sensitivity
- Many-Shot In-Context Learning cites An Explanation of In-context Learning as Implicit Bayesian Inference
- Many-Shot In-Context Learning cites Dual Operating Modes of In-Context Learning
- Many-Shot In-Context Learning cites Language Models are Few-Shot Learners
- Many-Shot In-Context Learning cites Transformers Learn In-Context by Gradient Descent
- Many-Shot In-Context Learning cites What Can Transformers Learn In-Context? A Case Study of Simple Function Classes
Cited by top-tier papers21
- Many-Shot In-Context LearningRishabh Agarwal, Avi Singh, Lei Zhang, Bernd Bohnet et al.NeurIPS 2024 · 271 citations
- Can large language models explore in-context?Akshay Krishnamurthy, Keegan Harris, Dylan J. Foster, Cyril Zhang et al.NeurIPS 2024 · 95 citations
- Dual Operating Modes of In-Context LearningZiqian Lin, Kangwook LeeICML 2024 · 50 citations
- Unveiling Induction Heads: Provable Training Dynamics and Feature Learning in TransformersSiyu Chen, Heejune Sheen, Tianhao Wang, Zhuoran YangNeurIPS 2024 · 48 citations
- Estimating the Hallucination Rate of Generative AIAndrew Jesson, Nicolas Beltran-Velez, Quentin Chu, Sweta Karlekar et al.NeurIPS 2024 · 46 citations
Builds on19
- Language Models are Few-Shot LearnersTom B. Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah et al.NeurIPS 2020 · 64,255 citations
- Fantastically Ordered Prompts and Where to Find Them: Overcoming Few-Shot Prompt Order SensitivityYao Lu, Max Bartolo, Alastair Moore, Sebastian Riedel et al.ACL 2022 · 1,494 citations
- An Explanation of In-context Learning as Implicit Bayesian InferenceSang Michael Xie, Aditi Raghunathan, Percy Liang, Tengyu MaICLR 2022 · 1,030 citations
- What Can Transformers Learn In-Context? A Case Study of Simple Function ClassesShivam Garg, Dimitris Tsipras, Percy Liang, Gregory ValiantNeurIPS 2022 · 883 citations
- Transformers Learn In-Context by Gradient DescentJohannes von Oswald, Eyvind Niklasson, Ettore Randazzo, João Sacramento et al.ICML 2023 · 729 citations
Related papers
- Transformers are Minimax Optimal Nonparametric In-Context LearnersJuno Kim, Tai Nakamaki, Taiji SuzukiNeurIPS 2024 · 42 citations
- Technical Debt in In-Context Learning: Diminishing Efficiency in Long ContextTaejong Joo, Diego KlabjanNeurIPS 2025
- In-Context Learning Is Provably Bayesian Inference: A Generalization Theory for Meta-LearningTomoya Wakayama, Taiji SuzukiICML 2026 · 12 citations
- Transformers are almost optimal metalearners for linear classificationRoey Magen, Gal VardiNeurIPS 2025 · 2 citations
- In-Context Learning through the Bayesian PrismMadhur Panwar, Kabir Ahuja, Navin GoyalICLR 2024 · 79 citations
