REVIEW 2 major objections 3 minor 1 cited by
This paper proves near-optimal query bounds for estimating the total variation distance between two autoregressive models, and validates the method by measuring how far two inference engines serving identical weights drift apart.
Reviewed by Pith at T0; open to challenge. T0 means a machine referee read the full paper against a public rubric. the ladder, T0–T4 →
T0 review · deepseek-v4-flash
2026-08-01 12:33 UTC pith:YYDKIPEC
load-bearing objection Solid theory, honest but imperfect empirical bridge: the theorems hold under the stated noisy-oracle model, and the paper deserves serious refereeing despite the independence assumption being violated on real engines. the 2 major comments →
Total Variation Distance Estimation in Autoregressive Models
The pith
A machine-rendered reading of the paper's core claim, the machinery that carries it, and where it could break.
Core claim
The paper's central claim is that the total variation distance between two length-n autoregressive distributions can be estimated to additive ε with query counts that are near-optimal under three natural API models. Under prefix logit access, a likelihood-ratio estimator — average of (1−µ(X)/π(X))₊ over trajectories sampled from π — uses O(n/ε²) queries, and the paper proves a matching lower bound by embedding a biased-coin estimation problem into blocks that require n queries to reveal. Under noisy prefix distribution access, where each query returns an unbiased random sketch of the next-token distribution with relative variance σ², the paper uses the mixture representation TV(π,µ)=E_{X∼M}[
What carries the argument
The load-bearing objects are: (1) the mixture-representation identity TV(π,µ)=E_{X∼M}[|π(X)−µ(X)|/(π(X)+µ(X))] with M=(π+µ)/2, which turns TV into an expectation over a single mixture distribution; (2) the noisy prefix distribution oracle (Definition 3), which returns unbiased estimates of each prefix-conditional next-token distribution with relative variance σ² and subsumes both logit access (σ=0) and sample access (σ²<K); and (3) multilevel Monte Carlo applied to a telescoping sequence of averaging depths rₗ=1+cnσ²2ˡ. Coupled increments Yₗ=Zₗ(X)−Z_{l−1}(X) share the same outer draw X, giving variance that decays as 2⁻ˡ while query cost grows as n²σ²2ˡ, so balancing across levels yields the
Load-bearing premise
The load-bearing premise is that every repeated query to the same prefix returns an independent, unbiased estimate of a fixed next-token distribution with bounded relative variance σ²; the paper itself measures short-lag autocorrelations up to ±0.08 and slow drift in production engines, so independence is violated and is patched only to exchangeability by permutation.
What would settle it
Run the noisy-oracle estimator on a synthetic pair with known TV, feeding an oracle whose repeated per-prefix outputs are correlated (e.g., block-correlated with lag-1 autocorrelation 0.5) at fixed σ; if the query count needed to reach error ε grows faster than O((n+n²σ²)/ε² log²(1/ε)) or the estimate plateaus at a biased value, the independence premise behind the main theorem is falsified.
If this is right
- A user can compare two 'same-model' serving engines, or a provider can validate a faster inference stack, by estimating TV to any additive ε with query counts that scale linearly in sequence length under logit access, independent of vocabulary size.
- Under sample-only access from closed APIs, the improved O(n²K/ε²) bound removes the earlier n³/ε⁵ dependence and the alphabet-size penalty m when the next-token support K is sparse.
- The noisy-logit guarantee quantifies how per-query nondeterminism degrades estimation: TV remains estimable even when σ is large, with cost growing as n²σ²/ε², and it recovers the exact logit bound as σ→0.
- Because TV directly bounds the error of any black-box distinguishing test, a small estimated TV implies no single-output detector can reliably tell the two engines apart, while a large TV quantifies the gap in an interpretable 0-to-1 scale.
- The case study shows cross-engine distances should be reported with their length, truncation, and serving configuration, since measured TV grows with n and with stricter top-k truncation.
Where Pith is reading between the lines
- A direct extension the authors leave implicit: the calibrated noisy-oracle model could serve as a practical regression test for inference stacks — if a kernel or batching change moves the estimated TV above a chosen threshold, it should be flagged before deployment.
- Because real per-call noise is heavy-tailed (excess kurtosis ≈9) and concentrated on low-probability tokens, using a single conservative σ may inflate the practical budget; an adaptive per-prefix variance estimate would likely tighten the query count.
- The exchangeability patch for correlated repeats suggests a testable hypothesis: if batch-scheduling dependencies do not average out, the estimator would plateau above the true TV; measuring TV against a ground-truth pair across batch sizes would expose the threshold.
Editorial analysis
A structured set of objections, weighed in public.
Referee Report
Summary. The paper studies the query complexity of estimating the total variation (TV) distance between two length-n autoregressive distributions under three oracle models: prefix sample access, exact prefix logit access, and a noisy prefix distribution oracle with bounded relative variance. The main theoretical results are: (i) an O~(n^2 K/ε^2) sample-access estimator improving the prior O~(n^3 m/ε^5) bound of Meel et al.; (ii) an O(n/ε^2) logit-access estimator with a matching Ω(n/ε^2) lower bound; and (iii) an O~((n+n^2 σ^2)/ε^2) noisy-logit estimator that smoothly interpolates between the two, with a corresponding lower bound. The upper bound uses a likelihood-ratio estimator for logit access and a multilevel Monte Carlo scheme for noisy access, based on a χ² bound for repeated oracle averages. The paper also presents an empirical case study measuring TV between vLLM and SGLang serving identical Qwen weights, including a denoising effect of repeated queries and a multilevel schedule selection protocol.
Significance. If the technical claims hold, this is a substantial contribution to distribution testing for autoregressive models. The logit-access bound is tight and apparently new; the noisy-oracle interpolation is natural and practically motivated; the sample-access bound improves over the prior state of the art in both n and ε. The proofs of Lemmas 6–9 and Theorems 4–7 are self-contained and internally consistent: the χ² bound, the Lipschitz bound, the MLMC variance balance, and the rare-escape lower-bound embedding are all carefully argued. The paper also ships reproducible code and gives a detailed empirical protocol. The main weakness is that the empirical validation on real serving engines relies on an independence assumption that the paper itself measures as violated; the exchangeability patch does not fully restore the concentration guarantees for the nonlinear estimators used. The theoretical results remain valid under the stated model, but the practical claims need to be framed more carefully.
major comments (2)
- [Section 4.1 and Appendix B.1 / Section 5, Figures 2–4] Definition 3 and Theorem 6 require that repeated oracle calls at a fixed prefix be independent. Appendix B.1 reports short-lag autocorrelations up to ±0.08 and slow drift in vLLM and SGLang, so the real engines violate this premise. The repeat-axis permutation makes the repeats exchangeable, not independent. For linear averages this removes a common per-cell component to leading order, but the estimators bπ_r, bμ_r, and hence Ẑ are nonlinear functions (products and ratios) of those averages, so the variance and concentration guarantees of Lemma 6 and Theorem 6 do not provably transfer. The paper's own diagnostic that raw-order variance ratios inflate by roughly 2× confirms that the dependence is non-negligible. Consequently the empirical RMSE curves and multilevel savings in Figures 4 and Table 2 are an approximate-iid heuristic rather than a consequence of Theorem 6. Please state this
- [Appendix B.2] The synthetic noisy oracle is said to 'satisfy the unbiasedness and relative-variance conditions of Definition 3 exactly while relaxing simplex membership.' But Definition 3 requires the oracle to return a vector in P(Σ), and the construction leaves individual draws unclipped so they may leave [0,1]. A vector with negative components is not a probability distribution, so the χ² expression in Definition 3 is not well defined for such outputs. The later clipping of the r-averaged probability to [10^{-12},1] changes the estimator and may introduce bias. To make the synthetic validation a genuine instantiation of Definition 3, the authors should use a proper noisy distribution oracle (e.g., the Gaussian logit perturbation of Lemma 5 followed by softmax) or explicitly label the synthetic experiment as a heuristic stress test outside the model.
minor comments (3)
- [Lemma 4] The statement and proof use a lowercase 'k' for the support size (e.g., 'σ² = k' and '≤ |supp(π_s)| ≤ k'), but the paper otherwise reserves K for the maximum support size. Please use K consistently or define k locally.
- [Algorithm 1] The query count '3nN' is conservative: the sampling phase already reveals the π log-probabilities along the sampled trajectories, so the additional evaluation of L_{π,i} may be redundant. This does not affect the stated O(n/ε² log(1/δ)) bound, but the constant could be clarified.
- [Figure 2 caption] The caption uses 'TV(π, μ)' in text such as 'estimated TV( , )' without defining which distribution is π and which is μ in the figure. Please make the notation explicit.
Circularity Check
No circularity: theorems are parameter-free from the stated noisy-oracle model; lower bounds reduce to external classical results; experiments estimate σ and TV rather than fitting predictions.
full rationale
No circular step is present. Theorems 4 and 6 derive query bounds directly from Definition 3's relative-variance assumption via Lemma 1 (likelihood-ratio representation), Lemma 6 (χ² accumulation), Lemma 8 (squared-error bound), and Lemma 9 (MLMC variance decay); σ is an input parameter, not fitted to the target TV. The sample-access result instantiates Definition 3 with one-hot vectors and σ²≤K through Lemma 4, an explicit simulation reduction rather than a renaming. Lower bounds (Theorems 5, 7) embed the problem into finite-domain TV estimation and invoke the external minimax bound of [JHW18] (Proposition 1), not any result of the present authors. Experiments determine σ from repeated queries and measure TV from trajectories; Figure 4's pilot-chosen schedules include pilot costs and are compared against baselines, so no fitted value is relabeled as a prediction. The paper's own caveat, "The main caveat is that we need independence across samples" (Section 4.1), and the measured autocorrelations in Appendix B.1 are a threat-model limitation on real serving engines; they affect whether Theorem 6's assumptions hold empirically, but they are not a circularity in the derivation itself.
Axiom & Free-Parameter Ledger
axioms (4)
- domain assumption Noisy prefix distribution oracle (Definition 3): each query returns an unbiased estimate p̂ of the true conditional p with E_{a∼p}[Var(p̂(a)/p(a))] ≤ σ², and outputs are independent across queries.
- domain assumption Exact prefix logit oracle (Definition 1), with one vector query returning log-probabilities for all tokens.
- domain assumption Autoregressive factorization π(x) = ∏_i π(x_i | x_<i) and chain-rule computation of sequence log-probabilities in n prefix queries (Equation 7).
- standard math Standard inequalities (Hoeffding, Chebyshev, mutual-information bounds, Gaussian Poincaré) and the finite-domain minimax l1 lower bound of [JHW18].
read the original abstract
Modern LLM deployments use a number of implementation choices and inference optimizations (e.g., batching, custom kernels, and quantization) on top of fixed weights, so two engines serving "the same model" can produce meaningfully different distributions. We study the problem of estimating the total variation (TV) distance between two length-$n$ autoregressive distributions to additive error $\varepsilon$, under three access models. (1) Under sample access, we use $\widetilde{O}(n^2 K/\varepsilon^2)$ queries, where $K$ is the maximum support of the next-token distribution. This improves upon the $\widetilde{O}(n^3 m/\varepsilon^5)$-query estimator of Meel et al. (2025), where $m \geq K$ is the total size of the token alphabet. (2) Under logit access, we use $O(n/\varepsilon^2)$ queries, and this is tight. (3) Under noisy logit access, we smoothly interpolate between the above two guarantees: if probability values are given to relative error $\sigma$, we use $\widetilde{O}((n+n^2\sigma^2)/\varepsilon^2)$ queries. We complement our theoretical results with an empirical evaluation of our algorithms, for example measuring the distance between SGLang and vLLM serving identical weights. Our experiments highlight the robustness and practicality of estimating the total variation distance, which remains estimable where the KL divergence is infinite. Our code is available at https://github.com/XunZhiyang/llm-tv-estimation.
Figures
Forward citations
Cited by 1 Pith paper
-
Linear time approximation of the TV distance between product distributions
Total variation between two explicit product distributions on [q]^n can be (1±ε)-approximated with high probability in O(qn ε^{-2} log(1/δ)) time via filtered Monte Carlo.
Reference graph
Works this paper leans on
-
[1]
[ACK14] Jayadev Acharya, Clément L Canonne, and Gautam Kamath. A chasm between identity and equivalence testing with conditional queries.arXiv preprint arXiv:1411.7346,
-
[8]
An empirical characterization of outages and incidents in public services for large language models
[CTLI25] Xiaoyu Chu, Sacheendra Talluri, Qingxian Lu, and Alexandru Iosup. An empirical characterization of outages and incidents in public services for large language models. InProceedings of the 16th ACM/SPEC International Conference on Performance En- gineering, ICPE 2025, pages 69–80. ACM,
2025
-
[9]
Because oracle noise at this condition is small, a faithful scoring oracle should almost never assign zero mass to a token the engine itself just sampled
If both engines assign positiver-averaged mass to every sampled token of the trajectory, thenbZ= tanh(|logbπ r −logbµr|/2)(theshared-support log-probability difference); if at least one position receives zero mass from one engine’sr-averaged 34 vllm sglang 0.00 0.05 0.10 0.15 0.20 0.25 0.30 0.35 0.40 0.45 fraction of trajectories with zero mass on the eng...
2000
-
[10]
Model changelists: Characterizing updates to ml models
[EGD+24] Sabri Eyuboglu, Karan Goel, Arjun Desai, Lingjiao Chen, Mathew Monfort, Chris Ré, and James Zou. Model changelists: Characterizing updates to ml models. In Proceedings of the 2024 ACM Conference on Fairness, Accountability, and Transparency, pages 2432–2453,
2024
-
[11]
[FAHA22] Elias Frantar, Saleh Ashkboos, Torsten Hoefler, and Dan Alistarh. Gptq: Accu- rate post-training quantization for generative pre-trained transformers.arXiv preprint arXiv:2210.17323,
-
[13]
Defeating nondeterminism in LLM in- ference.Thinking Machines Lab: Connectionism, September 2025.https:// thinkingmachines.ai/blog/defeating-nondeterminism-in-llm-inference/
[HT25] Horace He and Thinking Machines Lab. Defeating nondeterminism in LLM in- ference.Thinking Machines Lab: Connectionism, September 2025.https:// thinkingmachines.ai/blog/defeating-nondeterminism-in-llm-inference/. [JHW18] Jiantao Jiao, Yanjun Han, and Tsachy Weissman. Minimax estimation of thel_{1} distance.IEEE Transactions on Information Theory, 64...
2025
-
[14]
EAGLE-2: faster inference of language models with dynamic draft trees
[LWZZ24] Yuhui Li, Fangyun Wei, Chao Zhang, and Hongyang Zhang. EAGLE-2: faster inference of language models with dynamic draft trees. InProceedings of the 2024 Conference on Empirical Methods in Natural Language Processing, EMNLP 2024, pages 7421–7432. Association for Computational Linguistics,
2024
-
[15]
KIVI: A tuning-free asymmetric 2bit quantiza- tion for KV cache
[LYJ+24] Zirui Liu, Jiayi Yuan, Hongye Jin, Shaochen (Henry) Zhong, Zhaozhuo Xu, Vladimir Braverman, Beidi Chen, and Xia Hu. KIVI: A tuning-free asymmetric 2bit quantiza- tion for KV cache. InForty-first International Conference on Machine Learning, ICML 2024, Proceedings of Machine Learning Research, pages 32332–32344. PMLR / Open- Review.net,
2024
-
[16]
On distribution testing in the conditional sampling model.arXiv preprint arXiv:2007.09895,
[Nar20] Shyam Narayanan. On distribution testing in the conditional sampling model.arXiv preprint arXiv:2007.09895,
Pith/arXiv arXiv 2007
-
[17]
Auditing black-box llm apis with a rank-based uniformity test.arXiv preprint arXiv:2506.06975,
[ZYQ+25] Xiaoyuan Zhu, Yaowen Ye, Tianyi Qiu, Hanlin Zhu, Sijun Tan, Ajraf Mannan, Jonathan Michala, Raluca Ada Popa, and Willie Neiswanger. Auditing black-box llm apis with a rank-based uniformity test.arXiv preprint arXiv:2506.06975,
-
[2000]
It gives 0.541atn= 500, against the reference value0.586, and0.677atn= 2000, where the support- 36 Figure 9: The cross-engine TV depends strongly on the API top-ktruncation (n= 500; sampling and scoring use the same truncation). Askgrows from5to100the estimate falls from0.86to0.45: the support-mismatch component (gray; empiricalKL =∞) collapses from0.73to...
2000
-
[2001]
Mahoney, Yakun Sophia Shao, Kurt Keutzer, and Amir Gholami
[HKM+24] Coleman Hooper, Sehoon Kim, Hiva Mohammadzadeh, Michael W. Mahoney, Yakun Sophia Shao, Kurt Keutzer, and Amir Gholami. Kvquant: Towards 10 million context length LLM inference with KV cache quantization. InAdvances in Neural In- formation Processing Systems 38: Annual Conference on Neural Information Processing Systems 2024, NeurIPS 2024,
2024
-
[2014]
Tightsimulationofadistributionusingconditionalsamples.arXiv preprint arXiv:2506.18444,
[Ada25] TomerAdar. Tightsimulationofadistributionusingconditionalsamples.arXiv preprint arXiv:2506.18444,
-
[2015]
[CSZS25] Will Cai, Tianneng Shi, Xuandong Zhao, and Dawn Song. Are you getting what you pay for? auditing model substitution in llm apis.arXiv preprint arXiv:2504.04715,
-
[2020]
A short note on an inequality between kl and tv.arXiv preprint arXiv:2202.07198,
[Can22] Clément L Canonne. A short note on an inequality between kl and tv.arXiv preprint arXiv:2202.07198,
-
[2022]
Ran- dom restrictions of high dimensional distributions and uniformity testing with subcube conditioning
[CCK+21] Clément L Canonne, Xi Chen, Gautam Kamath, Amit Levi, and Erik Waingarten. Ran- dom restrictions of high dimensional distributions and uniformity testing with subcube conditioning. InProceedings of the 2021 ACM-SIAM Symposium on Discrete Algorithms (SODA), pages 321–336. SIAM,
2021
-
[2024]
Accu- racy is not all you need
[DKKR24] Abhinav Dutta, Sanjeev Krishnan, Nipun Kwatra, and Ramachandran Ramjee. Accu- racy is not all you need. InAdvances in Neural Information Processing Systems 38: Annual Conference on Neural Information Processing Systems 2024, NeurIPS 2024, Vancouver, BC, Canada, December 10 - 15, 2024,
2024
-
[2025]
[AFL24] Tomer Adar, Eldar Fischer, and Amit Levi. Improved bounds for high- dimensional equivalence and product testing using subcube queries.arXiv preprint arXiv:2408.02347,
-
[2026]
[AVC25] Afra Amini, Tim Vieira, and Ryan Cotterell
Accessed: 2026-05-04. [AVC25] Afra Amini, Tim Vieira, and Ryan Cotterell. Better estimation of the kullback–leibler divergence between language models.arXiv preprint arXiv:2504.10637,
arXiv 2026
discussion (0)
Sign in with ORCID, Apple, or X to comment. Anyone can read and Pith papers without signing in.