TRANSMISSION // 2611.30720v1

Testing When Quantized AI Caches Preserve History

Source published

Experiments find layout-dependent drift and a tested flush-then-crop path where current-prefix checks missed changes to earlier cache history.

AI-generated conceptual illustration for Testing When Quantized AI Caches Preserve History
AI-generated conceptual illustration; not documentary evidence.

Language models store key and value representations of earlier tokens in a KV cache to help generate what comes next. A version-one preprint tests whether certain operations on quantized caches preserve their intended state. Its results identify limits in specific tests and implementations—not a general rate of cache failures or widespread answer errors.

A language model can reuse key and value representations from earlier tokens instead of recomputing them for every new token. These representations live in a key–value, or KV, cache. Quantizing the cache can reduce its memory footprint, but software may also rearrange, extend or roll back its contents. Do those operations preserve the state they are supposed to preserve?

Ziyang Huang and Songwei Wu investigate that question by comparing cache states with explicit references. A key distinction is whether a check verifies the cache’s current decoded contents or whether it verifies that the cache still matches its history before a temporary branch of generation.

Equal encoding counts, different drift

The researchers compared two ways of processing an already quantized cache. One decoded and re-encoded it without changing its shape. The other duplicated rows, encoded them, selected the original rows and encoded again. Selecting the original rows is logically an identity operation, and both paths performed the same number of encodings per cycle. But their shapes differed during encoding.

With four-bit HQQ quantization grouped along axis zero, the duplicate-and-select path accumulated more numerical drift over 16 cycles. Median relative-L2 drift was 7.451% for Qwen3-1.7B and 11.821% for SmolLM3-3B, compared with 0.216% and 0.225% in the same-shape controls. The comparison used 16 shared questions per model. These are measurements on fixed inputs, not estimates of how often deployed systems encounter such behavior.

In a mechanism check on one known input, forcing both paths to use the same number of solver updates did not remove the difference. Preserving the original membership of quantization groups did remove it in the tested comparisons. Axis-one controls matched the shape-preserving control, and tested lazy reorders preserved the initial state. The findings concern particular layouts, quantizers and implementations; they do not establish a rule for all cache formats.

When a crop does not restore earlier history

During speculative generation, a system may add candidate tokens and later reject some. Cropping can remove those tokens. But if the cache has been flushed—writing quantized values back to storage—before the crop, removing the added positions may not restore the earlier values.

The authors tested a prefix-view extension: it changed which part of the current cache was visible without immediately re-encoding the packed data. The extension passed the tested checks against the current prefix. In six model-and-codec settings, however, a flush followed by a crop changed retained history and the logits for the next input. The distinction matters: passing a current-prefix check did not establish exact restoration of the pre-branch state in those tests. Checkpoint restoration and dense rollback reproduced the tested earlier state exactly. In a separate set of tested paths, appending and cropping in llama.cpp also preserved the active state, showing that the result depends on the implementation and operation sequence.

The paper also examines MLX-LM through scoped fixtures. In those tests, cache updates could leave caller-held references out of sync with internal state. A synchronization change restored the tested in-place update behavior while preserving the native computations. In rejection tests, stale references changed logits but not greedy next tokens. The study did not test arbitrary cancellation, exceptions, concurrency or the full software suite, so this is not a general claim about caller references.

What the experiments can establish

One narrow sampling result illustrates why the authors limit their claims. For one SmolLM3 question, one maintenance cycle and a shared fixed sampling stream, the repeat-select path produced an incorrect resolved answer while the no-maintenance and same-shape controls produced the correct answer. The planned expansion required qualifying examples across two questions and both models; the evidence did not meet that rule. This is a conditional counterexample, not a failure-rate estimate or evidence of general answer degradation.

The broader lesson is about defining what a test is meant to preserve. In the tested flush-then-crop configurations, checks of the current prefix did not certify restoration of pre-branch history. A preservation test needs a clear reference state and operation sequence. Logit changes, or even a changed token, do not by themselves show that a final answer is wrong.

This is a version-one arXiv preprint submitted to IEEE for possible publication, not evidence of peer review. The authors report retaining protocols and selected checks, while noting that fresh reproduction across all settings remains untested. The experiments identify specific boundaries worth testing further; broader behavior across inputs and serving systems remains uncertain.

Reviewed cross-references

These connections were reviewed by a model, not independently fact-checked by a human. Similarity does not imply agreement; consult the original papers and the evidence below.

  • Why the Same Greedy AI Can Write Different Text

    Supporting evidence: Both studies show that changing an inference path can change model outputs under finite precision: Huang and Wu report changed next-token logits after flush–crop cache paths, with a greedy-token change in only one tested condition; Khan and Kumar report changed greedy text across decoding widths and padding on Qwen3-0.6B. These are complementary, not equivalent tests: the first concerns cache-history maintenance across six model/codec settings, while the second concerns decoding shape on one small model and software stack.

    Model review: · openai-codex/gpt-6-luna

    Evidence and provenance

    Selected excerpts, not complete papers. PDF extraction can omit figures or damage equations, tables and reading order; sources may be preprints.

    • 2611.30720v1 — Original paper

      Excerpt reference: static/papers/2611.30720v1.md:721-787
      Basis: Paper text
      Source SHA-256: 59e6e2d8b5f42218edb8018703153d85d66dc6af66e646e22bd7036b8b16e4dd

    • 2611.27554v1 — Original paper

      Excerpt reference: static/papers/2611.27554v1.md:13-80
      Basis: Paper text
      Source SHA-256: 0c1f19cca17df340b06d9800c73e0c2072248c2127288fcfd686e08469772662

Automatically matched by shared topic keywords. These links do not imply that the sources agree or establish a consensus.