How Do Language Models Choose Between Context and Memory?
Benjamin Shih, John Winnicki, Arianna Cao
cs.LG, cs.CL
2026-09-01
Interchanging authority coordinates recovers 30–68% of source choice in Qwen, Llama, and OLMo; a color-task direction imported to materials closes 9% of the gap versus 57% locally.
When context contradicts parametric memory, source choice can already be decoded and steered. Minder et al. found a one-dimensional context-sensitivity knob; Zhao et al. steer with sparse features; later work gates the same conflict in RAG. Steerability is not endogenous use. A direction can be easy to read or powerful to push along, and still not be what the unedited model uses. Whether that direction transfers across tasks is a third question.
This Stanford paper tests the three separately: do natural authority directions causally affect source choice inside a task, do they transfer, and does cross-task decodability imply cross-task causal control.
The setup is unambiguous. Context states a false fact, parametric memory supports the true one, and only the authority framing changes. In the color task, high authority says "The grass is definitely purple"; low authority says there is an unverified rumor that it is purple. The model is scored on next-token logits over 12 colors. Authority directions are estimated from agreement prompts, where context and memory support the same answer: per layer, the normalized difference of mean residuals for high versus low authority.
The causal test is not additive steering. For matched high/low pairs, the scalar coordinate along the authority direction is swapped, the orthogonal residual is kept, and the interchange is repeated across eight late layers with normal forward computation after each edit. Gap closure measures how much of the natural high-low authority gap the two reciprocal swaps recover. Controls are random directions and covariance-matched directions with the authority component projected out.
Models are frozen instruction-tuned weights: Qwen2.5-7B and 3B, Llama-3.1-8B, OLMo-2-7B. Intervention layers are chosen on Qwen2.5-7B and matched by relative depth. A materials task uses a disjoint next-token vocabulary. A state/country task separates representation from causal use. Cue families include wording, source credibility, cited evidence, consensus, and first-person confidence as a near-null baseline.
On the color task, interchanging authority coordinates closes 68% of the natural gap in Qwen (bootstrap 95% CI [61, 75]), 56% in Llama ([48, 64]), and 30% in OLMo ([25, 37]). Random interchange is near zero. Versus the best covariance-matched control, the margins are 18× (Qwen), 2.9× (Llama), and 2.2× (OLMo). Qwen's mediation index is 0.35 against a control mean of 0.017 and a control max of 0.049.
Additive steering works too. At layer 21 of Qwen2.5-7B, steering toward the authority direction moves context-following on low-authority prompts from 0.14 to 0.76; steering away moves high-authority prompts from 0.90 to 0.06. The context-backed color gets the largest logit increase on 76% of examples. Directions re-estimated on disjoint color splits have mean pairwise cosine 0.96.
On the materials task, memory accuracy is 0.988 and the natural authority gap is 0.560. The local direction closes 0.574 of the gap (about 57%). Importing the color-task direction closes 0.085, about 9% of the authority gap and 14.8% of the local effect. The strongest covariance control closes 0.043.
State and country facts split representation from use. Authority gaps under the reference prompt are 0.454 (countries) and 0.492 (states); AUROC is 0.995–1.000 and encoding retention is 0.90–0.92. Maximum single-layer imported causal effects are 0.014 and 0.038; Table 5's matched estimates sit at 0.001 and −0.008. Authority remains almost perfectly decodable across domains and barely moves behavior.
People working on interpretability or knowledge-conflict mitigation often treat "we can steer it" as "the model uses it." Copying a naturally occurring coordinate between matched prompts is a harder test than adding a learned vector.
Inside a task, late-layer authority directions do mediate source choice, most strongly in Qwen. Across tasks, the linear directions barely transfer. A universal "trust context vs memory" knob is not supported here. A more plausible picture is task-dependent authority computation, possibly a shared nonlinear structure with task-specific linear readouts.
The authors note the materials sample is small, and task geometry or scaling could explain weak transfer. A shared nonlinear representation is not ruled out. The state/country interventions are single-layer; multi-layer interchange is listed as future work. Until the pattern is shown on many tasks, "task-dependent" is a reading of these tasks, not a general law.
The lab setting is narrow. Answers are next-token scores on a closed vocabulary. Authority is wording such as "definitely" versus "unverified rumor," not retrieved documents or tool output. OLMo closes only 30%, with the weakest control margin, so this is not a universal switch. First-person confidence barely moves behavior (gap 0.01), which suggests "authority" here is an external-source signal, not speaker confidence.
The abstract's 9% is the imported direction's absolute gap closure (0.085). The 14.8% is that number over the local 0.574. Same experiment, different denominators.