Manuscript Offprint

arXiv:2610.19605

PN-Mix: Pair-Norm Guided Mixed-Precision Key Cache Quantization for Efficient Long-Output LLM Inference

Gil Jae Song, Sungjoo Yoo

Abstract

Long-output inference in large language models suffers from severe KV cache memory and bandwidth bottlenecks. While KV cache quantization alleviates this issue, low-bit quantization (e.g., 2-bit) severely degrades model accuracy. Recent mixed-precision key-cache quantization methods mitigate this degradation by allocating higher precision to important key channels, but estimate channel saliency using only key statistics. Through attention logit perturbation analysis at the RoPE channel-pair level, we show that quantization errors in channel pairs with large query-key pair-norm products contribute significantly to logit variation. Based on this insight, we propose PN-Mix, a mixed-precision key-cache quantization method for RoPE-based decoder-only LLMs, which allocates higher precision to salient channel pairs identified once during the prefill stage and reused throughout decoding. Across standard reasoning, code-generation, and AIME benchmarks, PN-Mix with 2.26-bit average precision achieves comparable or better average accuracy than prior mixed-precision methods using 2.32–2.39 bits. Furthermore, in our Pareto sweep, PN-Mix degrades gracefully down to 1.5 bits, whereas the compared baselines exhibit sharper performance drops below 2.25 bits.

1 Introduction

Long-output inference has become a central capability of large language models (LLMs), enabling applications that require extended generation such as code generation and complex problem solving. However, long-output decoding exposes a severe systems bottleneck in the key-value (KV) cache, which stores previous keys and values but grows linearly with sequence length and batch size. This growth increases memory pressure, reducing the feasible batch size for serving and limiting the maximum generation length. For example, Qwen3-8B

Per-head Key Cache Layout

Figure

Figure 1: Post-RoPE key-cache layout of PN-Mix. Salient RoPE channel pairs selected during prefill are stored in higher precision across quantized pages, while the remaining pairs use lower precision.

in FP16 runs out of memory on a single A100-40GB GPU when the generation length exceeds 4K at batch size 32, or when the batch size exceeds 20 at an 8K generation length (Figure 6).

KV cache quantization alleviates this bottleneck by storing cached keys and values at lower precision while retaining all token positions and the original cache structure. Yet this compression is inherently lossy: aggressive low-bit quantization (e.g., 2-bit) can introduce errors that substantially degrade reasoning accuracy over long chains of thought (Liu et al., 2025). Thus, effective KV cache quantization requires not only lowering precision, but also allocating the limited bit budget to the most critical components.

Recent mixed-precision methods allocate higher precision to salient key channels, motivated by the greater quantization sensitivity of keys than values (Li et al., 2025; Xia et al., 2026; Hariri et al., 2026). However, their saliency estimates rely on

∗^{*}Indicates corresponding author key statistics alone and operate at the individual-channel level, overlooking query-key interactions and the channel-pair structure induced by RoPE.

In this work, we propose PN-Mix, a pair-norm guided mixed-precision key-cache quantization method designed for RoPE-based decoder-only LLMs. Our key observation is that key-cache quantization should be guided by its effect on attention logits, rather than by key statistics alone. Through attention-logit perturbation analysis at the RoPE channel-pair level, we show that quantization errors in channel pairs with large query-key pair-norm products can contribute substantially to logit variation. PN-Mix therefore assigns higher precision to such salient RoPE channel pairs. We further find that salient channel pairs estimated from prefill tokens are predictive of full-sequence saliency, enabling PN-Mix to identify them once during prefill and reuse them throughout decoding. As a result, PN-Mix remains input-adaptive without offline calibration and avoids repeated saliency recomputation during decoding.

Overall, this work makes three main contributions:

• We derive a query-aware RoPE channel-pair saliency criterion based on query-key pair-norm products from attention-logit perturbation analysis.

• We propose PN-Mix, a mixed-precision key-cache quantization method that input-adaptively selects salient RoPE channel pairs once during prefill and reuses the resulting selection throughout decoding.

• We show that PN-Mix improves long-output inference by reducing average key-cache precision while preserving accuracy and avoiding decoding-time saliency recomputation.

References (43)

  • Training Verifiers to Solve Math Word Problems
  • RULER: What's the Real Context Size of Your Long-Context Language Models?
  • Zheng Wang, Boxiao Jin, Zhongzhi Yu, and Minjia Zhang. 2024. Model tells you where to merge: Adaptive kv cache merging for llms on long-context tasks. arXiv preprint arXiv:2407.08454. (opens arXiv in a new tab)
  • Qwen3 Technical Report
  • June Yong Yang, Byeongwook Kim, Jeongin Bae, Beomseok Kwon, Gunho Park, Eunho Yang, Se Jung Kwon, and Dongsoo Lee. 2024. No token left behind: Reliable kv cache compression via importance-aware mixed precision quantization. Preprint, arXiv:2402.18096. (opens arXiv in a new tab)
  • Across both models and AIME benchmarks, value-only quantization is less harmful than key-only quantization, especially when the first 32 tokens are preserved in FP16
  • For R1-Qwen-7B and R1-Llama-8B, we randomly select one problem from AIME25 and LiveCodeBench v5, respectively
  • We report key-cache MSE $\Delta_{\tilde{K}}$ and attention KL divergence $D_{\mathrm{KL}}^{A}$ for uniform-precision baselines and H3(50%)L1 mixed-precision settings
  • Across both models and both values of $r$, the $\tilde{Q}\tilde{K}$ pair norm achieves the highest Jaccard similarity with the decoding-time
  • The figure reports the cumulative importance ratio captured by the top $r\%$ channel pairs for R1-Qwen-7B, Qwen3-14B, and Qwen3-32B on AIME25, and for R1-Llama-8B on LiveCodeBench v5
  • The advantage of the $\tilde{Q}\tilde{K}$ pair norm is larger at $r = 10\%$, indicating that incorporating query-side information is particularly useful for identifying the most salient channel pairs
  • Figure 5 therefore reports the cumulative fraction of the total importance captured by the top- $r\%$ channel pairs
  • We further examine this concentration at larger model scales using Qwen3-14B and Qwen3-32B
  • On Qwen3-32B, the corresponding ratios are 86.0%, 94.8%, and 97.4%, showing that the importance distribution remains highly concentrated at 32B scale
  • For all methods, the KV cache is pre-allocated up to max_cache_len before inference, allowing peak memory to be compared under the same static cache-allocation protocol
  • Both quantized methods support substantially larger batches than FP16, with PN-Mix maintaining the lowest memory usage as B increases
  • Panel (c) therefore reports per-GPU generation throughput as the batch size is increased at $L_{gen} = 8K$, using a prompt length of $P = 141$ and greedy decoding
  • For example, at B = 20, FP16 achieves 469.8 tok/s compared with 420.8 tok/s for PN-Mix
  • The shaded region (steps 11K–31K) indicates the KV-cache-read-dominated regime, and $\beta$ denotes the linear-regression slope in this region ( $\mu$s/step)
  • Both methods remain at a roughly 45–48 ms plateau up to approximately 10K decoding steps
  • After mixed-precision quantization of the key cache, salient channel pairs are represented by integers in the range [0, 7], while the remaining channels are represented by integers in the range [0, 1]
  • one for computing $\tilde{Q}_{h,t}\tilde{K}_{h,1:t}^{\top}/\sqrt{d}$ and the other for computing $A_{h,t}V_{h,1:t}$
  • Since the methods use different native precision-allocation schemes, Tables 2 and 3 retain these schemes and use configurations within a narrow 2.25–2.4-bit range rather than enforcing an exact bit match
  • Let T denote the total number of tokens, N the FP16 residual-buffer length, $N_{s}$ the number of sink tokens retained in FP16, and
  • Both Kitty and PN-Mix preserve $N_{s}$ sink tokens in FP16 and use mixed-precision key quantization with high and low precisions $b_{H}$ and $b_{L}$
  • Normalizing the total storage by the number of key elements excluding the residual buffer gives
  • For Kitty, high precision is assigned at the channel level
  • The corresponding effective high-precision ratio is
  • Since there are $d/2$ RoPE pairs and each pair requires one bit to record whether it is assigned high precision, the total mask size is $d/2$ bits per KV head
  • These two metadata tensors are stored once and shared across all tokens
  • Panel (a) reports the method-specific quantization and selection parameters, including the effective selection ratios after integer rounding
  • PolarQuant originally uses 3-bit per-channel quantization, and reducing both radius and angle channels to 2 bits can amplify quantization error after the polar-coordinate transformation
  • We therefore reproduce the profiling procedure from the original ChanMix method and validate it on three models with official profiles
  • For each method, we sweep candidate configurations and select the operating point whose average key-cache bit-width is closest to each target bit budget: 3.0, 2.5, 2.25, 2.0, and 1.5 bits
  • We compare PN-Mix with KIVI, ChanMix, and Kitty under the same low-bit regime: all compressed methods use an average key-cache precision of 2.25–2.39 bits, while the value cache is kept in full precision
  • PN-Mix remains competitive across all evaluated languages, with PN-Mix (2) achieving the best compressed-model accuracy on Chinese, French, and Japanese, showing that its effectiveness is not limited to English generation
  • PM-KVQ profiles the quantization sensitivity of each transformer block on calibration data and uses integer programming to assign a final bit-width (Fbit) to each block under a given memory budget
  • PM-KVQ uses layer-level 4/2-bit Fbit allocation, which admits only discrete operating points
  • For PN-Mix, we use the same $b_{V} = 2$ configurations as in Table 3, while PM-KVQ uses the lowest model-specific mixed-precision operating point within the 2.25–2.4 average-bit range
  • On R1-Qwen-7B, both PN-Mix variants achieve higher mean accuracy than PM-KVQ on AIME24 and AIME25 while using fewer average KV bits
  • All technical content and implementation details were verified and finalized by the authors
  • ><tr><td colspan=
  • Average bit-widths are computed with $T_{q}=32{,}768$, where $T_{q}$ denotes the number of quantized tokens; the FP16 residual buffer is excluded from the calculation