mlsanityData to 7 Oct 2026

When Does Context Help? Error Dynamics of Contextual Information in Large Language Models

arXiv 2602.08294 ↗First posted 9 Feb 2026cs.CLcited by 0

Not on the map. Why?

Abstract (arXiv)

Contextual information at inference time, such as demonstrations, retrieved knowledge, or interaction history, can substantially improve large language models (LLMs) without parameter updates, yet its theoretical role remains poorly understood beyond specific settings such as in-context learning (ICL). We present a unified theoretical framework for analyzing the effect of arbitrary contextual information in Transformer-based LLMs. Our analysis characterizes contextual influence through output error dynamics. In a single-layer Transformer, we prove that the context-conditioned error vector decomposes additively into the baseline error vector and a contextual correction vector. This yields necessary geometric conditions for error reduction: the contextual correction must align with the negative baseline error and satisfy a norm constraint. We further show that the contextual correction norm admits an explicit upper bound determined by context-query relevance and complementarity. These results extend to multi-context and multi-layer Transformers. Experiments across ICL, retrieval-augmented generation, and memory evolution validate our theory and motivate a principled context selection strategy that improves performance by 0.6%.

Key facts. No citing papers in the map yet (data through 7 Oct 2026). Builds on 32 of its 42 references that are in the map. First posted on arXiv 9 Feb 2026.

Builds on

32 of 42 references.

References · 32

  1. 2017Attention Is All You Needcited by 59,932
  2. 2023Efficient Memory Management for Large Language Model Serving with PagedAttentioncited by 5,767
  3. 2021Measuring Mathematical Problem Solving With the MATH Datasetcited by 5,203
  4. 2020Dense Passage Retrieval for Open-Domain Question Answeringcited by 3,779
  5. 2023Let's Verify Step by Stepcited by 3,598
  6. 2023GPQA: A Graduate-Level Google-Proof Q&A Benchmarkcited by 2,748
  7. 2023ExpeL: LLM Agents Are Experiential Learnerscited by 814
  8. 2021FinQA: A Dataset of Numerical Reasoning over Financial Datacited by 552
  9. 2023DoReMi: Optimizing Data Mixtures Speeds Up Language Model Pretrainingcited by 385
  10. 2023Trained Transformers Learn Linear Models In-Contextcited by 331
  11. 2023TheoremQA: A Theorem-driven Question Answering datasetcited by 189
  12. 2024Are We Done with MMLU?cited by 178
20 more
  1. 2023One Step of Gradient Descent is Provably the Optimal In-Context Learner with One Layer of Linear Self-Attentioncited by 168
  2. 2025Dynamic Cheatsheet: Test-Time Learning with Adaptive Memorycited by 146
  3. 2025Evo-Memory: Benchmarking LLM Agent Test-time Learning with Self-Evolving Memorycited by 129
  4. 2024InstructRAG: Instructing Retrieval-Augmented Generation via Self-Synthesized Rationalescited by 100
  5. 2024Sufficient Context: A New Lens on Retrieval Augmented Generation Systemscited by 69
  6. 2024Asymptotic theory of in-context learning by linear attentioncited by 54
  7. 2024Competition Dynamics Shape Algorithmic Phases of In-Context Learningcited by 52
  8. 2024CHAMP: A Competition-level Dataset for Fine-Grained Analyses of LLMs' Mathematical Reasoning Capabilitiescited by 43
  9. 2024In-Context Learning with Representations: Contextual Generalization of Trained Transformerscited by 36
  10. 2024How Do Nonlinear Transformers Learn and Generalize in In-Context Learning?cited by 35
  11. 2023The Mystery of In-Context Learning: A Comprehensive Survey on Interpretation and Analysiscited by 34
  12. 2025CoLA: Compute-Efficient Pre-Training of LLMs via Low-Rank Activationcited by 28
  13. 2024Differential learning kinetics govern the transition from memorization to generalization during in-context learningcited by 19
  14. 2025Exploring the Role of Diversity in Example Selection for In-Context Learningcited by 12
  15. 2024A Theory for Token-Level Harmonization in Retrieval-Augmented Generationcited by 7
  16. 2024Quantifying reliance on external information over parametric knowledge during Retrieval Augmented Generation (RAG) using mechanistic analysiscited by 7
  17. 2025In-context denoising with one-layer transformers: connections between attention and associative memory retrievalcited by 7
  18. 2025Learning to Select In-Context Demonstration Preferred by Large Language Modelcited by 5
  19. 2025ReFeed: Multi-dimensional Summarization Refinement with Reflective Reasoning on Feedbackcited by 4
  20. 2025Topic Coverage-based Demonstration Retrieval for In-Context Learningcited by 3

Built on by

Not cited yet.

Similar, not cited

Close in wording, no citation either way

  1. 2024Racing Thoughts: Explaining Contextualization Errors in Large Language Models
  2. 2026Beyond the Parameters: A Technical Survey of Contextual Enrichment in Large Language Models: From In-Context Prompting to Causal Retrieval-Augmented Generation
  3. 2025A Survey of Context Engineering for Large Language Models
  4. 2024Does In-Context Learning Really Learn? Rethinking How Large Language Models Respond and Solve Tasks via In-Context Learning
  5. 2024Enhancing and Accelerating Large Language Models via Instruction-Aware Contextual Compression
  6. 2026Context Collapse: In-Context Learning and Model Collapse
  7. 2025A Survey on Transformer Context Extension: Approaches and Evaluation
  8. 2026Understanding Contextual Recall in Transformers: How Finetuning Enables In-Context Reasoning over Pretraining Knowledge