Decoding In-Context Learning: Neuroscience-inspired Analysis of Representations in Large Language Models
Not on the map. Why?
Abstract (arXiv)
Large language models (LLMs) exhibit remarkable performance improvement through in-context learning (ICL) by leveraging task-specific examples in the input. However, the mechanisms behind this improvement remain elusive. In this work, we investigate how LLM embeddings and attention representations change following in-context-learning, and how these changes mediate improvement in behavior. We employ neuroscience-inspired techniques such as representational similarity analysis (RSA) and propose novel methods for parameterized probing and measuring ratio of attention to relevant vs. irrelevant information in Llama-2 70B and Vicuna 13B. We designed two tasks with a priori relationships among their conditions: linear regression and reading comprehension. We formed hypotheses about expected similarities in task representations and measured hypothesis alignment of LLM representations before and after ICL as well as changes in attention. Our analyses revealed a meaningful correlation between improvements in behavior after ICL and changes in both embeddings and attention weights across LLM layers. This empirical framework empowers a nuanced understanding of how latent representations shape LLM behavior, offering valuable tools and insights for future research and practical applications.
Key facts. Cited by 7 papers in the map (data through 7 Oct 2026). Builds on 22 of its 26 references that are in the map. First posted on arXiv 30 Sep 2023.
Builds on
22 of 26 references.
References · 22
- 2020Language Models are Few-Shot Learnerscited by 32,199
- 2023LLaMA: Open and Efficient Foundation Language Modelscited by 13,958
- 2023Llama 2: Open Foundation and Fine-Tuned Chat Modelscited by 12,865
- 2022Chain-of-Thought Prompting Elicits Reasoning in Large Language Modelscited by 12,302
- 2021An Explanation of In-context Learning as Implicit Bayesian Inferencecited by 915
- 2021Probing Classifiers: Promises, Shortcomings, and Advancescited by 831
- 2023Progress measures for grokking via mechanistic interpretabilitycited by 822
- 2022Transformers learn in-context by gradient descentcited by 714
- 2023Towards Automated Circuit Discovery for Mechanistic Interpretabilitycited by 700
- 2022What learning algorithm is in-context learning? Investigations with linear modelscited by 671
- 2021All Bark and No Bite: Rogue Dimensions in Transformer Language Models Obscure Representational Qualitycited by 150
- 2023The Learnability of In-Context Learningcited by 126
10 more
- 2022Teaching Algorithmic Reasoning via In-context Learningcited by 111
- 2023In-Context Learning through the Bayesian Prismcited by 78
- 2023Evaluating Cognitive Maps and Planning in Large Language Models with CogEvalcited by 77
- 2023Meta-in-context learning in large language modelscited by 59
- 2019Correlating neural and symbolic representations of languagecited by 32
- 2020Picking BERT's Brain: Probing for Linguistic Dependencies in Contextualized Embeddings Using Representational Similarity Analysiscited by 18
- 2023ALLURE: Auditing and Improving LLM-based Evaluation of Text using Iterative In-Context-Learningcited by 15
- 2020Unequal Representations: Analyzing Intersectional Biases in Word Embeddings Using Representational Similarity Analysiscited by 12
- 2019Higher-order Comparisons of Sentence Encoder Representationscited by 10
- 2022Probing Semantic Grounding in Language Models of Code with Representational Similarity Analysiscited by 3
Built on by
Citing papers per year: 2025: 5; 2026: 2.
7 papers.
- 2025Probing Latent Subspaces in LLM for AI Security: Identifying and Manipulating Adversarial Statescited by 8
- 2025AUGUSTUS: An LLM-Driven Multimodal Agent System with Contextualized User Memorycited by 8
- 2025Position: We Need An Algorithmic Understanding of Generative AIcited by 5
- 2025AttentionDefense: Leveraging System Prompt Attention for Explainable Defense Against Novel Jailbreakscited by 3
- 2025Large Language Models as Model Organisms for Human Associative Learningcited by 1
- 2026Shaping Schema via Language Representation as the Next Frontier for LLM Intelligence Expandingcited by 1
- 2026Do Reasoning Models Enhance Embedding Models?cited by 0
- 2026Shaping Schema via Language Representation as the Next Frontier for LLM Intelligence Expanding10 May 2026
- 2026Do Reasoning Models Enhance Embedding Models?29 Jan 2026
- 2025Large Language Models as Model Organisms for Human Associative Learning24 Oct 2025
- 2025AUGUSTUS: An LLM-Driven Multimodal Agent System with Contextualized User Memory17 Oct 2025
- 2025Position: We Need An Algorithmic Understanding of Generative AI10 Jul 2025
- 2025AttentionDefense: Leveraging System Prompt Attention for Explainable Defense Against Novel Jailbreaks10 Apr 2025
- 2025Probing Latent Subspaces in LLM for AI Security: Identifying and Manipulating Adversarial States12 Mar 2025