Total Variation Distance Estimation in Autoregressive Models
arXiv:2607.19510
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- autoregressive distributions to additive error , under three access models. (1) Under sample access, we use queries, where is the maximum support of the next-token distribution. This improves upon the -query estimator of Meel et al. (2025), where is the total size of the token alphabet. (2) Under logit access, we use 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 , we use 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.
39 pages, 11 figures, code is available at https://github.com/XunZhiyang/llm-tv-estimation