Manuscript Offprint

arXiv:2610.06251

Shared Stopping Decisions Change Answers in HQQ Cache Quantization

Seunghui Jwa, Minsu Oh, Chanjun Park, Yeo-Chan Yoon

Abstract

Language-model systems batch questions for throughput, but unrelated questions should not change a target's answer when its input and numerical execution are fixed. We study compression of the key and value cache, which stores attention representations reused during generation. With request-local groups, Transformers' Half-Quadratic Quantization (HQQ) backend updates compression parameters separately but uses a shared average error to decide when all updates stop. Replacing only the question batched with the target changes four-bit HQQ answers in 170/384 test comparisons across two models. Replaying the other execution's update counts reproduces its complete answer and cache fingerprints in every changed pair, in both directions. Computing the stopping mean in FP32 reduces cache differences but leaves answer changes. Native HQQ also changes confirmed numerical correctness in eight arithmetic pairs. Fixed iterations and request-local stopping remove observed companion dependence under matched controls. Request-local stopping remains sensitive to synthetic padding changes at the tensor level. Fixing the original iteration budget removes this decision path without tuning. Neither repair has an established quality advantage, and natural rebatching still changes answers. Request-independence audits must cover stopping decisions as well as quantization groups.

1 Introduction

Serving systems batch unrelated questions for efficiency, but a target's answer should not depend on other questions in its batch, called companions. Beyond known floating-point effects (Yuan et al., 2025; vLLM Project, 2026), we test for dependence from cache compression with target input, positions, attention mask, and padded batch shape fixed.

The key and value (KV) cache stores attention representations reused during generation. Quantization stores them as low-bit codes with reconstruction parameters. Half-Quadratic Quantization (HQQ) iteratively fits these parameters (Badri and Shaji, 2023) and is a cache backend in the Transformers model execution library (Wolf et al., 2020; Hugging Face, 2026). Although quantization groups and updates stay within each request, HQQ averages reconstruction error across requests to decide when all updates stop. Companions can change the target's update count.

Development observations inform the repair baselines; a separate test set evaluates their behavior and the causal role of stopping counts. Replacing only the companion changes four-bit HQQ answers in 170/384 comparisons of 192 test questions across two models. To test whether update counts cause these changes, we replay each compression step's recorded count. Under matched computation, all 170 changed pairs reproduce the corresponding complete answer and cache fingerprints in both directions.

Text changes need not change correctness. We compare final numerical answers with references, separately from output-format scores.

To remove companion dependence, we compare fixed iterations, initialization without optimization, and request-local stopping. All restore consistency under matched controls. We also measure their effects on answer quality and compression cost. 1^{1}

References (70)

  • Phi-4 Technical Report
  • deterministic
  • Training Verifiers to Solve Math Word Problems
  • Hanna Foerster, Ilia Shumailov, Cheng Zhang, Yiren Zhao, Jamie Hayes, and Robert Mullins. 2026. Quantamination: Dynamic quantization can leak your data across the batch. ICML Workshop on Trustworthy AI for Good. Preprint, arXiv:2604.26505. (opens arXiv in a new tab)
  • The Llama 3 Herd of Models
  • PyTorch: An imperative style, high-performance deep learning library
  • Qwen3 Technical Report
  • Instruction-Following Evaluation for Large Language Models
  • The QA and arithmetic development examples use training partitions; IFEval uses a development allocation from its public prompts
  • OLMo is a smaller comparison, not a matched-size model
  • Arithmetic prompts request reasoning followed by a numerical answer after ####
  • The source archive provides a minimal public-API example; the full collector additionally implements the explicit-mask and causal controls described here
  • HQQ uses key/value axes 1/1, group size 64, residual capacity 128, proximal exponent 0.7, initial penalty 10, multiplier 1.01, and at most 20 updates
  • The controlled study uses an explicit attention-mask path for every method
  • Test-set candidates are ranked by SHA256 of the selection seed 917503, dataset, source ID, and normalized-question hash
  • Solve the following math problem. Explain your reasoning, then put the final numerical answer after ‘###’
  • It matches the first #### followed by one space and a signed sequence of digits, decimal points, or commas, removes commas, and compares the resulting string with the reference
  • It normalizes supported formatting and fractions and requires all recognized assertions to agree
  • To check that recording does not alter generation, we require each run's output to match its output without recording
  • An equal cache hash or equal first token alone is insufficient
  • This predetermined schedule is part of $F_{g,j}$ in Equation (1), not a statistic of
  • Pass denotes official task correctness or instruction compliance
  • Four-bit pass changes occur only in GSM8K and IFEval; text changes alone do not establish answer errors
  • A sufficient condition for cache transformation $T$ to preserve separation is
  • Equal target cache state produces equal target logits and appended values; applying the condition preserves equality after the next compression
  • continue e = mean absolute error if e < best: best = e else: stop or freeze request
  • The masked request-local loop executes all 20 steps, leaving frozen states unchanged
  • We record every local update through the 20-update cap at initial compression for all 384 original test pairs, including unchanged answers
  • At 32,851 of those ties, the FP32 mean still improves over its earlier minimum
  • The earlier 32 input-selected arithmetic pairs are repeated exactly and counted once
  • >Model/task</td><td rowspan=
  • >Model/task</td><td colspan=
  • A dash denotes an empty group
  • Later recompression occurs in 12/13 and 54/54 pairs
  • The net reduction from 169 to 129 is not a monotonic improvement for every question
  • After 128 generated tokens, the second layer's value-cache update uses 20 versus 17 iterations on identical target inputs, giving a relative reconstruction difference of $2.44 \times 10^{-4}$
  • Official arithmetic parsing, explicit final numbers, QA F1, and exact match remain separate
  • On test-set Llama arithmetic, its final-number accuracy is bounded by 84.38–89.06%, versus 86.72–90.62% for fixed 4 and 87.50–91.41% for fixed 20
  • A and B have no intrinsic quality ordering
  • This criterion requires the correct number after the prescribed #### marker: Answer: 6 fails even when 6 is correct
  • Fixed 20 is 15.4% slower for Llama QA but faster in the other three strata
  • 128 GSM8K and 64 HotpotQA questions
  • Every denominator is all target questions in that row
  • Request-local stopping uses the same implementation as the test-set quality/control study: the full 20-update loop runs on all rows, while device masks freeze each request's final state without reading stopping flags on the host
  • Quanto is faster in this benchmark
  • This excludes model weights and temporary workspace; these measurements establish neither total-model memory savings nor end-to-end generation speed
  • Times are geometric means of per-condition medians over nine repetitions, in milliseconds; two warmups are excluded
  • Questions are linked by batch membership and shared source documents; each model/task forms one connected component
  • Native changes 115/128 long-answer texts after shuffling and 111/128 after sorting, compared with 74/128 and 82/128 for BF16, and 99/128 and 102/128 for fixed 20
  • >Method</td><td colspan=
  • Long: 128 math/instruction pairs; short: 256 QA pairs
  • Table 19 separates text changes by model/task and compares answer quality over all eight layouts
  • Its inspected HQQ weight-only path invokes the same quantizer (TorchAO contributors, 2026)
  • We reconstruct every method with the same FP32 affine expression followed by a BF16 cast and run the same unfused BF16 model and cache
  • The paired native methods use identical tokenized batches, prompts, greedy decoding, and
  • >Shuffle seed</td><td colspan=
  • Six shuffle seeds are the paired units of the sole primary descriptive contrast; length sorting is outside that test
  • >Llama/math</td><td>Text Δ</td><td>50.91</td><td>79.69</td><td>69.27</td></tr><tr><td>Numeric bounds</td><td>88.18–88.87</td><td>87.79–89.65</td><td>87.21–89.45</td></tr><tr><td rowspan=
  • Text $\Delta$ averages changes over six shuffles, with 128 math or 64 QA pairs per model
  • The later weight study uses a separately pinned runtime; the completed cache study retains PyTorch 2.7.0
  • Joint versus separate compression changes 55/96, 77/108, and 64/96 recon-
  • Non-QKV weights agree
  • QA exact-match judgments change in zero, three, and three pairs
  • miles per hour
  • Resampling is separate by model and task; models sharing questions are not pooled as independent samples
  • Original cache/weight QA scores are supplied; the new test-rebatch QA answers are rescored with the pinned answer EM/F1 functions
  • Historical source excerpts are also retained for inspection
  • Table 22 reports each model and task separately; questions are shared across models and are not pooled as independent samples
  • All QA outputs terminate by EOS before the 64-token cap; their maximum lengths are 28 and 42
  • Math changes remain more frequent within the first 64 tokens (80/256, 99/256, 114/256) than QA changes (7/128, 6/128, 14/128)