What Context Leaves Behind: How Earlier Examples Affect Retrieval from Reused KV Caches

Reusing the key–value (KV) cache of a document lets a language model encode the document once and use it for many requests. We ask what happens when the task changes. The cached keys and values of a block are computed while the block attends to the text before it, so they may keep the influence of that text. In a controlled retrieval task, we encode identical records after demonstrations of one extraction rule or of another, then answer the same query with the same, correct demonstrations. Records encoded under a different rule lower accuracy by 5.9–15.4 percentage points in all four 4–9B models on 32 Wikipedia tables, and by 12.5–27.0 points in three of the models on synthetic records; most of the extra errors return the field that the earlier rule selects. Replacing only the cached keys reproduces 57–62% of the loss from replacing both keys and values in two models. With plain-text prompts, such a stale cache is never significantly worse than encoding the records on their own, and is often better. Under official chat templates the picture changes, and in Llama the stale cache is 14.5 points worse than encoding the records on their own. Whether a cached block can be reused therefore depends on the task context it was built in, not only on its text.

Authors

Institutions

Publication Details

Journal
Zenodo (CERN European Organization for Nuclear Research)
Published
2026-12-01
DOI
https://doi.org/10.5281/zenodo.24707263
Primary Topic
Topic Modeling
Type
preprint
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
NOV
preprint

What Context Leaves Behind: How Earlier Examples Affect Retrieval from Reused KV Caches

Ngoc Kim Bui
Zenodo (CERN European Organization for Nuclear Research)
Topic Modeling
preprint

What Context Leaves Behind: How Earlier Examples Affect Retrieval from Reused KV Caches

Ngoc Kim Bui
preprint en

Abstract

Reusing the key–value (KV) cache of a document lets a language model encode the document once and use it for many requests. We ask what happens when the task changes. The cached keys and values of a block are computed while the block attends to the text before it, so they may keep the influence of that text. In a controlled retrieval task, we encode identical records after demonstrations of one extraction rule or of another, then answer the same query with the same, correct demonstrations. Records encoded under a different rule lower accuracy by 5.9–15.4 percentage points in all four 4–9B models on 32 Wikipedia tables, and by 12.5–27.0 points in three of the models on synthetic records; most of the extra errors return the field that the earlier rule selects. Replacing only the cached keys reproduces 57–62% of the loss from replacing both keys and values in two models. With plain-text prompts, such a stale cache is never significantly worse than encoding the records on their own, and is often better. Under official chat templates the picture changes, and in Llama the stale cache is 14.5 points worse than encoding the records on their own. Whether a cached block can be reused therefore depends on the task context it was built in, not only on its text.

Zenodo (CERN European Organization for Nuclear Research)
VNU University of Science (VN)
Topic Modeling
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.

Laika access coming soon
What Context Leaves Behind: How Earlier Examples Affect Retrieval from Reused KV Caches — Ngoc Kim Bui · Zenodo (CERN European Organization for Nuclear Research) (2026) | TGRS Research Map | TGRS