Manuscript Offprint

arXiv:2608.28911

SemKV: Semantic Mixed-Precision KV Cache Quantization Guided by the Quality Cliff for Long-Context LLM Inference

Daeha Lee, Do-Hyung Kim, Jae-Hong Kim

Abstract

The key-value (KV) cache is a primary memory bottleneck in long-context large language model inference, since its size grows linearly with context length. Existing KV-cache compression spans uniform quantization, token deletion, and importance-aware mixed precision, but it remains unclear how to choose precision levels without crossing a sharp quality boundary — and deletion additionally risks removing evidence that long-context reasoning depends on. We introduce SemKV, an all-token-preserving mixed-precision KV-cache quantization framework guided by an empirically measured quality cliff.

Sweeping uniform quantization over a fractional-level grid under a prespecified multi-seed statistical protocol, we find that Llama-3.1-8B-Instruct with an affine scalar quantizer is statistically indistinguishable from FP16 KV down to 2.322 code bits/value and degrades sharply at 2.0 bits. SemKV measures this boundary offline, then assigns two adjacent above-cliff precisions (2.585/2.322 bits) to tokens by a model-internal importance ranking, realizing an average of 2.39 code bits/value (2.65 effective bits/value after packing and metadata) — a measured 6.0× storage reduction with no statistically detectable quality difference from FP16 KV on our sampled LongBench evaluation (n=900, three seeds). Interior probes show that the tested partial-protection mixtures do not recover full-KV-level quality when they cross the cliff, and a block-wise deferred allocation extends the mechanism to generated tokens and multi-turn dialogue. Preserving all tokens at low precision also substantially outperforms FP16 token pruning even though the pruning baseline uses a 1.5× larger memory footprint, and the cliff, the interpolation property, and the operating point transfer to Mistral-7B-Instruct-v0.3, where informative selection remains necessary for safe mixing.

Finally, the measured cliff depends on the model-quantizer pair under a specified evaluation protocol: replacing the affine base with a distortion-optimized quantizer (TurboQuant-MSE) lowers the collapse boundary in every protocol we test, and SemKV converts the extra headroom directly into compression — interpolating at 2.0/1.585 bits inside the newly opened grid gap, it is statistically indistinguishable from full KV at an effective 2.025 bits/value, raising the no-detectable-loss operating point from 6.0× to 7.9×. A small above-cliff floor persists in full-cache multi-turn quantization under both bases (its magnitude 2.5× smaller under TurboQuant). In the tested multi-turn comparisons, SemKV remains statistically indistinguishable from the upper grid point while using fewer bits. These results motivate a general recipe: measure the cliff for the target deployment setting, then interpolate above it.

Keywords: KV cache compression, Long-context inference, Large language models, Mixed precision quantization, Semantic importance

1. Introduction

Large language models (LLMs) increasingly operate on contexts of tens of thousands of tokens for document QA, code understanding, retrieval-augmented generation, and multi-turn agents [31–36, 44–46].

*Corresponding author. Email address: bigsum@etri.re.kr (Daeha Lee)

Preprint. Under review.

September 1, 2026

In Transformer decoding, the key-value (KV) cache grows linearly with context length, and its memory footprint governs the feasible batch size and context budget of practical serving systems [37–38, 47]. Uniform KV quantization [1–2, 9], eviction and pruning [13–24, 55], and efficient attention [25–29] have all been proposed, but uniform quantization is blind to token-level differences, and deletion-based methods risk removing evidence tokens.

This paper starts from an empirical observation rather than an architectural one. When uniform KV quantization is swept over a fractional-bit grid (e.g., log⁡25≈2.322\log_2 5 \approx 2.322, log⁡26≈2.585\log_2 6 \approx 2.585 bits realized by integer quantization levels), quality does not degrade gradually: on our LongBench protocol with Llama-3.1-8B-Instruct, all uniform settings from 3.0 down to 2.322 bits are statistically indistinguishable from full-precision KV, and quality collapses only in the interval (2.0, 2.322] — a quality cliff that co-occurs with a sharp increase in runaway generation. Under the same affine base, the same collapse location reappears in single-turn QA, in generation-token quantization, and in multi-turn dialogue (where a small above-cliff residual floor additionally exists), and even on a different backbone (Mistral-7B-Instruct-v0.3).

The cliff reframes what mixed precision is for. In the tested setting, mixtures crossing the cliff fail to recover full-KV performance, whereas allocation has little measurable effect when both precision levels remain above it. The useful regime is the sparse fractional-bit grid just above the cliff, where uniform quantization can only sit on grid points, while mixed precision can interpolate between them. SemKV therefore preserves every token, scores each token with a model-internal semantic importance indicator, and assigns the higher of two above-cliff grid precisions to the top-ranked fraction, reaching average precisions (e.g., 2.39 bits between 2.322 and 2.585) that uniform quantization cannot realize, at quality statistically indistinguishable from full KV.

The main contributions of this paper are as follows.

  • Quality-cliff map on a fractional-bit grid. We chart uniform KV quantization on a fractional-bit grid under a prespecified multi-seed statistical protocol and locate a quality cliff in (2.0, 2.322] bits — whose catastrophic transition is reproduced across prefill, generation, and multi-turn protocols under this base (multi-turn additionally shows a small above-cliff floor; Sec. 4.6) — for Llama-3.1-8B, co-occurring with runaway generation; on the primary single-turn LongBench protocol the region [2.322, 3.0] is statistically indistinguishable from full KV.

  • Grid interpolation by all-token-preserving mixed precision. SemKV keeps all tokens and interpolates between above-cliff grid points via importance-ranked two-level allocation, reaching otherwise unreachable average precisions with no statistically detectable deficit from full KV — a measured 6.0×6.0\times KV-storage reduction versus FP16 at the 2.39-bit operating point, metadata included. Ablations over eight model-internal indicators (hidden-state, KV-norm, logit, and attention families) show the effect is structural in the flat regime: indicator choice does not change the outcome there.

  • Generation-token and multi-turn extension. A block-exact deferred-quantization mechanism extends token-wise mixed precision to generation-time tokens; under the affine base, generation quality degrades sharply at 2.0 bits whereas 2.322-bit generation remains statistically indistinguishable from FP16, and the extension holds across multi-turn dialogue.

  • Deletion versus low-precision preservation. Under matched (in fact adverse) memory budgets, FP16 pruning collapses (0.065–0.149) while SemKV at 2.39 bits shows no statistically detectable difference from full KV (0.438); random pruning is statistically indistinguishable from indicator-based pruning and exhibits the same qualitative collapse, implicating token deletion as the dominant source of failure in this controlled comparison.

  • Stress and transfer. A widened-gap stress test whose low-bit side lies below the cliff produces a clear ranking among the tested model-internal indicators, showing that indicator quality becomes important when most tokens receive a below-cliff precision, and the cliff and interpolation property transfer to Mistral-7B-Instruct-v0.3, where SemKV remains statistically indistinguishable from full KV when informative indicators are used; replacing the base quantizer with TurboQuant-MSE shows the cliff is quantizer-dependent, and that the downward shift is protocol-wide: the collapse boundary

moves one grid step down to (1.585, 2.0] in prefill and multi-turn, and to (1.0, 1.585] on the generation side, while SemKV's token-axis allocation composes unchanged, matches TurboQuant's channel-axis 2.5-bit recipe at a smaller effective footprint, and occupies the affine-inaccessible 1.9-code-bit gap at performance statistically indistinguishable from full KV (7.9×).

References (81)