arXiv:2610.32109cs.CLOct 2026

Manuscript Offprint

arXiv:2610.32109

Context or Knowledge: How LLMs Attribute Their Own Answers

Kirill Afendulev, Alexey Dontsov, Alla Chepurova, Elena Tutubalina, Anton Korznikov

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

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.

Figure

Figure 1: Same answer, different source reports. Each row is a separate dialogue. After answering, the model reports context for the document or knowledge for its own knowledge. We ask how this report is produced. Schematic examples; source-question wording shortened.

1 INTRODUCTION

When a language model answers a question with a document in context, a user may want to know where the answer came from. Did the model use the document, or what it already knew? This matters when the document updates or contradicts the model's knowledge. We can ask the model directly (Figure 1). Asked for France's capital, it answers "Paris" with either a supporting or an irrelevant document, but reports context in the first case and knowledge in the second. We call this reply the source report. Our research question is how the model produces it.

This question is distinct from asking whether the document supports the answer. A source report is a claim about how the answer was produced. In retrieval-augmented systems, both a retrieved document and parametric knowledge may support the same answer. Prior work on attribution evaluates whether generated content is supported by the available context (Rashkin et al., 2023); work on explanation faithfulness likewise shows that a model's verbal account of its computation need not directly expose the computation itself (Turpin et al., 2023; Lanham et al., 2023). Appendix A reviews related work in more detail. We instead ask what internal state the model uses when it produces a source report about an answer that has already been generated.

Our starting point is the transformer's key-value (KV) cache. During generation, previously processed tokens leave keys and values that later tokens can attend to. These entries contain more than the token identities themselves: the same question tokens can acquire different cached states depending on the document that was processed before them. This gives us a way to separate what the model saw from the state produced by processing it. We let the model answer normally, intervene on selected cache entries, and only then ask it about the source. This setup lets us distinguish three possible mechanisms for the source report:

H1: Re-read the document. The model may inspect the document again when asked about the source. Under this hypothesis, changing the document after answering should change the report.

H2: Judge the answer using parametric knowledge. The model may instead assess whether its answer is compatible with knowledge stored in its parameters. Under this hypothesis, the report can be determined from the answer's compatibility with parametric knowledge rather than from a record of how the answer was produced.

H3: Read a cached trace of the earlier computation. The model may use source-related information left in the cache while answering. If so, transplanting the Q+A cache between runs should transfer the report, even when the recipient's question, answer, and document stay unchanged.

Table 1: Hypotheses for the source report and evidence from our interventions. Blue √ marks evidence supporting the hypothesis; orange ✗ marks evidence against it. H1 and H2 are tested as sufficient explanations of the report. H3 represents the hypothesis that the report depends on source-related state produced while answering.

HypothesisProposed mechanismEvidence
H1: Re-read the documentThe 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 knowledgeThe 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 traceThe 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).

We test these mechanisms in sequence (Table 1). First, we change or remove the document's cache after the answer has been generated while preserving the Q+A cache. The report remains unchanged, even though the replacement document is still readable. This argues against determining the report from the document currently available at report time. Second, we transplant the Q+A cache between runs with identical question and answer tokens. The report follows the transplanted cache, while the recipient's document remains fixed. This establishes a causal dependence on the state produced during the earlier computation. Third, we fit linear directions in Q+A values and show that steering these values can change the source report across facts. Fitted K+V components also carry nearly the full transplant effect: transferring them nearly reproduces the report change, while holding them fixed nearly prevents it (Section 6). Finally, we apply the same fitted value directions during answer generation, without refitting. They change which source supplies the answer, linking source-related cached state to source selection even under opposing instructions.

Importantly, H1 and H2 are tested as sufficient explanations of the report, not as claims that document processing and parametric knowledge cannot contribute to the cached state. A successful Q+A transplant does not imply that the trace represents a single discrete “source label”; it shows that the state produced during the earlier computation contains information that causally affects the later report. Hybrid mechanisms may therefore contribute to the computation as well.

Our main contribution is therefore a mechanistic explanation of source reporting in the controlled setting: the source report depends on source-related computational state inherited from the question-answering process, rather than simply on the document that remains available when the report is requested. We call this state a source trace; its role in reporting leaves open whether it encodes evidence availability, actual source use, or both. The experiments do not establish general reliability of source reports, unrestricted introspection, or a complete semantic interpretation of this state.

References (67)