Local Affine Quantization for KV Caches: From Shared Ranges to Prediction Error
Abstract
Local four-bit KV-cache quantization preserves language-model quality on some models and fails severely on others. Across eight models, we find small value penalties but widely varying key sensitivity. We investigate a source of this variation: persistent channel offsets that consume a shared key range. A fixed offset cancels in exact softmax attention, yet rounding can turn it into position-varying error that changes relative logits. Native-key measurements show that rare rounding-code changes account for substantial temporal-error energy. In two biased architectures, the rotated key-projection bias accounts for nearly all measured first-layer key energy. Subtracting it before quantization and restoring it afterward repairs severe four-bit degradation; StableLM also benefits from tracking its positional trajectory rather than removing only its fixed mean. To locate the prediction effects, we fit complete baseline and centred grids before substituting reconstructed outputs on shifted coordinates or their block neighbours. Shifted-coordinate outputs suffice for almost all four-bit recovery in Qwen2.5. At two bits, neighbouring outputs become consequential, with the attribution depending on the selected coordinates. Local reconstruction error and attention divergence can improve while prediction loss worsens. Whole-model comparisons establish a practical limit: centring repairs a retained channel-grouped layout, while token grouping gives lower loss at two-bit keys across the tested panel. The study connects shared ranges to prediction error and separates fixed-offset removal from reconstruction of a positional component.
Create a lesson
Related papers
A General Framework for Post-Hoc Predictive Distributions on Fixed Regression Models via Local Error Distributions
Shared title terminologycs.LGBreno Freitas, Youcef Msaid, Tiago A. Almeida
From Subspaces to Manifolds: Local Range-Null Decompositions for Domain Generalization
Shared title terminologycs.LGAristeidis Bifis, Emmanouil Z. Psarakis
Predicting falls and near falls with wearable IMU and ECG in parkinson
Shared title terminologycs.LGMuqing Jian, Wenbo Ding, Xusheng Zhu et al.
Conformal Prediction with Nested Modality Masks
Shared title terminologycs.LGAlireza Moayedikia
What Predicts Forgetting in LoRA Fine-Tuning Across Optimizers
Shared title terminologycs.LGZhiyong Jin
MLP Cache: A Post-Hoc Memory-Compute Trade-off for Transformer Inference
Shared title terminologycs.LGHuzheng Yang, Yiqiao Huang, Qingqiao Hu et al.