Student or educator? Sign up with your school email and get 6 months of Pro free.
PreprintCited by 34Explainable Artificial Intelligence (XAI)Topic ModelingDomain Adaptation and Few-Shot Learning

The DOI matches its DataCite record; 20 of the 21 references it cites were found in a registry or an index, and 1 are not checked yet; none of the 53 sources its claims cite is checked for support yet.

The Mystery of In-Context Learning: A Comprehensive Survey on Interpretation and Analysis

Open access

Abstract

Understanding in-context learning (ICL) capability that enables large language models (LLMs) to excel in proficiency through demonstration examples is of utmost importance. This importance stems not only from the better utilization of this capability across various tasks, but also from the proactive identification and mitigation of potential risks, including concerns regarding truthfulness, bias, and toxicity, that may arise alongside the capability. In this paper, we present a thorough survey on the interpretation and analysis of in-context learning. First, we provide a concise introduction to the background and definition of in-context learning. Then, we give an overview of advancements from two perspectives: 1) a theoretical perspective, emphasizing studies on mechanistic interpretability and delving into the mathematical foundations behind ICL; and 2) an empirical perspective, concerning studies that empirically analyze factors associated with ICL. We conclude by highlighting the challenges encountered and suggesting potential avenues for future research. We believe that our work establishes the basis for further exploration into the interpretation of in-context learning. Additionally, we have created a repository containing the resources referenced in our survey.

Checked 2026-11-14 · 1 reference not checked yet

Overview

CoChat Summary

TL;DR

This survey reviews interpretation and analysis of in-context learning (ICL) in large language models, organizing research into theoretical and empirical perspectives. It concludes that ICL remains incompletely understood, with contradictory empirical findings and open questions about causality, evaluation, demonstration selection, and trustworthiness.

Key findings

  • Theoretical accounts explain ICL through mechanistic interpretability, regression-function learning, gradient descent/meta-optimization, and Bayesian inference; for example, Olsson et al. argue induction heads may be the primary mechanistic source of ICL, and Jeon et al. derive an in-context error upper bound of log(N)/τ for a sparse mixture of transformers, where N is the number of mixture components and τ is the in-context length.
  • Empirical studies report that ICL performance is influenced by pre-training data properties, model scale/architecture/objective, demonstration order, and input-label mappings; Lu et al. tested all 24 permutations of four demonstrations and found performance varies by order and model size, with optimal order being model-dependent.
  • Findings conflict across studies: some report a positive correlation between ICL performance and term frequency in pre-training data, while others find long-tail or low-frequency tokens contribute more; Min et al. report low sensitivity to label accuracy, whereas Yoo et al., Wei et al., and Kossen et al. argue accurate input-label mappings are important.
  • The survey identifies open challenges: theoretical conclusions are often limited to simplified architectures and controlled synthetic settings, empirical conclusions often rely on correlations rather than causal relations, and dedicated ICL evaluation metrics and causal benchmarks are lacking.

Methods

  • Survey/position paper: reviews and organizes existing literature on ICL interpretation and analysis into theoretical and empirical categories, summarized in a table.
  • No new experiments or datasets; it synthesizes cited studies across model families and tasks and provides formal definitions and notation for the ICL paradigm.
  • Concludes by discussing open questions and future directions, including correlation vs. causation, evaluation, demonstration selection, and trustworthiness.

Limitations

  • Stated: many referenced studies are only briefly described due to space limitations; the survey focuses on ICL and excludes other emergent LLM capabilities such as chain-of-thought and instruction following.
  • Evident from the text: the survey itself notes contradictory findings and that most empirical conclusions rely on correlations rather than causal relations, with confounding factors; theoretical conclusions are limited to simplified model architectures and controlled synthetic settings.
  • Evident: as a survey, it does not provide new primary data or resolve the open questions it raises.

Model-written summary. Check it against the paper before relying on it.

Integrity signals

Registry

DataCite · 10.48550/arxiv.2311.00237

Cites

20 of 21 references verified0 citation errors · 0 not checkable

Statistics

Nothing to recompute.

Figures

Figure 1 Illustration of In-context Learning.
Figure 1 Illustration of In-context Learning.CC-BY · From the PDF

Verification

Claims the paper makes

0 Valid · 0 Not valid · 33 Not checked · 7 Own results and interpretations

10 more claims

Create a free account to see all 40 claims and to verify the 4 references still open.

See all claims — free account
  • Probably not a substantial claim. 18
  • It may state two separate claims as one. 9

Create a free account to see these claims.

Citations

Cites

Show all 18 references

Research works printed but not linked: 64

  1. Ekin Akyürek, Dale Schuurmans, Jacob Andreas, Tengyu Ma, and Denny Zhou. 2023. What learn- ing algorithm is in-context learning? investigations with linear models. In Proc. of ICLR.
  2. Ekin Akyürek, Bailin Wang, Yoon Kim, and Jacob An- dreas. 2024. In-context language learning: Architec- tures and algorithms. In Proc. of ICML.
  3. Yu Bai, Fan Chen, Haiquan Wang, Caiming Xiong, and Song Mei. 2023. Transformers as statisticians: Prov- able in-context learning with in-context algorithm selection. In Proc. of NeurIPS.
  4. Leonard E. Baum and Ted Petrie. 1966. Statistical infer- ence for probabilistic functions of finite state markov chains. Annals of Mathematical Statistics, 37:1554- 1563.
  5. Stella Biderman, Hailey Schoelkopf, Quentin Anthony, Herbie Bradley, Kyle O'Brien, Eric Hallahan, Mo- hammad Aflah Khan, Shivanshu Purohit, USVSN Sai Prashanth, Edward Raff, Aviya Skowron, Lintang Sutawika, and Oskar Van Der Wal. 2023. Pythia: a suite for analyzing large language models across training and scaling. In Proc. of ICML. · doi:10.5555/3618408.3618510
  6. Eric J. Bigelow, Ekdeep Singh Lubana, Robert P. Dick, Hidenori Tanaka, and Tomer David Ullman. 2024. In-context learning dynamics with random binary sequences. In Proc. of ICLR.
  7. Tom B. Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah, Jared Kaplan, Prafulla Dhariwal, Arvind Neelakantan, Pranav Shyam, Girish Sastry, Amanda Askell, Sandhini Agarwal, Ariel Herbert-Voss, Gretchen Krueger, Tom Henighan, Rewon Child, Aditya Ramesh, Daniel M. Ziegler, Jeffrey Wu, Clemens Winter, Christopher Hesse, Mark Chen, Eric Sigler, Mateusz Litwin, Scott Gray, Benjamin Chess, Jack Clark, Christopher Berner, Sam McCandlish, Alec Radford, Ilya Sutskever, and Dario Amodei. 2020. Language models are few-shot learners. In Proc. of NeurIPS.
  8. Stephanie C. Y. Chan, Adam Santoro, Andrew Kyle Lampinen, Jane X. Wang, Aaditya K Singh, Pierre H. Richemond, Jay Mcclelland, and Felix Hill. 2022. Data distributional properties drive emergent in- context learning in transformers. In Proc. of NeurIPS.
  9. Paul F Christiano, Jan Leike, Tom Brown, Miljan Mar- tic, Shane Legg, and Dario Amodei. 2017. Deep reinforcement learning from human preferences. In Prof. of NeurIPS.
  10. Zheng Chu, Jingchang Chen, Qianglong Chen, Weijiang Yu, Tao He, Haotian Wang, Weihua Peng, Ming Liu, Bing Qin, and Ting Liu. 2024. Navigate through enigmatic labyrinth a survey of chain of thought rea- soning: Advances, frontiers and future. In Proc. of ACL.
  11. Hyung Won Chung, Le Hou, S. Longpre, Barret Zoph, Yi Tay, William Fedus, Eric Li, Xuezhi Wang, Mostafa Dehghani, Siddhartha Brahma, Albert Web- son, Shixiang Shane Gu, Zhuyun Dai, Mirac Suz- gun, Xinyun Chen, Aakanksha Chowdhery, Dasha Valter, Sharan Narang, Gaurav Mishra, Adams Wei Yu, Vincent Zhao, Yanping Huang, Andrew M. Dai, Hongkun Yu, Slav Petrov, Ed Huai hsin Chi, Jeff Dean, Jacob Devlin, Adam Roberts, Denny Zhou, Quoc V. Le, and Jason Wei. 2024. Scaling instruction-finetuned language models. Journal of Machine Learning Research, 25(70):1-53.
  12. Damai Dai, Yutao Sun, Li Dong, Yaru Hao, Zhifang Sui, and Furu Wei. 2023. Why can gpt learn in-context? language models secretly perform gradient descent as meta-optimizers. In Proc. of ACL.
  13. Gilad Deutch, Nadav Magar, Tomer Bar Natan, and Guy Dar. 2024. In-context learning and gradient descent revisited. In Proc. of NAACL.
  14. Guhao Feng, Bohang Zhang, Yuntian Gu, Haotian Ye, Di He, and Liwei Wang. 2023. Towards revealing the mystery behind chain of thought: A theoretical perspective. In Proc. of NeurIPS.
  15. Deqing Fu, Tian-Qi Chen, Robin Jia, and Vatsal Sharan. 2024. Transformers learn higher-order optimization methods for in-context learning: A study with linear models. arXiv preprint arXiv:2310.17086. · arXiv
  16. Shivam Garg, Dimitris Tsipras, Percy Liang, and Gre- gory Valiant. 2022. What can transformers learn in-context? a case study of simple function classes. In Proc. of NeurIPS 2022.
  17. Walter Gautschi. 2011. Numerical analysis. Springer Science & Business Media.
  18. Tianyu Guo, Wei Hu, Song Mei, Huan Wang, Caiming Xiong, Silvio Savarese, and Yu Bai. 2024. How do transformers learn in-context beyond simple func- tions? a case study on learning with representations. In Proc. of ICLR.
  19. Xiaochuang Han, Daniel Simig, Todor Mihaylov, Yulia Tsvetkov, Asli Celikyilmaz, and Tianlu Wang. 2023. Understanding in-context learning via supportive pre- training data. In Proc. of ACL.
  20. Roee Hendel, Mor Geva, and Amir Globerson. 2023. In-context learning creates task vectors. In Proc. Findings of EMNLP.
  21. Jordan Hoffmann, Sebastian Borgeaud, Arthur Mensch, Elena Buchatskaya, Trevor Cai, Eliza Rutherford, Diego de Las Casas, Lisa Anne Hendricks, Johannes Welbl, Aidan Clark, Tom Hennigan, Eric Noland, Katie Millican, George van den Driessche, Bogdan Damoc, Aurelia Guy, Simon Osindero, Karen Si- monyan, Erich Elsen, Jack W. Rae, Oriol Vinyals, and L. Sifre. 2022. Training compute-optimal large language models. In Proc. of NeurIPS.
  22. John E. Hopcroft. 1971. An n log n algorithm for minimizing states in a finite automaton. In Proc. of ISTMC.
  23. Hong Jun Jeon, Jason D. Lee, Qi Lei, and Benjamin Van Roy. 2024. An information-theoretic analysis of in- context learning. In Proc. of ICML.
  24. Zhijing Jin, Jia-Rou Liu, Zhiheng Lyu, Spencer Poff, Mrinmaya Sachan, Rada Mihalcea, Mona T. Diab, and Bernhard Scholkopf. 2024. Can large language models infer causation from correlation? In Proc. of ICLR.
  25. Nikhil Kandpal, Haikang Deng, Adam Roberts, Eric Wallace, and Colin Raffel. 2023. Large language models struggle to learn long-tail knowledge. In Proc. of ICML.
  26. Boseop Kim, HyoungSeok Kim, Sang-Woo Lee, Gichang Lee, Donghyun Kwak, Jeon Dong Hyeon, Sunghyun Park, Sungju Kim, Seonhoon Kim, Dong- pil Seo, Heungsub Lee, Minyoung Jeong, Sungjae Lee, Minsub Kim, Suk Hyun Ko, Seokhun Kim, Taeyong Park, Jinuk Kim, Soyoung Kang, Na-Hyeon Ryu, Kang Min Yoo, Minsuk Chang, Soobin Suh, Sookyo In, Jinseong Park, Kyungduk Kim, Hiun Kim, Jisu Jeong, Yong Goo Yeo, Donghoon Ham, Dongju Park, Min Young Lee, Jaewook Kang, Inho Kang, Jung-Woo Ha, Woomyoung Park, and Nako Sung. 2021. What changes can large-scale language mod- els bring? intensive study on HyperCLOVA: Billions- scale Korean generative pretrained transformers. In Proc. of EMNLP.
  27. Jannik Kossen, Tom Rainforth, and Yarin Gal. 2024. In-context learning in large language models learns label relationships but is not conventional learning. Proc. of ICLR.
  28. Emre Kıcıman, Robert Osazuwa Ness, Amit Sharma, and Chenhao Tan. 2024. Causal reasoning and large language models: Opening a new frontier for causal- ity. Transactions on Machine Learning Research.
  29. Yingcong Li, Muhammed Emrullah Ildiz, Dimitris Pa- pailiopoulos, and Samet Oymak. 2023b. Transform- ers as algorithms: Generalization and stability in in-context learning. In Proc. of ICML.
  30. Ziqian Lin and Kangwook Lee. 2024. Dual operating modes of in-context learning. In Workshop of ICLR.
  31. Jiachang Liu, Dinghan Shen, Yizhe Zhang, Bill Dolan, Lawrence Carin, and Weizhu Chen. 2022. What makes good in-context examples for GPT-3? In Proc. of DeeLIO.
  32. Nelson F. Liu, Kevin Lin, John Hewitt, Ashwin Paran- jape, Michele Bevilacqua, Fabio Petroni, and Percy Liang. 2024. Lost in the middle: How language mod- els use long contexts. Transactions of the Association for Computational Linguistics.
  33. Sheng Lu, Irina Bigoulaeva, Rachneet Sachdeva, Har- ish Tayyar Madabushi, and Iryna Gurevych. 2024. Are emergent abilities in large language models just in-context learning? In Proc. of ACL.
  34. Sewon Min, Xinxi Lyu, Ari Holtzman, Mikel Artetxe, Mike Lewis, Hannaneh Hajishirzi, and Luke Zettle- moyer. 2022. Rethinking the role of demonstrations: What makes in-context learning work? In Proc. of EMNLP.
  35. Long Ouyang, Jeffrey Wu, Xu Jiang, Diogo Almeida, Carroll Wainwright, Pamela Mishkin, Chong Zhang, Sandhini Agarwal, Katarina Slama, Alex Ray, John Schulman, Jacob Hilton, Fraser Kelton, Luke Miller, Maddie Simens, Amanda Askell, Peter Welinder, Paul F Christiano, Jan Leike, and Ryan Lowe. 2022. Training language models to follow instructions with human feedback. In Proc. of NeurIPS.
  36. Jane Pan, Tianyu Gao, Howard Chen, and Danqi Chen. 2023. What in-context learning "learns" in-context: Disentangling task recognition and task learning. In Proc. Findings of ACL.
  37. Madhuri Panwar, Kabir Ahuja, and Navin Goyal. 2024. In-context learning through the bayesian prism. In Proc. of ICLR.
  38. Fábio Perez and Ian Ribeiro. 2022. Ignore previous prompt: Attack techniques for language models. In Workshop NeurIPS.
  39. Krishna Pillutla, Swabha Swayamdipta, Rowan Zellers, John Thickstun, Sean Welleck, Yejin Choi, and Zaïd Harchaoui. 2021. Mauve: Measuring the gap be- tween neural text and human text using divergence frontiers. In Proc. of NeurIPS.
  40. Allan Raventós, Mansheej Paul, F. Chen, and Surya Ganguli. 2023. Pretraining task diversity and the emergence of non-bayesian in-context learning for regression. In Proc. of NeurIPS.
  41. Yasaman Razeghi, Robert L Logan IV, Matt Gardner, and Sameer Singh. 2022. Impact of pretraining term frequencies on few-shot reasoning. In Proc. of EMNLP.
  42. Avik Sarkar, Paul H. Garthwaite, and Anne N. De Roeck. 2005. A bayesian mixture model for term re-occurrence and burstiness. In Proc. of CoNLL.
  43. Rylan Schaeffer, Brando Miranda, and Oluwasanmi Koyejo. 2023. Are emergent abilities of large lan- guage models a mirage? In Proc. of NeurIPS.
  44. Lingfeng Shen, Aayush Mishra, and Daniel Khashabi. 2024. Do pretrained transformers learn in-context by gradient descent? In Proc. of ICML.
  45. Seongjin Shin, Sang-Woo Lee, Hwijeen Ahn, Sungdong Kim, Hyoungseok Kim, Boseop Kim, Kyunghyun Cho, Gichang Lee, Woo Chul Park, Jung-Woo Ha, and Nako Sung. 2022. On the effect of pretraining corpora on in-context learning by a large-scale lan- guage model. In Proc. of NAACL.
  46. Chenglei Si, Dan Friedman, Nitish Joshi, Shi Feng, Danqi Chen, and He He. 2023. Measuring induc- tive biases of in-context learning with underspecified demonstrations. In Proc. of ACL.
  47. Aaditya K. Singh, Stephanie C. Y. Chan, Ted Moskovitz, Erin Grant, Andrew M. Saxe, and Felix Hill. 2023. The transient nature of emergent in-context learning in transformers. In Proc. of NeurIPS.
  48. Siva K. Swaminathan, Antoine Dedieu, Rajkumar Va- sudeva Raju, Murray Shanahan, Miguel Lázaro- Gredilla, and Dileep George. 2023. Schema-learning and rebinding as mechanisms of in-context learning and emergence. In Proc. of NeurIPS.
  49. Ruixiang Tang, Dehan Kong, Longtao Huang, and Hui Xue. 2023. Large language models can be lazy learn- ers: Analyze shortcuts in in-context learning. In Findings of ACL.
  50. Yi Tay, Mostafa Dehghani, Vinh Q. Tran, Xavier Gar- cía, Dara Bahri, Tal Schuster, Huaixiu Steven Zheng, Neil Houlsby, and Donald Metzler. 2023. Unifying language learning paradigms. In Proc. of ICLR.
  51. Eric Todd, Millicent Li, Arnab Sen Sharma, Aaron Mueller, Byron C. Wallace, and David Bau. 2024. Function vectors in large language models. In Proc. of ICLR.
  52. Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N. Gomez, Lukasz Kaiser, and Illia Polosukhin. 2017. Attention is all you need. In Proc. of NeurIPS.
  53. Johannes von Oswald, Eyvind Niklasson, E. Randazzo, João Sacramento, Alexander Mordvintsev, Andrey Zhmoginov, and Max Vladymyrov. 2023a. Trans- formers learn in-context by gradient descent. In Proc. of ICML.
  54. Lean Wang, Lei Li, Damai Dai, Deli Chen, Hao Zhou, Fandong Meng, Jie Zhou, and Xu Sun. 2023a. Label words are anchors: An information flow perspective for understanding in-context learning. In Proc. of EMNLP.
  55. Xinyi Wang, Wanrong Zhu, Michael Stephen Saxon, and William Yang Wang. 2023b. Large language models are implicitly topic models: Explaining and finding good demonstrations for in-context learning. In Proc. of ICML.
  56. Larry A. Wasserman. 2000. Bayesian model selection and model averaging. Journal of mathematical psy- chology, 44 1:92-107.
  57. Jason Wei, Maarten Bosma, Vincent Y. Zhao, Kelvin Guu, Adams Wei Yu, Brian Lester, Nan Du, An- drew M. Dai, and Quoc V. Le. 2022a. Finetuned language models are zero-shot learners. In Proc. of ICLR.
  58. Jason Wei, Yi Tay, Rishi Bommasani, Colin Raf- fel, Barret Zoph, Sebastian Borgeaud, Dani Yo- gatama, Maarten Bosma, Denny Zhou, Donald Met- zler, Ed Huai hsin Chi, Tatsunori Hashimoto, Oriol Vinyals, Percy Liang, Jeff Dean, and William Fedus. 2022b. Emergent abilities of large language models. Transactions on Machine Learning Research.
  59. Noam Wies, Yoav Levine, and Amnon Shashua. 2023. The learnability of in-context learning. In Proc. of NeurIPS.
  60. Yanzheng Xiang, Hanqi Yan, Lin Gui, and Yulan He. 2024. Addressing order sensitivity of in-context demonstration examples in causal language models. In Proc. Findings of ACL.
  61. Sang Michael Xie, Aditi Raghunathan, Percy Liang, and Tengyu Ma. 2022. An explanation of in-context learning as implicit bayesian inference. In Proc. of ICLR.
  62. Kang Min Yoo, Junyeob Kim, Hyuhng Joon Kim, Hyun- soo Cho, Hwiyeol Jo, Sang-Woo Lee, Sang-goo Lee, and Taeuk Kim. 2022. Ground-truth labels matter: A deeper look into input-label demonstrations. In Proc. of EMNLP.
  63. Yiming Zhang, Shi Feng, and Chenhao Tan. 2022. Ac- tive example selection for in-context learning. In Proc. of EMNLP.
  64. Zihao Zhao, Eric Wallace, Shi Feng, Dan Klein, and Sameer Singh. 2021. Calibrate before use: Improv- ing few-shot performance of language models. In Proc. of ICML.

Cited by

Metadata

Authors
Zhou, Y., Li, J., Xiang, Y., Yan, H., Gui, L., & He, Y.
Affiliations
King's College London (GB)
Venue
arXiv
Publisher
arXiv
Published
2023
Pages
14365-14378
OpenAlex
W4404782475
Cited by
33
References
18
Citations by year
2026: 15 · 2025: 14 · 2024: 3
FWCI
4.89
Type
conference paper
Language
en
Open access
Locations
  • Conference on Empirical Methods in Natural Language Processing (EMNLP) (publishedVersion, cc-by)
  • arXiv (Cornell University) (submittedVersion, cc-by)
  • arXiv (Cornell University) (cc-by)
Funders
  • Engineering and Physical Sciences Research Council (EP/V020579/1, EP/V020579/2, EP/X019063/1)
  • Innovate UK (10093055)
Topics
  • Physical Sciences › Computer Science › Artificial Intelligence › Explainable Artificial Intelligence (XAI)
  • Physical Sciences › Computer Science › Artificial Intelligence › Topic Modeling
  • Physical Sciences › Computer Science › Artificial Intelligence › Domain Adaptation and Few-Shot Learning
Keywords
in-context learning, large language models, mechanistic interpretability, honesty, bias, toxicity, risk mitigation

About these checks

Registry, retraction, Cites and statistics results are computed, not judged, with one exception: a printed reference that no index lists is read once by a model before it counts as a citation error. Claims are extracted by a model and kept only when their quote appears verbatim in the text; each cited source is then checked, with a model’s help, for whether it says what the claim relies on. Those verdicts can be wrong — read the claim’s quote and the cited source before relying on one.

A language model drew the claims from the paper on 2026-11-14, under version 3 of the claim definition (model deepseek-v4.1-flash, prompt extract-v3).

A second model labelled each claim on 2026-11-14 (model jev-1.13-20260917, definition revision gold-guideline-v0.2).

Statistics and arithmetic are recomputed, not judged.

Confidence bands are shown only for fields calibrated on our annotated test set. None is calibrated yet, so no band is shown.

What counts as a claim ›How we measure confidence ›How we check this ›

Are you an author, or do you see a problem with this page? Request a review

Data sources

Bibliographic data: Semantic Scholar, OpenAlex, Crossref.

Contains information from the Semantic Scholar Academic Graph Datasets, made available under the ODC Attribution License (ODC-BY 1.0).

Semantic Scholar’s data is described in: Kinney, R., et al. (2023). The Semantic Scholar Open Data Platform. arXiv:2301.10140.