Dual Operating Modes of In-Context Learning
Not on the map. Why?
Abstract (arXiv)
In-context learning (ICL) exhibits dual operating modes: task learning, i.e., acquiring a new skill from in-context samples, and task retrieval, i.e., locating and activating a relevant pretrained skill. Recent theoretical work investigates various mathematical models to analyze ICL, but existing models explain only one operating mode at a time. We introduce a probabilistic model, with which one can explain the dual operating modes of ICL simultaneously. Focusing on in-context learning of linear functions, we extend existing models for pretraining data by introducing multiple task groups and task-dependent input distributions. We then analyze the behavior of the optimally pretrained model under the squared loss, i.e., the MMSE estimator of the label given in-context examples. Regarding pretraining task distribution as prior and in-context examples as the observation, we derive the closed-form expression of the task posterior distribution. With the closed-form expression, we obtain a quantitative understanding of the two operating modes of ICL. Furthermore, we shed light on an unexplained phenomenon observed in practice: under certain settings, the ICL risk initially increases and then decreases with more in-context examples. Our model offers a plausible explanation for this "early ascent" phenomenon: a limited number of in-context samples may lead to the retrieval of an incorrect skill, thereby increasing the risk, which will eventually diminish as task learning takes effect with more in-context samples. We also theoretically analyze ICL with biased labels, e.g., zero-shot ICL, where in-context examples are assigned random labels. Lastly, we validate our findings and predictions via experiments involving Transformers and large language models.
Key facts. Cited by 42 papers in the map (data through 7 Oct 2026). Builds on 23 of its 35 references that are in the map. First posted on arXiv 29 Feb 2024.
Builds on
23 of 35 references.
References · 23
- 2017Attention Is All You Needcited by 59,932
- 2020Language Models are Few-Shot Learnerscited by 32,199
- 2023GPT-4 Technical Reportcited by 18,132
- 2023Llama 2: Open Foundation and Fine-Tuned Chat Modelscited by 12,865
- 2023Mistral 7Bcited by 3,065
- 2024Mixtral of Expertscited by 1,785
- 2017Decoupled Weight Decay Regularizationcited by 1,722
- 2021An Explanation of In-context Learning as Implicit Bayesian Inferencecited by 915
- 2022Transformers learn in-context by gradient descentcited by 714
- 2022What Can Transformers Learn In-Context? A Case Study of Simple Function Classescited by 700
- 2022What learning algorithm is in-context learning? Investigations with linear modelscited by 671
- 2023Trained Transformers Learn Linear Models In-Contextcited by 331
11 more
- 2023Transformers as Statisticians: Provable In-Context Learning with In-Context Algorithm Selectioncited by 291
- 2023Transformers learn to implement preconditioned gradient descent for in-context learningcited by 274
- 2023Looped Transformers as Programmable Computerscited by 224
- 2023Transformers as Algorithms: Generalization and Stability in In-context Learningcited by 220
- 2023One Step of Gradient Descent is Provably the Optimal In-Context Learner with One Layer of Linear Self-Attentioncited by 168
- 2020Benign overfitting in ridge regressioncited by 152
- 2023How Many Pretraining Tasks Are Needed for In-Context Learning of Linear Regression?cited by 93
- 2022Z-ICL: Zero-Shot In-Context Learning with Pseudo-Demonstrationscited by 70
- 2020Investigating Societal Biases in a Poetry Composition Systemcited by 47
- 2024An Information-Theoretic Analysis of In-Context Learningcited by 39
- 2023Understanding Emergent In-Context Learning from a Kernel Regression Perspectivecited by 23
Built on by
Citing papers per year: 2024: 14; 2025: 19; 2026: 9.
42 papers.
Sort:
By area:
- 2024Many-Shot In-Context Learningcited by 203
- 2024Can In-context Learning Really Generalize to Out-of-distribution Tasks?cited by 23
- 2024Fine-grained Analysis of In-context Linear Estimation: Data, Architecture, and Beyondcited by 22
- 2025From Few to Many: Self-Improving Many-Shot Reasoners Through Iterative Optimization and Generationcited by 20
- 2025True Zero-Shot Inference of Dynamical Systems Preserving Long-Term Statisticscited by 20
- 2024Toward Understanding In-context vs. In-weight Learningcited by 19
- 2025Strategy Coopetition Explains the Emergence and Transience of In-Context Learningcited by 17
- 2025In-Context Learning Is Provably Bayesian Inference: A Generalization Theory for Meta-Learningcited by 17
- 2024On the Training Convergence of Transformers for In-Context Classification of Gaussian Mixturescited by 15
- 2025HyperTree Planning: Enhancing LLM Reasoning via Hierarchical Thinkingcited by 14
- 2024Everything Everywhere All at Once: LLMs can In-Context Learn Multiple Tasks in Superpositioncited by 13
- 2025Gating is Weighting: Understanding Gated Linear Attention through In-context Learningcited by 11
30 more
- 2024On Many-Shot In-Context Learning for Long-Context Evaluationcited by 10
- 2024Investigating the Pre-Training Dynamics of In-Context Learning: Task Recognition vs. Task Learningcited by 6
- 2024Memorization in In-Context Learningcited by 6
- 2024Task Diversity Shortens the ICL Plateaucited by 5
- 2024Evaluating and Safeguarding the Adversarial Robustness of Retrieval-Based In-Context Learningcited by 4
- 2025iNews: A Multimodal Dataset for Modeling Personalized Affective Responses to Newscited by 4
- 2025Revitalizing Saturated Benchmarks: A Weighted Metric Approach for Differentiating Large Language Model Performancecited by 4
- 2025ICL CIPHERS: Quantifying "Learning" in In-Context Learning via Substitution Cipherscited by 4
- 2025Decomposing Complex Visual Comprehension into Atomic Visual Skills for Vision Language Modelscited by 4
- 2025In-Context Occam's Razor: How Transformers Prefer Simpler Hypotheses on the Flycited by 4
- 2025Provable In-Context Learning of Nonlinear Regression with Transformerscited by 4
- 2024From Unstructured Data to In-Context Learning: Exploring What Tasks Can Be Learned and Whencited by 3
- 2025Latent Concept Disentanglement in Transformer-based Language Modelscited by 3
- 2025Towards Compute-Optimal Many-Shot In-Context Learningcited by 3
- 2026Distinct mechanisms underlying in-context learning in transformerscited by 3
- 2024Towards the Effect of Examples on In-Context Learning: A Theoretical Case Studycited by 2
- 2025Function Induction and Task Generalization: An Interpretability Study with Off-by-One Additioncited by 2
- 2026Bifrost: Steering Strategic Trajectories to Bridge Contextual Gaps for Self-Improving Agentscited by 2
- 2026Understanding Contextual Recall in Transformers: How Finetuning Enables In-Context Reasoning over Pretraining Knowledgecited by 2
- 2025Multi-Layer Attention is the Amplifier of Demonstration Effectivenesscited by 1
- 2025Genomic Next-Token Predictors are In-Context Learnerscited by 1
- 2026Fine-Tuning Without Forgetting In-Context Learning: A Theoretical Analysis of Linear Attention Modelscited by 1
- 2026Fine-tuning vs. In-context Learning in Large Language Models: A Formal Language Learning Perspectivecited by 1
- 2026Information Abundance Paradox: Long-Context Training Undermines Parametric Knowledgecited by 1
- 2024Label Set Optimization via Activation Distribution Kurtosis for Zero-shot Classification with Generative Modelscited by 0
- 2025In-Context Learning with Hypothesis-Class Guidancecited by 0
- 2025Decomposing Prediction Mechanisms for In-Context Recallcited by 0
- 2026Abstracting Cross-Domain Action Sequences into Interpretable Workflowscited by 0
- 2026Pretraining Curricula Enable Selective Fine-tuningcited by 0
- 2026A Minimal Interpretable Architecture for Zero-Shot Reconstruction of Dynamical Systemscited by 0
- 2026Information Abundance Paradox: Long-Context Training Undermines Parametric Knowledge12 Aug 2026
- 2026A Minimal Interpretable Architecture for Zero-Shot Reconstruction of Dynamical Systems16 Jul 2026
- 2026Pretraining Curricula Enable Selective Fine-tuning6 Jul 2026
- 2026Abstracting Cross-Domain Action Sequences into Interpretable Workflows12 Jun 2026
- 2026Fine-tuning vs. In-context Learning in Large Language Models: A Formal Language Learning Perspective25 Apr 2026
- 2026Distinct mechanisms underlying in-context learning in transformers14 Apr 2026
- 2026Understanding Contextual Recall in Transformers: How Finetuning Enables In-Context Reasoning over Pretraining Knowledge21 Mar 2026
- 2026Fine-Tuning Without Forgetting In-Context Learning: A Theoretical Analysis of Linear Attention Models26 Feb 2026
- 2026Bifrost: Steering Strategic Trajectories to Bridge Contextual Gaps for Self-Improving Agents5 Feb 2026
- 2025Genomic Next-Token Predictors are In-Context Learners16 Nov 2025
- 2025In-Context Learning Is Provably Bayesian Inference: A Generalization Theory for Meta-Learning13 Oct 2025
- 2025Multi-Layer Attention is the Amplifier of Demonstration Effectiveness1 Aug 2025
30 more
- 2025Provable In-Context Learning of Nonlinear Regression with Transformers28 Jul 2025
- 2025Towards Compute-Optimal Many-Shot In-Context Learning22 Jul 2025
- 2025Function Induction and Task Generalization: An Interpretability Study with Off-by-One Addition14 Jul 2025
- 2025Decomposing Prediction Mechanisms for In-Context Recall2 Jul 2025
- 2025In-Context Occam's Razor: How Transformers Prefer Simpler Hypotheses on the Fly24 Jun 2025
- 2025Latent Concept Disentanglement in Transformer-based Language Models20 Jun 2025
- 2025Decomposing Complex Visual Comprehension into Atomic Visual Skills for Vision Language Models26 May 2025
- 2025True Zero-Shot Inference of Dynamical Systems Preserving Long-Term Statistics19 May 2025
- 2025HyperTree Planning: Enhancing LLM Reasoning via Hierarchical Thinking5 May 2025
- 2025ICL CIPHERS: Quantifying "Learning" in In-Context Learning via Substitution Ciphers28 Apr 2025
- 2025Gating is Weighting: Understanding Gated Linear Attention through In-context Learning6 Apr 2025
- 2025Strategy Coopetition Explains the Emergence and Transience of In-Context Learning7 Mar 2025
- 2025Revitalizing Saturated Benchmarks: A Weighted Metric Approach for Differentiating Large Language Model Performance7 Mar 2025
- 2025iNews: A Multimodal Dataset for Modeling Personalized Affective Responses to News5 Mar 2025
- 2025In-Context Learning with Hypothesis-Class Guidance27 Feb 2025
- 2025From Few to Many: Self-Improving Many-Shot Reasoners Through Iterative Optimization and Generation1 Feb 2025
- 2024On Many-Shot In-Context Learning for Long-Context Evaluation11 Nov 2024
- 2024Toward Understanding In-context vs. In-weight Learning30 Oct 2024
- 2024Label Set Optimization via Activation Distribution Kurtosis for Zero-shot Classification with Generative Models24 Oct 2024
- 2024On the Training Convergence of Transformers for In-Context Classification of Gaussian Mixtures15 Oct 2024
- 2024Can In-context Learning Really Generalize to Out-of-distribution Tasks?13 Oct 2024
- 2024Towards the Effect of Examples on In-Context Learning: A Theoretical Case Study12 Oct 2024
- 2024Everything Everywhere All at Once: LLMs can In-Context Learn Multiple Tasks in Superposition8 Oct 2024
- 2024Task Diversity Shortens the ICL Plateau7 Oct 2024
- 2024Memorization in In-Context Learning21 Aug 2024
- 2024Fine-grained Analysis of In-context Linear Estimation: Data, Architecture, and Beyond13 Jul 2024
- 2024Investigating the Pre-Training Dynamics of In-Context Learning: Task Recognition vs. Task Learning20 Jun 2024
- 2024From Unstructured Data to In-Context Learning: Exploring What Tasks Can Be Learned and When31 May 2024
- 2024Evaluating and Safeguarding the Adversarial Robustness of Retrieval-Based In-Context Learning24 May 2024
- 2024Many-Shot In-Context Learning17 Apr 2024
- 2025From Few to Many: Self-Improving Many-Shot Reasoners Through Iterative Optimization and Generationcited by 20
- 2025HyperTree Planning: Enhancing LLM Reasoning via Hierarchical Thinkingcited by 14
- 2025Decomposing Complex Visual Comprehension into Atomic Visual Skills for Vision Language Modelscited by 4
- 2026Understanding Contextual Recall in Transformers: How Finetuning Enables In-Context Reasoning over Pretraining Knowledgecited by 2
- 2026Understanding Contextual Recall in Transformers: How Finetuning Enables In-Context Reasoning over Pretraining Knowledge21 Mar 2026
- 2025Decomposing Complex Visual Comprehension into Atomic Visual Skills for Vision Language Models26 May 2025
- 2025HyperTree Planning: Enhancing LLM Reasoning via Hierarchical Thinking5 May 2025
- 2025From Few to Many: Self-Improving Many-Shot Reasoners Through Iterative Optimization and Generation1 Feb 2025
- 2024Many-Shot In-Context Learningcited by 203
- 2024Can In-context Learning Really Generalize to Out-of-distribution Tasks?cited by 23
- 2024Fine-grained Analysis of In-context Linear Estimation: Data, Architecture, and Beyondcited by 22
- 2025True Zero-Shot Inference of Dynamical Systems Preserving Long-Term Statisticscited by 20
- 2024Toward Understanding In-context vs. In-weight Learningcited by 19
- 2025Strategy Coopetition Explains the Emergence and Transience of In-Context Learningcited by 17
- 2025In-Context Learning Is Provably Bayesian Inference: A Generalization Theory for Meta-Learningcited by 17
- 2024On the Training Convergence of Transformers for In-Context Classification of Gaussian Mixturescited by 15
- 2024Everything Everywhere All at Once: LLMs can In-Context Learn Multiple Tasks in Superpositioncited by 13
- 2025Gating is Weighting: Understanding Gated Linear Attention through In-context Learningcited by 11
- 2024On Many-Shot In-Context Learning for Long-Context Evaluationcited by 10
- 2024Memorization in In-Context Learningcited by 6
12 most cited of 35 All 35 (JSON)
- 2026Information Abundance Paradox: Long-Context Training Undermines Parametric Knowledge12 Aug 2026
- 2026A Minimal Interpretable Architecture for Zero-Shot Reconstruction of Dynamical Systems16 Jul 2026
- 2026Pretraining Curricula Enable Selective Fine-tuning6 Jul 2026
- 2026Abstracting Cross-Domain Action Sequences into Interpretable Workflows12 Jun 2026
- 2026Fine-tuning vs. In-context Learning in Large Language Models: A Formal Language Learning Perspective25 Apr 2026
- 2026Distinct mechanisms underlying in-context learning in transformers14 Apr 2026
- 2026Fine-Tuning Without Forgetting In-Context Learning: A Theoretical Analysis of Linear Attention Models26 Feb 2026
- 2025Genomic Next-Token Predictors are In-Context Learners16 Nov 2025
- 2025In-Context Learning Is Provably Bayesian Inference: A Generalization Theory for Meta-Learning13 Oct 2025
- 2025Multi-Layer Attention is the Amplifier of Demonstration Effectiveness1 Aug 2025
- 2025Provable In-Context Learning of Nonlinear Regression with Transformers28 Jul 2025
- 2025Towards Compute-Optimal Many-Shot In-Context Learning22 Jul 2025
12 newest of 35 All 35 (JSON)