Revisiting In-context Learning Inference Circuit in Large Language Models
Not on the map. Why?
Abstract (arXiv)
In-context Learning (ICL) is an emerging few-shot learning paradigm on Language Models (LMs) with inner mechanisms un-explored. There are already existing works describing the inner processing of ICL, while they struggle to capture all the inference phenomena in large language models. Therefore, this paper proposes a comprehensive circuit to model the inference dynamics and try to explain the observed phenomena of ICL. In detail, we divide ICL inference into 3 major operations: (1) Input Text Encode: LMs encode every input text (in the demonstrations and queries) into linear representation in the hidden states with sufficient information to solve ICL tasks. (2) Semantics Merge: LMs merge the encoded representations of demonstrations with their corresponding label tokens to produce joint representations of labels and demonstrations. (3) Feature Retrieval and Copy: LMs search the joint representations of demonstrations similar to the query representation on a task subspace, and copy the searched representations into the query. Then, language model heads capture these copied label representations to a certain extent and decode them into predicted labels. Through careful measurements, the proposed inference circuit successfully captures and unifies many fragmented phenomena observed during the ICL process, making it a comprehensive and practical explanation of the ICL inference process. Moreover, ablation analysis by disabling the proposed steps seriously damages the ICL performance, suggesting the proposed inference circuit is a dominating mechanism. Additionally, we confirm and list some bypass mechanisms that solve ICL tasks in parallel with the proposed circuit.
Key facts. Cited by 16 papers in the map (data through 7 Oct 2026). Builds on 37 of its 53 references that are in the map. First posted on arXiv 6 Oct 2024.
Builds on
37 of 53 references.
References · 37
- 2015Character-level Convolutional Networks for Text Classificationcited by 2,293
- 2023Efficient Streaming Language Models with Attention Sinkscited by 2,115
- 2023Pythia: A Suite for Analyzing Large Language Models Across Training and Scalingcited by 1,734
- 2022Rethinking the Role of Demonstrations: What Makes In-Context Learning Work?cited by 1,413
- 2021Calibrate Before Use: Improving Few-Shot Performance of Language Modelscited by 1,371
- 2021Fantastically Ordered Prompts and Where to Find Them: Overcoming Few-Shot Prompt Order Sensitivitycited by 1,122
- 2024M3-Embedding: Multi-Linguality, Multi-Functionality, Multi-Granularity Text Embeddings Through Self-Knowledge Distillationcited by 1,050
- 2021An Explanation of In-context Learning as Implicit Bayesian Inferencecited by 915
- 2017A Survey on Multi-Task Learningcited by 838
- 2023The Falcon Series of Open Language Modelscited by 526
- 2023Larger language models do in-context learning differentlycited by 386
- 2024The Platonic Representation Hypothesiscited by 362
25 more
- 2023Trained Transformers Learn Linear Models In-Contextcited by 331
- 2013Good Debt or Bad Debt: Detecting Semantic Orientations in Economic Textscited by 310
- 2022Data Distributional Properties Drive Emergent In-Context Learning in Transformerscited by 303
- 2023Label Words are Anchors: An Information Flow Perspective for Understanding In-Context Learningcited by 235
- 2022Demystifying Prompts in Language Models via Perplexity Estimationcited by 215
- 2022Why Can GPT Learn In-Context? Language Models Implicitly Perform Gradient Descent as Meta-Optimizerscited by 204
- 2024Many-Shot In-Context Learningcited by 203
- 2023What In-Context Learning "Learns" In-Context: Disentangling Task Recognition and Task Learningcited by 149
- 2023Similarity of Neural Network Models: A Survey of Functional and Representational Measurescited by 128
- 2024In-Context Learning with Long-Context Models: An In-Depth Explorationcited by 126
- 2022Ground-Truth Labels Matter: A Deeper Look into Input-Label Demonstrationscited by 116
- 2023The mechanistic basis of data dependence and abrupt learning in an in-context classification taskcited by 115
- 2023Finding Support Examples for In-Context Learningcited by 104
- 2024What needs to go right for an induction head? A mechanistic study of in-context learning circuits and their formationcited by 86
- 2023The Transient Nature of Emergent In-Context Learning in Transformerscited by 72
- 2022Data Curation Alone Can Stabilize In-context Learningcited by 58
- 2023In-Context Learning Learns Label Relationships but Is Not Conventional Learningcited by 48
- 2024Let's Learn Step by Step: Enhancing In-Context Learning Ability with Curriculum Learningcited by 47
- 2023Pre-Training to Learn in Contextcited by 41
- 2023Understanding In-Context Learning via Supportive Pretraining Datacited by 41
- 2020Understanding Why Neural Networks Generalize Well Through GSNR of Parameterscited by 40
- 2024An Information-Theoretic Analysis of In-Context Learningcited by 39
- 2023Understanding Emergent In-Context Learning from a Kernel Regression Perspectivecited by 23
- 2024Token-based Decision Criteria Are Suboptimal in In-context Learningcited by 9
- 2024Label Words as Local Task Vectors in In-Context Learningcited by 3
Built on by
Citing papers per year: 2025: 11; 2026: 5.
16 papers.
Sort:
By area:
- 2025Beyond Induction Heads: In-Context Meta Learning Induces Multi-Phase Circuit Emergencecited by 10
- 2025Unifying Attention Heads and Task Vectors via Hidden State Geometry in In-Context Learningcited by 10
- 2025Understanding In-context Learning of Addition via Activation Subspacescited by 8
- 2025Train Once, Reuse Everywhere: Generalizable Implicit In-Context Learning by Routing Attentioncited by 8
- 2025Just-in-time and distributed task representations in language modelscited by 7
- 2026SafeSeek: Universal Attribution of Safety Circuits in Language Modelscited by 4
- 2025Task Vectors, Learned Not Extracted: Performance Gains and Mechanistic Insightcited by 3
- 2025StaICC: Standardized Evaluation for Classification Task in In-context Learningcited by 2
- 2025Implicit In-Context Learning: Evidence from Artificial Language Experimentscited by 2
- 2025Illusion or Algorithm? Investigating Memorization, Emergence, and Symbolic Processing in In-Context Learningcited by 2
- 2026Understanding the Dynamics of Demonstration Conflict in In-Context Learningcited by 2
- 2025Binary Autoencoder for Mechanistic Interpretability of Large Language Modelscited by 1
4 more
- 2025Localizing Task Recognition and Task Learning in In-Context Learning via Attention Head Analysiscited by 0
- 2026Emergent Structured Representations Support Flexible In-Context Inference in Large Language Modelscited by 0
- 2026RESCUE: Repairing Language Model Errors to Sparse Circuits via Reinforcement Learningcited by 0
- 2026Are In-Context Images Worth 10 Dimensions?cited by 0
- 2026Are In-Context Images Worth 10 Dimensions?29 Sep 2026
- 2026RESCUE: Repairing Language Model Errors to Sparse Circuits via Reinforcement Learning29 Sep 2026
- 2026SafeSeek: Universal Attribution of Safety Circuits in Language Models24 Mar 2026
- 2026Understanding the Dynamics of Demonstration Conflict in In-Context Learning3 Mar 2026
- 2026Emergent Structured Representations Support Flexible In-Context Inference in Large Language Models8 Feb 2026
- 2025Task Vectors, Learned Not Extracted: Performance Gains and Mechanistic Insight29 Sep 2025
- 2025Localizing Task Recognition and Task Learning in In-Context Learning via Attention Head Analysis29 Sep 2025
- 2025Train Once, Reuse Everywhere: Generalizable Implicit In-Context Learning by Routing Attention26 Sep 2025
- 2025Binary Autoencoder for Mechanistic Interpretability of Large Language Models25 Sep 2025
- 2025Just-in-time and distributed task representations in language models28 Aug 2025
- 2025Unifying Attention Heads and Task Vectors via Hidden State Geometry in In-Context Learning24 May 2025
- 2025Beyond Induction Heads: In-Context Meta Learning Induces Multi-Phase Circuit Emergence22 May 2025
4 more
- 2025Illusion or Algorithm? Investigating Memorization, Emergence, and Symbolic Processing in In-Context Learning16 May 2025
- 2025Understanding In-context Learning of Addition via Activation Subspaces8 May 2025
- 2025Implicit In-Context Learning: Evidence from Artificial Language Experiments31 Mar 2025
- 2025StaICC: Standardized Evaluation for Classification Task in In-context Learning27 Jan 2025
- 2025Beyond Induction Heads: In-Context Meta Learning Induces Multi-Phase Circuit Emergencecited by 10
- 2025Unifying Attention Heads and Task Vectors via Hidden State Geometry in In-Context Learningcited by 10
- 2025Understanding In-context Learning of Addition via Activation Subspacescited by 8
- 2025Train Once, Reuse Everywhere: Generalizable Implicit In-Context Learning by Routing Attentioncited by 8
- 2025Just-in-time and distributed task representations in language modelscited by 7
- 2025Task Vectors, Learned Not Extracted: Performance Gains and Mechanistic Insightcited by 3
- 2025StaICC: Standardized Evaluation for Classification Task in In-context Learningcited by 2
- 2025Implicit In-Context Learning: Evidence from Artificial Language Experimentscited by 2
- 2025Illusion or Algorithm? Investigating Memorization, Emergence, and Symbolic Processing in In-Context Learningcited by 2
- 2026Understanding the Dynamics of Demonstration Conflict in In-Context Learningcited by 2
- 2025Binary Autoencoder for Mechanistic Interpretability of Large Language Modelscited by 1
- 2025Localizing Task Recognition and Task Learning in In-Context Learning via Attention Head Analysiscited by 0
12 most cited of 15 All 15 (JSON)
- 2026Are In-Context Images Worth 10 Dimensions?29 Sep 2026
- 2026RESCUE: Repairing Language Model Errors to Sparse Circuits via Reinforcement Learning29 Sep 2026
- 2026Understanding the Dynamics of Demonstration Conflict in In-Context Learning3 Mar 2026
- 2026Emergent Structured Representations Support Flexible In-Context Inference in Large Language Models8 Feb 2026
- 2025Task Vectors, Learned Not Extracted: Performance Gains and Mechanistic Insight29 Sep 2025
- 2025Localizing Task Recognition and Task Learning in In-Context Learning via Attention Head Analysis29 Sep 2025
- 2025Train Once, Reuse Everywhere: Generalizable Implicit In-Context Learning by Routing Attention26 Sep 2025
- 2025Binary Autoencoder for Mechanistic Interpretability of Large Language Models25 Sep 2025
- 2025Just-in-time and distributed task representations in language models28 Aug 2025
- 2025Unifying Attention Heads and Task Vectors via Hidden State Geometry in In-Context Learning24 May 2025
- 2025Beyond Induction Heads: In-Context Meta Learning Induces Multi-Phase Circuit Emergence22 May 2025
- 2025Illusion or Algorithm? Investigating Memorization, Emergence, and Symbolic Processing in In-Context Learning16 May 2025
12 newest of 15 All 15 (JSON)