paper:doi-10-48550-arxiv-2510-06182Mixing Mechanisms: How Language Models Retrieve Bound Entities In-Context
TL;DR
Language models retrieve bound entities through a mixture of three mechanisms, not the positional mechanism alone, and the positional signal collapses in the middle of long entity lists. With n=20 entity groups on gemma-2-2b-it, positional patching controls behavior only at the first and last groups and explains roughly 20% of behavior in middle groups, where its logit distribution turns wide and diffuse. A lexical mechanism (query entity retrieves its bound counterpart) and a reflexive mechanism (a direct self-pointer to the answer token) supply the sharp, one-hot corrections. Which one dominates depends on where the target sits in its clause: reflexive for t_entity=1, lexical for t_entity=3. The paper introduces a counterfactual interchange-intervention design (TargetRebind) that makes each mechanism predict a different token. It also introduces a causal model that mixes a Gaussian positional term, whose variance is quadratic in position, with one-hot lexical and reflexive terms. That model reaches 0.95 mean Jensen–Shannon similarity with the LM's next-token distribution, against 0.44 for the one-hot positional view, which falls below the 0.5 uniform baseline. The pattern holds across nine models (Gemma-2, Qwen2.5, Llama-3.1; 2–72B) and ten tasks, and it persists when up to 10,000 filler tokens are interleaved. Binding retrieval is therefore a position-weighted ensemble. Weakening lexical signal against a noisier positional one is offered as a mechanistic account of lost-in-the-middle.
What to take away
- 1. On gemma-2-2b-it with n=20 entity groups, the positional mechanism controls behavior only at the first and last groups and accounts for just ~20% of behavior in middle groups.
- 2. The full mixture model (one-hot lexical, one-hot reflexive, Gaussian positional) reaches 0.95 mean Jensen–Shannon similarity on gemma-2-2b-it's music task, versus 0.44 for the prevailing one-hot positional view, which falls below the uniform baseline of 0.5.
- 3. Replacing the Gaussian positional term with a one-hot drops JSS to about 0.85, while the oracle positional term (the LM's actual logits) reaches 0.96–0.98, so the diffuse positional shape is a necessary modeling component.
- 4. Target position within the clause selects the helper mechanism: reflexive dominates when t_entity=1 and lexical when t_entity=3, and ablating the lexical term at t_entity=1 costs almost nothing (0.94 JSS) while ablating reflexive at t_entity=1 drops JSS to 0.69.
- 5. The reflexive mechanism is hypothesized to exist because causal attention blocks the lexical route when the target precedes the query within a clause, so a pointer has to be retrieved from the answer token instead.
- 6. Patching a counterfactual answer that is absent from the original context yields no counterfactual answer at layer ℓ but does at ℓ+1, which separates a reflexive pointer that cannot be dereferenced from the answer itself and rules out a suppression mechanism.
- 7. Attention knockout from the last token to the query token across layers 11–16 drops accuracy from 98% to 37%, and to 8% when the token after the query is also blocked.
- 8. The lexical signal is derived locally at the query token, since blocking query-to-entity attention at all layers leaves accuracy at 86–90%, whereas the reflexive signal needs retrieval from entity tokens, explaining its earlier appearance (layers 6–12 versus 12–19).
- 9. Padding each group with entity-less filler sentences, up to 10,000 total tokens on gemma-2-2b-it boxes, weakens the lexical effect and diffuses the positional one, which the paper proposes as a mechanistic explanation of lost-in-the-middle (a hypothesis it does not test directly).
- 10. A replicable recipe: build original/counterfactual pairs where positional, lexical and reflexive indices are all distinct, run 150 interchange interventions per (iP,iL,iR) triple to get n³=8,000 mean distributions, and fit the mixture with Jensen–Shannon loss on a 70/15/15 split.
Peer brief — for seminar discussion
The work revisits how language models retrieve an entity bound to a query, for example answering which person loves pie from a list of clauses. Earlier mechanistic work, tested on n of 2 to 3 groups and sometimes up to 7 with low faithfulness, supported a purely positional account. Here the setting scales to n=20 groups across nine instruction-tuned models (Gemma-2 2–27B, Qwen2.5 3–72B, Llama-3.1 8B/70B) and ten templatic tasks. The central instrument is a counterfactual interchange-intervention dataset, called TargetRebind in the appendix, built so that patching the last-token residual stream at the layer just before retrieval makes the positional, lexical and reflexive mechanisms each promote a different token. The load-bearing finding is that the positional signal is sharp only at the first and last groups. In middle groups it explains about 20% of behavior and spreads diffusely around the intended index. The lexical mechanism (via the query entity) and the reflexive mechanism (a self-pointer to the answer) take over, and which one dominates depends on the target's slot within its clause. A mixture causal model with a Gaussian positional term, whose width is a learned quadratic of position, plus one-hot lexical and reflexive terms reaches 0.95 JSS on gemma-2-2b-it. The one-hot positional baseline reaches 0.44, below uniform. The implication is that bound-entity retrieval is an ensemble whose weights shift with position and slot. The authors speculate that a fading lexical signal against a noisy positional one underlies lost-in-the-middle, and the filler-token experiments up to 10,000 tokens point that way. The pointer-versus-answer validation, using a counterfactual answer absent from context and a repeat at layer ℓ+1, is a careful control. A critical reader would push on scope. Causal-abstraction fits are most fully reported for gemma-2-2b-it and qwen2.5-7b-it on a few templatic tasks with distinct entities, so the claim of a universal strategy rests on narrow, synthetic prompts. The mixture model also has few parameters tuned to the same intervention distribution it is evaluated on, and the large 'mixed' category is absorbed by a Gaussian rather than explained mechanistically. An alternative would be to train sparse-autoencoder or probe-based decompositions of the binding signal, or to use activation patching with path-level attribution of attention heads. The lost-in-the-middle link is suggestive, not demonstrated on natural long-context tasks.
Methods (10)
- Attention knockoutBlocking attention edges to trace information flow.
- Filler-sentence padding evaluationEntity-less filler sentences interleaved between groups.
- Interchange InterventionFundamental operation for causal abstraction analysis; forces neurons to take values from source inputs to create counterfactuals.
- Jensen–Shannon similarity (JSS)Metric (1−JSD, log2) for model fit.
- Last-layer-before-retrieval localizationIdentifies layer ℓ for patching.
- LexSwapEntity-token intervention for lexical signal.
- PCA and multinomial logistic regression probesUsed to test linear separability of group position.
- PosSwapEntity-token intervention for positional signal.
- RefSwapEntity-token intervention for reflexive signal.
- TargetRebind interventionCounterfactual design making positional, lexical, reflexive predictions distinct.
Frameworks (5)
- Lexical mechanismRetrieves target using the bound query entity.
- Lookback mechanismPrakash et al. motif of pointers and addresses in binding.
- Mixed causal model M (L one-hot, R one-hot, P Gauss)Combined causal model estimating next-token distributions.
- Positional mechanismPrevailing view: retrieve entity by group position index.
- Reflexive mechanismRetrieves entity via direct self-referential pointer.
Datasets (2)
- 1,000 entity-less filler sentencesUsed for padding.
- Ten templatic binding tasksTen tasks with entity sets 23–80.
Findings (28)
- With up to 10,000 filler tokens, lexical effect declines while positional and mixed effects increase on gemma-2-2b-it boxes
Long-context generalization.
- U-shaped positional reliance: first and last groups rely on positional, middle on lexical/reflexive (gemma-2-2b-it)
Figure 2.
- Positional mechanism accounts for only ~20% of behavior in middle entity groups for n=20 on gemma-2-2b-it
Core result.
- Blocking attention to query token in layers 11–16 drops accuracy from 98% to 37%; with next token 8%
Attention knockout.
- When lexical/reflexive targets absent from original, model falls back to noisy positional mechanism
Fig. 28–29.
- At 10,000 tokens positional information is nearly nonexistent for first half of groups except first
Padding result.
- Patching an unresolvable pointer at layer ℓ yields no counterfactual answer, but at ℓ+1 yields it
Validates reflexive pointer.
- Mixed predictions cluster near positional index with diffuse logit distribution in middle indices
Figures 3, 13.
- Hidden states of middle entity groups become less linearly separable by position as n grows
Fig. 22.
- Lexical contribution amplified near positional index but suppressed near reflexive index
Interaction patterns in Figure 3.
Claims (9)
- The reflexive mechanism is needed because causal attention prevents lexical retrieval when target precedes query in a group
Architectural explanation.
- LMs retrieve bound entities via a mixture of positional, lexical and reflexive mechanisms rather than positional alone
Central thesis.
- Weakening lexical relative to noisy positional mechanism may mechanistically explain lost-in-the-middle
Interpretation of padding results.
- The positional mechanism generalizes poorly, becoming noisy in middle positions as entity count grows
Challenges prevailing view.
- Lexical and reflexive mechanisms provide sharper signals refining the diffuse positional signal
Takeaway.
- Lexical and reflexive mechanisms are pointers that get dereferenced to the queried entity
§D.3.
- Model behavior is governed by number of entities to bind rather than sequence length
Context length ablation.
- No suppressive mechanism prevents answering with entities absent from context
Rules out alternative explanation.
- Findings point to a universal strategy across LMs for entity binding
Cross-model consistency.
Hypotheses (3)
- Positional signal is diffuse because the model encodes group positions in a poorly linearly separable way for middle groups
Tested via probes.
- Lexical signal can be derived locally from query token while reflexive must be retrieved from entity tokens
Tested with knockout.
- When mechanisms agree they overwhelmingly drive model behavior
Tested in D.1.
Questions (1)
- Can the reflexive pointer be distinguished from the actual answer token?
Confounder resolved in §3.4.
Original abstract (expand)
A key component of in-context reasoning is the ability of language models (LMs) to bind entities for later retrieval. For example, an LM might represent "Ann loves pie" by binding "Ann" to "pie", allowing it to later retrieve "Ann" when asked "Who loves pie?" Prior research on short lists of bound entities found strong evidence that LMs implement such retrieval via a positional mechanism, where "Ann" is retrieved based on its position in context. In this work, we find that this mechanism generalizes poorly to more complex settings; as the number of bound entities in context increases, the positional mechanism becomes noisy and unreliable in middle positions. To compensate for this, we find that LMs supplement the positional mechanism with a lexical mechanism (retrieving "Ann" using its bound counterpart "pie") and a reflexive mechanism (retrieving "Ann" through a direct pointer). Through extensive experiments on nine models and ten binding tasks, we uncover a consistent pattern in how LMs mix these mechanisms to drive model behavior. We leverage these insights to develop a causal model combining all three mechanisms that estimates next token distributions with 95% agreement. Finally, we show that our model generalizes to substantially longer inputs of open-ended text interleaved with entity groups, further demonstrating the robustness of our findings in more natural settings. Overall, our study establishes a more complete picture of how LMs bind and retrieve entities in-context.
Related work— refs + corpus + external arXiv
Cited / in-corpus / arXiv badges show which signals surfaced each row. Multi-source rows weighted higher.
- ≈ 83%
- RecaLLM: Addressing the Lost-in-Thought Phenomenon with Explicit In-Context RetrievalNegin Rahimi Kyle Whitecross2026≈ 83%
- Do Language Models Encode Semantic Relations? Probing and Sparse Feature AnalysisAnsgar Scherp Andor Diera2026≈ 83%
- Word Recovery in Large Language Models Enables Character-Level Tokenization RobustnessShu Yang, Lijie Hu, Di Wang Zhipeng Yang2026≈ 83%
- Activation Steering via Generative Causal MediationAmir Zur, Atticus Geiger, Dylan Hadfield-Menell Aruna Sankaranarayanan2026≈ 83%
- Causal Probing for Internal Visual Representations in Multimodal Large Language ModelsTianjie Ju, Zheng Wu, Liangbo He, Jun Lan, Huijia Zhu, Weiqiang Wang, Zhuosheng Zhang Zehao Deng2026≈ 83%
- From Interpretability to Performance: Optimizing Retrieval Heads for Long-Context Language ModelsYoumi Ma and Naoaki Okazaki2026≈ 83%
- Reasoning Resides in Layers: Restoring Temporal Reasoning in Video-Language Models with Layer-Selective MergingHaonan Wang, Jian Kang, Kenji Kawaguchi, Jiaying Wu Zihang Fu2026≈ 83%
- Brittle Minds, Fixable Activations: Understanding Belief Representations in Language ModelsConstantin Ruhdorfer, Lei Shi, Andreas Bulling Matteo Bortoletto2025≈ 83%
- Mechanistic Exploration of Backdoored Large Language Model Attention PatternsLakshmi Babu-Saheer Mohammed Abu Baker2025≈ 83%
- A Comparative Analysis of Sparse Autoencoder and Activation Difference in Language Model SteeringJiaqing Xie2025≈ 83%
- Do Large Language Models Plan Answer Positions? Position Bias in Multiple-Choice Question GenerationXufeng Duan, Zhenguang G. Cai Xuemei Tang2026≈ 83%
- Mechanistic Indicators of Steering Effectiveness in Large Language ModelsHao Xue, Flora Salim Mehdi Jafari2026≈ 83%
- Breaking Bad Tokens: Detoxification of LLMs Using Sparse AutoencodersVedant Rathi, William Yeh, Yian Wang, Yuen Chen, Hari Sundaram Agam Goyal2025≈ 83%
- Tracing Facts or just Copies? A critical investigation of the Competitions of Mechanisms in Large Language ModelsYanxu Chen, Sander Hoffman, Maria Heuss Dante Campregher2025≈ 82%
- ≈ 82%
- Mechanistic Knobs in LLMs: Retrieving and Steering High-Order Semantic Features via Sparse Autoencodersin corpus2026≈ 82%
- Mechanistic Understanding and Mitigation of Language Confusion in English-Centric Large Language ModelsHelmut Schmid, Hinrich Sch\"utze Ercong Nie2025≈ 82%
- ≈ 82%
- ≈ 82%
- ≈ 82%
- Model Alignment Searchin corpus2025≈ 81%
- ≈ 81%
- ≈ 81%
- ≈ 81%
- ≈ 81%
- ≈ 81%
- ≈ 81%
- ≈ 81%
- ≈ 79%
+22 more