mlsanityData to 14 Oct 2026

Understanding Emergent In-Context Learning from a Kernel Regression Perspective

arXiv 2305.12766 ↗First posted 22 May 2023cs.CL cs.AI cs.LGcited by 24

Not on the map. Why?

Abstract (arXiv)

Large language models (LLMs) have initiated a paradigm shift in transfer learning. In contrast to the classic pretraining-then-finetuning procedure, in order to use LLMs for downstream prediction tasks, one only needs to provide a few demonstrations, known as in-context examples, without adding more or updating existing model parameters. This in-context learning (ICL) capability of LLMs is intriguing, and it is not yet fully understood how pretrained LLMs acquire such capabilities. In this paper, we investigate the reason why a transformer-based language model can accomplish in-context learning after pre-training on a general language corpus by proposing a kernel-regression perspective of understanding LLMs' ICL bahaviors when faced with in-context examples. More concretely, we first prove that Bayesian inference on in-context prompts can be asymptotically understood as kernel regression hat y = sumi yi K(x, xi)/sumi K(x, xi) as the number of in-context demonstrations grows. Then, we empirically investigate the in-context behaviors of language models. We find that during ICL, the attention and hidden features in LLMs match the behaviors of a kernel regression. Finally, our theory provides insights into multiple phenomena observed in the ICL field: why retrieving demonstrative samples similar to test samples can help, why ICL performance is sensitive to the output formats, and why ICL accuracy benefits from selecting in-distribution and representative samples. Code and resources are publicly available at https://github.com/Glaciohound/Explain-ICL-As-Kernel-Regression.

Key facts. Cited by 24 papers in the map (data through 14 Oct 2026). Builds on 25 of its 50 references that are in the map. First posted on arXiv 22 May 2023.

Builds on

25 of 50 references.

References · 25

  1. 2017Attention Is All You Needcited by 60,361
  2. 2020Language Models are Few-Shot Learnerscited by 32,419
  3. 2022Chain-of-Thought Prompting Elicits Reasoning in Large Language Modelscited by 12,459
  4. 2019Sentence-BERT: Sentence Embeddings using Siamese BERT-Networkscited by 9,170
  5. 2022Large Language Models are Zero-Shot Reasonerscited by 4,374
  6. 2022Emergent Abilities of Large Language Modelscited by 2,512
  7. 2022Rethinking the Role of Demonstrations: What Makes In-Context Learning Work?cited by 1,434
  8. 2021Calibrate Before Use: Improving Few-Shot Performance of Language Modelscited by 1,392
  9. 2021What Makes Good In-Context Examples for GPT-3?cited by 1,195
  10. 2021Fantastically Ordered Prompts and Where to Find Them: Overcoming Few-Shot Prompt Order Sensitivitycited by 1,135
  11. 2021An Explanation of In-context Learning as Implicit Bayesian Inferencecited by 938
  12. 2022Transformers learn in-context by gradient descentcited by 732
13 more
  1. 2022What Can Transformers Learn In-Context? A Case Study of Simple Function Classescited by 715
  2. 2022What learning algorithm is in-context learning? Investigations with linear modelscited by 684
  3. 2021Learning To Retrieve Prompts for In-Context Learningcited by 648
  4. 2020Hopfield Networks is All You Needcited by 475
  5. 2023Larger language models do in-context learning differentlycited by 394
  6. 2022Data Distributional Properties Drive Emergent In-Context Learning in Transformerscited by 309
  7. 2022Why Can GPT Learn In-Context? Language Models Implicitly Perform Gradient Descent as Meta-Optimizerscited by 204
  8. 2021Reframing Instructional Prompts to GPTk's Languagecited by 176
  9. 2021Noisy Channel Language Model Prompting for Few-Shot Text Classificationcited by 165
  10. 2021Cutting Down on Prompts and Parameters: Simple Few-Shot Learning with Language Modelscited by 139
  11. 2021Open Vocabulary Electroencephalography-To-Text Decoding and Zero-shot Sentiment Classificationcited by 67
  12. 2022Insights into Pre-training via Simpler Synthetic Taskscited by 26
  13. 2023Calibrating Transformers via Sparse Gaussian Processescited by 21

Built on by

Cited by year (2026 to 14 Oct)

Citing papers per year: 2023: 1; 2024: 11; 2025: 3; 2026: 9.

24 papers.

Sort:

By area:

  1. 2023Challenges and Applications of Large Language Modelscited by 254
  2. 2024Visual In-Context Learning for Large Vision-Language Modelscited by 128
  3. 2024Can large language models explore in-context?cited by 76
  4. 2024Transformers Learn Nonlinear Features In Context: Nonconvex Mean-field Dynamics on the Attention Landscapecited by 46
  5. 2024Dual Operating Modes of In-Context Learningcited by 43
  6. 2024In-Context Learning with Transformers: Softmax Attention Adapts to Function Lipschitznesscited by 22
  7. 2024Revisiting In-context Learning Inference Circuit in Large Language Modelscited by 17
  8. 2025Understanding In-Context Learning on Structured Manifolds: Bridging Attention to Kernel Methodscited by 15
  9. 2024Does learning the right latent variables necessarily improve in-context learning?cited by 13
  10. 2024What Makes In-context Learning Effective for Mathematical Reasoning: A Theoretical Analysiscited by 7
  11. 2024On the Learn-to-Optimize Capabilities of Transformers in In-Context Sparse Recoverycited by 6
  12. 2026Interpretable Tabular Foundation Models via In-Context Kernel Regressioncited by 4
12 more
  1. 2026OpenRFM: Dissecting Relational In-Context Learningcited by 4
  2. 2024From Unstructured Data to In-Context Learning: Exploring What Tasks Can Be Learned and Whencited by 3
  3. 2024Towards the Effect of Examples on In-Context Learning: A Theoretical Case Studycited by 2
  4. 2025In-Context Learning for Gradient-Free Receiver Adaptation: Principles, Applications, and Theorycited by 1
  5. 2025Mamba Can Learn Low-Dimensional Targets In-Context via Test-Time Feature Learningcited by 1
  6. 2026Transformers Can Implement Preconditioned Richardson Iteration for In-Context Gaussian Kernel Regressioncited by 1
  7. 2026Privacy Vulnerabilities of Attention Layers in Tabular Foundation Models and Protection of High-Risk Queriescited by 1
  8. 2026Training-Free Universal Approximation by Prompting Random Transformerscited by 1
  9. 2026Implicit Statistical Inference in Transformers: Approximating Likelihood-Ratio Tests In-Contextcited by 0
  10. 2026Symmetry Reveals Layerwise Dynamics: How Transformers Perform In-Context Classificationcited by 0
  11. 2026When Correct Demonstrations Hurt: Rethinking the Role of Exemplars in In-Context Learningcited by 0
  12. 2026Large Discovery Models: Empirically-grounded Model-Based Open-Ended Searchcited by 0