Llama See, Llama Do: A Mechanistic Perspective on Contextual Entrainment and Distraction in LLMs
Not on the map. Why?
Abstract (arXiv)
We observe a novel phenomenon, contextual entrainment, across a wide range of language models (LMs) and prompt settings, providing a new mechanistic perspective on how LMs become distracted by ``irrelevant'' contextual information in the input prompt. Specifically, LMs assign significantly higher logits (or probabilities) to any tokens that have previously appeared in the context prompt, even for random tokens. This suggests that contextual entrainment is a mechanistic phenomenon, occurring independently of the relevance or semantic relation of the tokens to the question or the rest of the sentence. We find statistically significant evidence that the magnitude of contextual entrainment is influenced by semantic factors. Counterfactual prompts have a greater effect compared to factual ones, suggesting that while contextual entrainment is a mechanistic phenomenon, it is modulated by semantic factors. We hypothesise that there is a circuit of attention heads -- the entrainment heads -- that corresponds to the contextual entrainment phenomenon. Using a novel entrainment head discovery method based on differentiable masking, we identify these heads across various settings. When we ``turn off'' these heads, i.e., set their outputs to zero, the effect of contextual entrainment is significantly attenuated, causing the model to generate output that capitulates to what it would produce if no distracting context were provided. Our discovery of contextual entrainment, along with our investigation into LM distraction via the entrainment heads, marks a key step towards the mechanistic analysis and mitigation of the distraction problem.
Key facts. Cited by 6 papers in the map (data through 7 Oct 2026). Builds on 20 of its 33 references that are in the map. First posted on arXiv 14 May 2025.
Builds on
20 of 33 references.
References · 20
- 2020Language Models are Few-Shot Learnerscited by 32,199
- 2023LLaMA: Open and Efficient Foundation Language Modelscited by 13,958
- 2022Locating and Editing Factual Associations in GPTcited by 2,609
- 2013Estimating or Propagating Gradients Through Stochastic Neurons for Conditional Computationcited by 2,031
- 2022Interpretability in the Wild: a Circuit for Indirect Object Identification in GPT-2 smallcited by 1,130
- 2022In-context Learning and Induction Headscited by 930
- 2023Large Language Models Can Be Easily Distracted by Irrelevant Contextcited by 820
- 2023The Reversal Curse: LLMs trained on "A is B" fail to learn "B is A"cited by 399
- 2023Making Retrieval-Augmented Language Models Robust to Irrelevant Contextcited by 364
- 2021Measuring and Improving Consistency in Pretrained Language Modelscited by 361
- 2024Measuring short-form factuality in large language modelscited by 345
- 2024The Power of Noise: Redefining Retrieval for RAG Systemscited by 275
8 more
- 2023Linearity of Relation Decoding in Transformer Language Modelscited by 190
- 2023Tracr: Compiled Transformers as a Laboratory for Interpretabilitycited by 99
- 2024Cutting Off the Head Ends the Conflict: A Mechanism for Interpreting and Mitigating Knowledge Conflicts in Language Modelscited by 87
- 2024Finding Transformer Circuits with Edge Pruningcited by 58
- 2024What does the Knowledge Neuron Thesis Have to do with Knowledge?cited by 49
- 2024Induction Heads as an Essential Mechanism for Pattern Matching in In-context Learningcited by 46
- 2024Mechanistic Understanding and Mitigation of Language Model Non-Factual Hallucinationscited by 38
- 2024Sheaf Discovery with Joint Computation Graph Pruning and Flexible Granularitycited by 11
Built on by
Citing papers per year: 2025: 1; 2026: 5.
6 papers.
- 2026Locate, Steer, and Improve: A Practical Survey of Actionable Mechanistic Interpretability in Large Language Modelscited by 22
- 2026All Circuits Lead to Rome: Rethinking Functional Anisotropy in Circuit and Sheaf Discovery for LLMscited by 8
- 2025Hypothesis-Driven Feature Manifold Analysis in LLMs via Supervised Multi-Dimensional Scalingcited by 6
- 2026Interrupting the Loop: Periodic Subject Changes Raise Judged Surprise and Connection in Base Language Modelscited by 2
- 2026The Illusion of Robustness: Aggregate Accuracy Hides Prediction Flips under Task-Irrelevant Contextcited by 1
- 2026Benchmarking Factual Robustness of LLMs via Multi-conversation Persuasioncited by 0
- 2026Benchmarking Factual Robustness of LLMs via Multi-conversation Persuasion15 Sep 2026
- 2026Interrupting the Loop: Periodic Subject Changes Raise Judged Surprise and Connection in Base Language Models20 Aug 2026
- 2026The Illusion of Robustness: Aggregate Accuracy Hides Prediction Flips under Task-Irrelevant Context14 Jul 2026
- 2026All Circuits Lead to Rome: Rethinking Functional Anisotropy in Circuit and Sheaf Discovery for LLMs12 May 2026
- 2026Locate, Steer, and Improve: A Practical Survey of Actionable Mechanistic Interpretability in Large Language Models20 Jan 2026
- 2025Hypothesis-Driven Feature Manifold Analysis in LLMs via Supervised Multi-Dimensional Scaling1 Oct 2025