TL;DR
This paper challenges the prevailing belief that Large Language Models (LLMs) have dedicated "memory" and "context" attention heads. Instead, it reveals that these roles often exist in superposition within the same heads. To address the resulting knowledge conflicts, the authors introduce JUICE (Just Run Twice), a training-free, dual-pass inference method that steers models to prioritize either internal knowledge or provided context, setting new state-of-the-art benchmarks.
The Problem: Knowledge Conflicts
LLMs frequently face a "tug-of-war" between their internal parametric memory (learned during pre-training) and external context (provided during inference, e.g., in Retrieval-Augmented Generation). When these sources contradict each other, models struggle to decide which to trust.
Previous research suggested that specific attention heads were "specialists," dedicated exclusively to either memory or context. However, simple "locate-and-edit" strategies based on this assumption fail in complex, coherent conflict scenarios because the internal mechanisms are more entangled than previously thought.
Core Insight: Superposition of Heads
Through causal analysis, the authors discovered a phenomenon termed CP Superposition. Highly influential attention heads do not strictly specialize; rather, they contribute to both parametric memory and contextual information simultaneously. A head that acts as a "memory head" in a simple conflict might act as a "context head" in a more complex one.
The Solution: JUICE (Just Run Twice)
To reliably steer the model without fine-tuning, the authors propose JUICE. Standard single-pass interventions often suffer from the "Hydra Effect," where downstream layers counteract modifications made in earlier layers. JUICE overcomes this using a two-stage approach:
- Head Identification: Using a tiny set of samples (as few as 4), JUICE identifies "reliable" attention heads that consistently improve performance when their activations are scaled.
- Dual-run Inference:
- First Run: The model processes the input normally, and the activations of the identified heads are saved.
- Second Run: The model runs again, but scaled versions of the saved activations from the first run are added back into the residual stream.
By using activations from a "clean" first run as a reference, JUICE provides a stable steering direction that avoids counteracting effects.
Datasets & Evaluation
JUICE was evaluated across 11 datasets and 6 model architectures (including Gemma, Llama 2/3, and Phi-2). The authors curated ParaConflict, a benchmark covering six factual domains with three conflict levels: Clean (no conflict), Substitution (simple sentence-level conflict), and Coherent (persuasive, paragraph-level counterfactuals). They also utilized existing benchmarks like Memo-Trap and NQ-Swap.
Key Results
JUICE consistently outperformed baselines, including prompting and state-of-the-art intervention methods like PH3.
- Coherent Conflict Mastery: In the most challenging "Coherent Conflict" scenarios—where models usually fail completely—JUICE improved accuracy from near 0% to over 70-80% in many cases.
- Generalization: Heads identified in one domain (e.g., World Capitals) were effective when applied to entirely different domains, suggesting JUICE taps into fundamental knowledge-handling circuits.
- Zero-Shot Factuality: JUICE even improved accuracy on "clean" prompts, effectively making the base model more factual when no conflict was present.
Limitations and Future Work
The primary trade-off for JUICE's effectiveness is computational overhead. Running the model twice per inference increases latency and memory usage (to cache the first-run activations). Future work could explore extending this dual-run mechanism to more complex reasoning tasks or optimizing the process to reduce the inference penalty.
Summary updated