ELVIA.Evidence Atlas
ICML 2025ELVIA assessment Major

KVTuner: Sensitivity-Aware Layer-Wise Mixed-Precision KV Cache Quantization for Efficient and Nearly Lossless LLM Inference

Xing Li, Zeyu Xing, Yiming Li, Linping Qu, Huiling Zhen, Yiwu Yao, Wulong Liu, Sinno Jialin Pan, Mingxuan Yuan

ELVIA analysis

Independent review pending

The theoretical explanation connecting concentrated attention to reliable low-bit quantization contains a Major unsupported implication: concentration before quantization does not control the projected quantization error. A finite counterexample using the stated two-bit quantizer nearly reverses an initially concentrated attention distribution. The same difficulty persists under the appendix’s Gaussian model. Two Minor findings concern overlapping released layer groups and a zero-remainder prefilling boundary. Empirical improvements and the practical value of offline mixed-precision search are not disproved. Evidence limits, alternative readings, and the precise scope of verified corrections are stated.

Problem 1. the attention-concentration proof drops an uncontrolled factor

Major
Evidence and reasoning

Problem statement

Inspection subject recorded in the report

For one attention head, absorb the usual 1/D1/\sqrt D into the effective query u,u, and write zj=uKj,δj=u(K^j−Kj),aj=ezj∑kezk,a^j=ajeδj∑kakeδk.(1.1)z_j=uK_j,\quad \delta_j=u(\widehat K_j-K_j),\quad a_j=\frac{e^{z_j}}{\sum_k e^{z_k}},\quad \widehat a_j=\frac{a_je^{\delta_j}}{\sum_k a_ke^{\delta_k}}. \tag{1.1} Section 3.2, Eq. (2), quantizes each selected group by x^=z+s round⁡((x−z)/s),z=min⁡x,s=(max⁡x−min⁡x)/(2B−1).(1.2)\widehat x=z+s\,\operatorname{round}((x-z)/s),\qquad z=\min x,\quad s=(\max x-\min x)/(2^B-1). \tag{1.2} The method searches layer precision pairs using calibration accuracy and average nominal bit width, then reuses the chosen configuration online. The arithmetic mean bit objective is appropriate as a nominal payload measure when the layers have equal KV tensor sizes; it is not itself an accounting of metadata, residual tokens, packing, or peak allocations.

the attention-concentration proof drops an uncontrolled factor.

Two finite keys in R3,R^{3}, nonzero query, per-token asymmetric round-to-nearest B=2B=2 with positive ranges and no ties. Query scaling absorbed exactly. A separate example grants Appendix A's iid Gaussian-coordinate model.

Proof

Claim and dependency. Lemma 1 in Section 4.4, p. 5, asserts an exclusivity relation between sparse, concentrated attention and consistent low-precision robustness. Appendix A, p. 16, Eqs. (5)–(6), is its proof. Case 22 drops every non-dominant term because ezj−zie^{z_j-z_i} is small, even though that term is multiplied by eδj−δi.e^{\delta_j-\delta_i}. This theoretical explanation is advertised in the abstract and introduction and used to interpret sensitive layers in Sections 4.4–4.5 and Appendix E. No bound on u,u, on the projected errors, or on their size relative to logit margins is supplied.

A finite counterexample to the actual quantization argument. Use two keys in dimension three, per-token asymmetric quantization with B=2,B=2, and K1=(0.49,0,1),K2=(0.48,0,1.2),u=(1000,0,0).K_1=(0.49,0,1),\quad K_2=(0.48,0,1.2),\quad u=(1000,0,0). These groups have positive ranges and no rounding ties. The original query in Eq. (1) can be q=3 u,q=\sqrt3\,u, so the scale convention causes no discrepancy. The two group scales are 1/31/3 and 0.4.0.4. Thus K^1=(1/3,0,1),K^2=(0.4,0,1.2).\widehat K_1=(1/3,0,1),\qquad \widehat K_2=(0.4,0,1.2). The original logit margin is 490−480=10,490-480=10, whereas the quantized margin is 1000(1/3−0.4)=−200/3.1000(1/3-0.4)=-200/3. Consequently a1=0.9999546021313,a^1=1.11438315784×10−29,TV⁡(a,a^)=0.9999546021313.a_1=0.9999546021313,\qquad \widehat a_1=1.11438315784\times10^{-29}, \quad \operatorname{TV}(a,\widehat a)=0.9999546021313. The initial attention is extremely concentrated, but the quantized distribution is almost reversed. All coordinates and errors are finite. Replacing 10001000 by c→∞c\to\infty makes the original attention arbitrarily concentrated while the quantized attention converges to the other token. This is not a rounding-level discrepancy. Values such as V1=(0,0,1),V_1=(0,0,1), V2=(1,0,0)V_2=(1,0,0) are exactly representable by the same per-token rule and transmit the attention reversal to the output. This construction is an attention-level counterexample, not a claim that these exact activations occurred in a tested LLM.

The Gaussian assumption does not rescue the derivation. Appendix A also models coordinate errors as Gaussian with σ=(max⁡K−min⁡K)/(2B−1).\sigma=(\max K-\min K)/(2^B-1). This is an additional stochastic model, not the distributional law of deterministic rounding. Even granting independent Gaussian coordinates, take K1=(0.001,0),K_1=(0.001,0), K2=(0,1),K_2=(0,1), u=(10000,0),u=(10000,0), B=2,B=2, and σ=1/3.\sigma=1/3. Again a1=0.9999546.a_1=0.9999546. Now the noisy margin is 10+Z,Z∼N(0,2(10000/3)2).10+Z,\qquad Z\sim N(0,2(10000/3)^{2}). Its probability of reversing sign is Φ ⁣(−102(10000/3))=0.4991537163.\Phi\!\left(-\frac{10}{\sqrt2(10000/3)}\right)=0.4991537163. Thus even a natural interpretation of the appendix’s own noise assumption gives almost one-half probability of overturning the dominant token. The two examples test separate interpretations and are not conflated.

Necessity, alternatives, and scope. For finite logits, equality of the entire two softmax distributions holds exactly if and only if every δj\delta_j is the same: compare their pairwise probability ratios. The paper acknowledges this as Case 11 but dismisses it as atypical without an assumption that excludes it. For instance, Kj=(xj,0,1),K_j=(x_j,0,1), 0<xj<1,0<x_j<1, and u=(0,0,1)u=(0,0,1) give a uniform, non-concentrated distribution that is preserved exactly for every such xjx_j and every positive integer bit width, although the first coordinates may have nonzero rounding errors. This is a whole family with a nonzero query, not only q=0.q=0.

A fixed, bounded perturbation becomes harmless when a margin tends to infinity. That restricted reading is correct; it is precisely the missing condition. Empirical correlations in Figures 4 and 11–19 may still hold for the measured models. They do not prove the exclusive or general robustness statement. The finding is Major because the paper’s central theoretical explanation is invalid as derived, without requiring a failure of its entire search framework or a lower benchmark score.

Verified correction bound. If zi−zj≥mz_i-z_j\ge m and δj−δi≤ρ\delta_j-\delta_i\le\rho for every j≠i,j\ne i, then (1.11.1) gives a^i≥11+(S−1)e−m+ρ.(2.1)\widehat a_i\ge \frac{1}{1+(S-1)e^{-m+\rho}}. \tag{2.1} Each denominator ratio is at most e−m+ρ,e^{-m+\rho}, proving the bound directly. The sufficient condition must therefore compare the margin with projected error and sequence length. With ∣δj∣≤η,|\delta_j|\le\eta, one may use ρ=2η.\rho=2\eta. This repairs a conditional single-head statement only; it proves neither prompt-independent layer sensitivity nor full-model accuracy preservation. Targeted inspection of arXiv v5, dated 2020 November 2025,2025, found the same Lemma 1 and Case 22 approximation still present [later]; no full-version diff or author correction is asserted.

□\square

Possible revision

With original margin >=m and pairwise projected error differences <=rho, a^i≥1/(1+(S−1)exp⁡(−m+ρ)).\widehat a_i\ge1/(1+(S-1)\exp(-m+\rho)). Bound proved; only conditional single-head guarantee, no full-model or prompt-independent result.

Problem 2. released layer groups are not partitions for two model settings

Minor
Evidence and reasoning

Problem statement

Inspection subject recorded in the report

For one attention head, absorb the usual 1/D1/\sqrt D into the effective query u,u, and write zj=uKj,δj=u(K^j−Kj),aj=ezj∑kezk,a^j=ajeδj∑kakeδk.(1.1)z_j=uK_j,\quad \delta_j=u(\widehat K_j-K_j),\quad a_j=\frac{e^{z_j}}{\sum_k e^{z_k}},\quad \widehat a_j=\frac{a_je^{\delta_j}}{\sum_k a_ke^{\delta_k}}. \tag{1.1} Section 3.2, Eq. (2), quantizes each selected group by x^=z+s round⁡((x−z)/s),z=min⁡x,s=(max⁡x−min⁡x)/(2B−1).(1.2)\widehat x=z+s\,\operatorname{round}((x-z)/s),\qquad z=\min x,\quad s=(\max x-\min x)/(2^B-1). \tag{1.2} The method searches layer precision pairs using calibration accuracy and average nominal bit width, then reuses the chosen configuration online. The arithmetic mean bit objective is appropriate as a nominal payload measure when the layers have equal KV tensor sizes; it is not itself an accounting of metadata, residual tokens, packing, or peak allocations.

released layer groups are not partitions for two model settings.

Pinned source configurations; prerequisites assumed available for control-flow implication; no author execution.

Proof

Location and assumptions. Section 5.3 and Appendix D.1.2 group layers to define one precision pair per layer. In the supplied `search_optuna_adaptive.py`, lines 3737–43,43, the Qwen2.5-14B per-channel configuration repeats layer 25,25, and the Qwen2.5-32B per-channel configuration repeats layers 22,22, 24,24, and 25.25. The independent static audit checks all twelve model/mode combinations; these are the two failures.

For the 14B setting, 4949 memberships are used for 4848 distinct layers. Lines 218218–228228 construct a dictionary that overwrites a repeated layer, but accumulate bit cost over every membership and divide by 2L.2L. If every group uses KV4, the actual dictionary assigns four nominal bits per element while the returned objective is 49(4+4)2⋅48=4.083333….\frac{49(4+4)}{2\cdot48}=4.083333\ldots. Thus even the uniform configuration’s reported objective and constraint value are wrong.

For the 32B setting, the group at zero-based index 22 contains 22,22, 24,24, and 2525 outside its designated special candidate set. Assuming required dependencies are available, the explicit consistency condition at lines 176176–185185 raises `ValueError` before the search starts. This is a static control-flow deduction, not an executed author program.

Impact and correction bounds. These defects obstruct or mismeasure the released extensions to these settings. They do not establish that the main 3B/7B/8B results used these groups, and they do not invalidate the separately reported uniform-precision 14B/32B measurements. That limited impact supports Minor. For 32B, removing 22,22, 24,24, and 2525 from group index 22 yields a complete disjoint 64-layer partition compatible with the supplied special sets; this exact data-level repair was checked. For any setting, computing the nominal bit sum from the final distinct-layer mapping avoids double counting, but the grouping still must be made unambiguous. No corrected search performance has been verified.

□\square

Possible revision

Removing layers 22,22, 24,24, and 2525 from Qwen32 group index 22 gives a complete, disjoint 64-layer partition compatible with the templates; this data-level repair was verified. Sum the distinct-layer mapping to avoid cost duplicates; performance remains unverified.

Problem 3. the forced-prefilling path mishandles zero remainder

Minor
Evidence and reasoning

Problem statement

Inspection subject recorded in the report

For one attention head, absorb the usual 1/D1/\sqrt D into the effective query u,u, and write zj=uKj,δj=u(K^j−Kj),aj=ezj∑kezk,a^j=ajeδj∑kakeδk.(1.1)z_j=uK_j,\quad \delta_j=u(\widehat K_j-K_j),\quad a_j=\frac{e^{z_j}}{\sum_k e^{z_k}},\quad \widehat a_j=\frac{a_je^{\delta_j}}{\sum_k a_ke^{\delta_k}}. \tag{1.1} Section 3.2, Eq. (2), quantizes each selected group by x^=z+s round⁡((x−z)/s),z=min⁡x,s=(max⁡x−min⁡x)/(2B−1).(1.2)\widehat x=z+s\,\operatorname{round}((x-z)/s),\qquad z=\min x,\quad s=(\max x-\min x)/(2^B-1). \tag{1.2} The method searches layer precision pairs using calibration accuracy and average nominal bit width, then reuses the chosen configuration online. The arithmetic mean bit objective is appropriate as a nominal payload measure when the layers have equal KV tensor sizes; it is not itself an accounting of metadata, residual tokens, packing, or peak allocations.

the forced-prefilling path mishandles zero remainder.

force_quant=True, residual_length32, new cache with 6464 tokens; no author runtime execution.

Proof

Claim and source. Section 5.3, p. 7, and Appendix E.1, p. 23, emphasize applying quantized KV during prefilling. In `flexible_quant/flexible_quant/flexible_quantized_cache.py`, lines 173173–190,190, the `force_quant=True` path with nonzero residual length RR computes r=S mod R,r=S\bmod R, passes the slice `:-r` for quantization, and retains `-r:` at full precision.

For S=64,R=32,S=64,R=32, r=0.r=0. Python’s `:-0` is empty and `-0:` is the entire sequence. Hence this path sends zero tokens to quantization and retains all 64,64, rather than quantizing the complete prefix and retaining an empty suffix. If a backend rejects the empty input, it can fail earlier; that runtime outcome was not tested. The source-level slice defect is independent of such backend behavior.

Alternatives, impact, and bounded repair. The defect is confined to this flag and boundary condition, and does not occur for the same reason when r>0r>0 or R=0.R=0. The released search file itself sets `force_quant=False`; its historical relation to the prefilling-enabled paper runs is unresolved. Therefore no numerical table damage is asserted, and the supported severity is Minor. Computing c=S−r,c=S-r, using prefix `:c` and suffix `c:`, restores the intended partition at this boundary. Only the slicing identity is verified; backend empty-input handling and complete inference behavior require separate evidence.

□\square

Possible revision

cut=S-r; prefix[:cut],suffix[cut:] yields intended boundary partition. Verified slicing only, not full backend behavior.

Supporting record & provenance

Work status

Current version

Version 1

Minhao Liu · Initial report · Version 1

Independent review pending

Original claim and review scope

According to the layer-wise attention score and relative output errors of different prompts and KV cache quantization precision pairs of Llama-3.1-8B-Instruct in Figure 3 and 13, transformer layers sensitive to KV cache quantization remain consistent across different input prompts.

Published ICML 2025 proceedings PDF (PMLR 267); PDF p. 5

Actual review scope

The recorded inspection concerns these source locations: Section 4.4 Lemma 1 p. 5; Appendix A Eqs.5-6 p. 16; abstract/introduction theoretical contribution; Appendix E interpretation; Section 5.3 and D.1.2 layer grouping; search_optuna_adaptive.py lines37-43,176-185,218-228; Section 5.3 p. 7 and Appendix E.1 p. 23 prefilling; flexible_quantized_cache.py lines173-190.

Submit an author revisionContribute a review