Context or Knowledge: How LLMs Attribute Their Own Answers
Abstract
Language models can answer a question from a supplied document or from their parametric knowledge. When later asked where the answer came from, what determines their source report? We study this by intervening on the model's key-value (KV) cache after the answer is generated and before the source question is asked. On a controlled factual task with four models (7B-32B), changing or removing the document's cache never changes the report. In contrast, transplanting the question-and-answer (Q+A) cache between runs with identical question and answer tokens transfers it: every eligible report follows the donor, while the recipient's document is unchanged. On the two smaller models, steering Q+A values along directions fitted before any source question reverses 98.9-100% of reports across four document conditions at a fixed strength, while norm-matched random directions flip at most 1.1%. The components of keys and values along fitted directions carry the transplant effect: copying them alone nearly reproduces the report change; holding them fixed nearly prevents it. Applied during answer generation, the same value directions also change which source supplies the answer, though more weakly and depending on the prompt. Source reporting in this setting thus depends causally on cached state produced while answering. We do not establish general reporting accuracy or a complete interpretation of this state.
Figures & tables
| Hypothesis | Proposed mechanism | Evidence |
|---|---|---|
| H1: Re-read the document | The model re-inspects the document to produce the source report. | ✗ Not supported as a sufficient explanation. Changing or removing the document after answering does not change the report (§ 3 ). |
| H2: Judge the answer against knowledge | The model determines the report by evaluating the answer against its parametric knowledge. | ✗ Not supported as a sufficient explanation. Transplanting the Q+A cache changes the report while keeping the answer tokens and recipient document unchanged (§ 4 ). |
| H3: Read a cached trace | The report depends on source-related state produced while answering. | ✓ Supported by our interventions. Q+A cache transplants transfer the report, and steering Q+A values changes it (§ 4 , § 5 ). Clamping fitted K+V projections nearly blocks transfer; transferring those projections alone nearly reproduces it (§ 6 ). |
| Document edit | OLMo-3-7B | Qwen3-8B | OLMo-3.1-32B | Qwen3-32B |
|---|---|---|---|---|
| Drop counterfactual | 0% | 0% | 0% | 0% |
| Counterfactual irrelevant | 0% | 0% | 0% | 0% |
| Irrelevant true fact | 0% | 0% | 0% | 0% |
| Recipient Q+A donor | OLMo-3-7B | Qwen3-8B | OLMo-3.1-32B | Qwen3-32B |
|---|---|---|---|---|
| True fact neutral | 100% | 100% | 100% | 100% |
| Neutral true fact | 100% | 100% | 100% | 100% |
| True fact irrelevant | 100% | 100% | 100% | 100% |
| Irrelevant true fact | 100% | 100% | 100% | 100% |
| Intervention | OLMo-3-7B | Qwen3-8B |
|---|---|---|
| Full Q+A KV transplant | 100% | 100% |
| + restore recipient K+V projections | 1.1% | 0% |
| + clamp energy-matched subspace | 100% | 94.7% |
| No transplant: donor K+V projections only | 97.9% | 100% |
Appendix figures & tables20 assets
Supplementary material from the paper’s appendix.
Appendix
| Relation | Phrase | Candidates |
|---|---|---|
| capital | capital | 30 |
| symbol | chemical symbol | 26 |
| author | author | 22 |
| continent | continent | 21 |
| language | official language | 20 |
| painter | painter | 12 |
| document | example | control variant | role |
|---|---|---|---|
| true fact | The capital of France is Paris. | — | relevant, true value |
| counterfactual | The capital of France is Tokyo. | … is Lima. | relevant, false value |
| irrelevant fact | The capital of Canada is Ottawa. | … of Egypt is Cairo. | true fact, other subject |
| neutral sentence | Snow melted slowly on the hills. | The library was open until late. | no fact at all |
| OLMo-3-7B | Qwen3-8B | OLMo-3.1-32B | Qwen3-32B | |
| Counterfactual run (read “Tokyo”, answered “Tokyo”): reports context | ||||
| intact | 100% | 100% | 100% | 100% |
| Document drop | 100% | 100% | 100% | 100% |
| Document swap irrelevant fact | 100% | 100% | 100% | 100% |
| model quotes the new document | 100% | 100% | 100% | 100% |
| Irrelevant-fact run (answered “Paris” from memory): reports context | ||||
| recipient donor: report becomes | OLMo-3-7B | Qwen3-8B | OLMo-3.1-32B | Qwen3-32B |
|---|---|---|---|---|
| The same true answer “Paris”; Question swap | ||||
| true-fact neutral: knowledge | 80.2% | 100% | 100% | 95.8% |
| neutral true-fact: context | 97.4% | 100% | 73.3% | 100% |
| A false answer “Tokyo” in plain sight; Question swap | ||||
| counterfactual neutral: knowledge | 90.4% | 100% | 68.3% | 25.8% |
| still reads “Tokyo” in the document | 83.3% | 97.2% | 68.3% | 25.8% |
| swap of the question span | keys+values | keys only | values only |
|---|---|---|---|
| counterfactual irrelevant (remove) | 97.9% 100% | 0% 0% | 6.2% 0% |
| true-fact irrelevant (remove) | 92.9% 100% | 0% 0% | 0% 0% |
| irrelevant counterfactual (create) | 86.6% 90.6% | 40.2% 0.9% | 99% 97.2% |
| irrelevant true-fact (create) | 90.9% 98.3% | 54.5% 5.2% | 100% 100% |
| question only | answer only | question answer | |
|---|---|---|---|
| OLMo-3-7B, Qwen3-8B, Qwen3-32B (all four directions) | 75–100% | 0–3% | 100% |
| OLMo-3.1-32B, irrelevant-fact true-fact | 30% | 0% | 100% |
| OLMo-3.1-32B, true-fact irrelevant-fact | 100% | 59% | 100% |
| Document / direction | Model | ||||
|---|---|---|---|---|---|
| Irrelevant fact: create | OLMo-3-7B | 42.6% | 100% | 100% | 100% |
| Qwen3-8B | 4.9% | 100% | 100% | 100% | |
| Neutral sentence: create | OLMo-3-7B | 12.8% | 88.5% | 100% | 100% |
| Qwen3-8B | 0% | 2.4% | 100% | 100% | |
| Counterfactual: remove | OLMo-3-7B | 0% | 60.5% | 100% | 100% |
| Qwen3-8B | 12.5% | 100% | 100% | 100% |
| Document / direction | Model | Q only | A only | Q+A |
|---|---|---|---|---|
| Irrelevant fact: create | OLMo-3-7B | 62.3% | 67.2% | 100% |
| Qwen3-8B | 97.5% | 3.7% | 100% | |
| Neutral sentence: create | OLMo-3-7B | 42.3% | 62.8% | 100% |
| Qwen3-8B | 8.4% | 0% | 100% | |
| Counterfactual: remove | OLMo-3-7B | 0% | 72.1% | 100% |
| Qwen3-8B | 58% | 85.2% | 100% |
| Document / direction | OLMo-3-7B | Qwen3-8B | |
|---|---|---|---|
| Irrelevant fact: create | 2 | 100% | 100% |
| Counterfactual: remove | 3 | 100% | 100% |
| Document / direction | Model | Supporting vs. irrelevant | Fixed document |
|---|---|---|---|
| True fact: remove | OLMo-3-7B | 37.5% | 30.7% |
| Qwen3-8B | 23.9% | 77.3% | |
| Counterfactual: remove | OLMo-3-7B | 72.1% | 72.1% |
| Qwen3-8B | 85.2% | 100% | |
| Irrelevant fact: create | OLMo-3-7B | 67.2% | 37.7% |
| Qwen3-8B | 3.7% | 2.5% |
| OLMo-3-7B | Qwen3-8B | ||||||
|---|---|---|---|---|---|---|---|
| Steer toward | Edit | Switched | Random | Damaged | Switched | Random | Damaged |
| Memory | Values | 70.9 | 1.6 | 9.3 | 51.2 | 4.1 | 1.2 |
| Residual | 16.3 | 0.2 | 0.6 | 75.6 | 3.7 | 2.4 | |
| Document | Values | 85.3 | 23.6 | 0 | 72.8 | 3.2 | 0 |
| Residual | 52.3 | 5.5 | 1.8 | 98 | 1.2 | 0 | |
| section | script | artifacts |
|---|---|---|
| items | 90_clean_items.py | items.jsonl |
| 3 – 4 , document and question swaps | 91_clean_kv_patching.py | kv_patching.json , kv_patching_items.jsonl |
| 4 , Identical-text swap | 93_clean_answer_patching.py | answer_patching.json , answer_patching_items.jsonl |
| tables for 3 – 4 | 92_clean_tables.py | tables.md |
| 5 , report-steering sweep | author-supplied aggregate table | data/report_steering_update.csv |
| Appendix C.7 | author-supplied block 3i (script 105) | data/report_steering_checks.json |
| OLMo-3-7B | Qwen3-8B | |||
|---|---|---|---|---|
| Create | Remove | Create | Remove | |
| K+V transplant | 100% | 100% | 100% | 100% |
| V transplant | 100% | 10.6% | 100% | 47.4% |
| V transplant + V clamp | 0% | 0% | 0% | 0% |
| V transplant + random V clamp | 100% | 10.6% | 100% | 47.4% |
| K transplant | 78.7% | 0% | 39.5% | 0% |
| OLMo-3-7B | Qwen3-8B | |||
|---|---|---|---|---|
| Create | Remove | Create | Remove | |
| K+V transplant + V clamp | 100% | 0% | 68.4% | 0% |
| K+V transplant + K+V clamp | 2.1% | 0% | 0% | 0% |
| K+V transplant + V clamp + random K clamp | 100% | 0% | 67.6% | 0% |
| K transplant + K clamp | 0% | 0% | 0% | 0% |
| K transplant + random K clamp | 76% | 0% | 38.7% | 0% |
| Intervention | OLMo-3-7B | Qwen3-8B |
| Full K+V transplant | 100% | 100% |
| + selected-coordinate clamp | 1.1% | 0% |
| + top-PC clamp | 100% | 100% |
| + energy-matched clamp | 100% | 94.7% |
| + random clamp | 100% | 100% |
| V transplant + selected-coordinate clamp | 0% | 0% |
| Model | Cache | Selected | Matched | Random |
|---|---|---|---|---|
| OLMo-3-7B | V | 11.6% | 12.3% | 0.0% |
| OLMo-3-7B | K | 25.1% | 21.0% | 0.0% |
| Qwen3-8B | V | 15.7% | 18.5% | 0.1% |
| Qwen3-8B | K | 36.2% | 49.3% | 0.8% |
| Document edit | OLMo-3-7B | Qwen3-8B | OLMo-3.1-32B | Qwen3-32B |
|---|---|---|---|---|
| Drop counterfactual | 100% | 98.4% | 99.4% | 100% |
| Counterfactual irrelevant | 100% | 100% | 99.4% | 100% |
| Irrelevant true fact | 0% | 0% | 0% | 0% |
| Irrelevant counterfactual | 0% | 0% | 0% | 0% |
| Recipient Q donor: report | OLMo-3-7B | Qwen3-8B | OLMo-3.1-32B | Qwen3-32B |
|---|---|---|---|---|
| Counterfactual irrelevant: knowledge | 54.5% | 100% | 95.5% | 57.6% |
| Irrelevant counterfactual: context | 78.8% | 72.4% | 15.2% | 72.9% |
| True fact uninformative: knowledge | 94.9% | 100% | 99.5% | 70.8% |
| Uninformative true fact: context | 84.7% | 77.1% | 25.9% | 59.8% |
| Counterfactual uninformative: knowledge | 79.7% | 99.2% | 94.5% | 16.8% |
| + reads the false document value | 66.7% | 90.7% | 93.9% | 11.9% |
| Edited span | OLMo-3-7B | Qwen3-8B | OLMo-3.1-32B | Qwen3-32B |
|---|---|---|---|---|
| True fact uninformative: report becomes knowledge | ||||
| Q only | 97.6% | 100% | 99.4% | 77.6% |
| A only | 10.6% | 8.5% | 51.9% | 7.2% |
| Q+A | 100% | 100% | 100% | 100% |
| Uninformative true fact: report becomes context | ||||
| Q only | 82.4% | 84.5% | 27.1% | 72.4% |