TV Distance Computation

TV: Total Variation

Latest papers

8 papers3 papers in the last four weeks, against 1 the four weeks before. 0.0% of all new papers.

Oct 14, 2026

Hypothesis Selection via Weighted Medians

Given nn distributions (hypotheses) H={H1,…,Hn}\mathcal H=\{H_1,\ldots,H_n\} and samples from an unknown target distribution PP, proper hypothesis selection seeks a distribution whose total variation distance to PP is close to the best achievable within the known distributions. We give an algorithm that, using O(ε−2log⁡(n/δ))O(\varepsilon^{-2}\log(n/δ)) target samples, running in O(nε−2log⁡(n/δ))O(n\varepsilon^{-2}\log(n/δ)) time, with probability at least 1−δ1-δ, returns Hi^H_{\hat i} satisfying dTV(P,Hi^)≤3min⁡i∈[n]dTV(P,Hi)+ε.d_\mathrm{TV}(P,H_{\hat i})\leq 3\min_{i\in[n]}d_\mathrm{TV}(P,H_i)+\varepsilon. The algorithm achieves the optimal approximation factor and sample complexity. The running time improves the dependence on the failure probability from polynomial to logarithmic in the state-of-the-art bound O~(nε−2δ−1)\tilde{O}(n\varepsilon^{-2}δ^{-1}) of Aamand, Aliakbarpour, Chen, and Silwal (COLT 2026), thereby answering their Question~2.
Oct 12, 2026

Optimal Transport PAC-Bayes Bounds

PAC-Bayesian generalization bounds are among the strongest distribution-dependent guarantees in statistical learning and are typically expressed in terms of the Kullback-Leibler (KL) divergence between a prior and posterior distribution. While analytically convenient, the KL divergence requires the posterior to be absolutely continuous w.r.t. the prior, imposing support constraints that can substantially restrict the choice of posterior. Moreover, the KL divergence does not account for the underlying geometry of the probability space. In this work, we derive new PAC-Bayesian bounds replacing the KL divergence with general optimal transport (OT) distances, including the total variation and Wasserstein-pp distances.
Sep 30, 2026

How Divergence Becomes Decision Flips in Compressed Language Models

Compression reports summarize how far a compressed language model moved from the dense one, usually by a KL divergence; a deployment that relies on the dense model's outputs needs to know how many of its decisions changed. We show that total variation, not KL, answers this directly. Across 802 compressed and perturbed copies of 19 open models on five corpora and nine mechanically unrelated perturbation families, the rate at which the arg-max token changes (the flip rate) tracks total variation at a ratio with median 1.051.05, with no fitted constant. KL converts into flips only through its square root and a factor that varies fourfold across models and corpora, because KL averages over tokens before the root is taken; first-order statistics averaged per token, such as Hellinger distance, avoid this, but reports rarely give them. As a result, of two compressors reported on different models and corpora whose flip rates differ by at least 1010%, KL assigns the smaller divergence to the one that changes more decisions in 1111% of cases, total variation in 11%. Two pre-registered tests mark the limits: on a held-out code corpus the ratio held for all eight models while three predictions about KL each failed for half of them or more, and on three new models with real kernels it stayed in its band for 37 of 38 checkpoints but fell below one on code for two models. In vLLM speculative decoding, total variation measured under teacher forcing predicts greedy draft acceptance with a mean relative error of 1.11.1--2.42.4%, without the task-specific calibration that KL needs.
Sep 15, 2026

Divergence Timing and Cumulative Disagreement under KV-Cache Eviction

KV-cache eviction perturbs the conditional token distributions governing autoregressive generation. We investigate how first-divergence timing and subsequent token mismatch determine cumulative disagreement. We derive an exact decomposition under a specified stepwise maximal coupling: the expected mismatch fraction equals a first-mismatch contribution plus post-divergence exposure multiplied by its mismatch rate. An explicit construction over unrestricted autoregressive kernel pairs realizes the sharp interval of risks compatible with a finite divergence-aligned observation window. Residual-branch conditional Monte Carlo provides unbiased joint estimates of occurrence, occupation, and window/tail contributions, with per-replicate variance dominance for total token loss. Complete trajectories from Meta-Llama-3.1-8B-Instruct and Qwen2.5-7B-Instruct show that SnapKV at 50% retention enters divergence later and less often than SnapKV-512 or recent-token retention with the same 50% prompt-cache budget, while post-divergence total variation (TV) remains high. In an exploratory analysis of 288 documents, post-divergence exposure accounts for 85-90% of four aggregate mismatch gaps. On 288 independent documents at 90% retention, prespecified comparisons show higher branch-aligned TV in the late than in the early window in both models.
Jul 21, 2026

Total Variation Distance Estimation in Autoregressive Models

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-nn autoregressive distributions to additive error ε\varepsilon, under three access models. (1) Under sample access, we use O~(n2K/ε2)\widetilde{O}(n^2 K/\varepsilon^2) queries, where KK is the maximum support of the next-token distribution. This improves upon the O~(n3m/ε5)\widetilde{O}(n^3 m/\varepsilon^5)-query estimator of Meel et al. (2025), where m≥Km \geq K is the total size of the token alphabet. (2) Under logit access, we use O(n/ε2)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 σσ, we use O~((n+n2σ2)/ε2)\widetilde{O}((n+n^2σ^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.
May 5, 2026

On Computing Total Variation Distance Between Mixtures of Product Distributions

We study the problem of approximating the total variation distance between two mixtures of product distributions over an nn-dimensional discrete domain. Given two mixtures P\mathbb{P} and Q\mathbb{Q} with k1k_1 and k2k_2 product distributions over [q]n[q]^n, respectively, we give a randomized algorithm that approximates dTV(P,Q)d_{\mathrm{TV}}\left({\mathbb{P}},{\mathbb{Q}}\right) within a multiplicative error of (1±ε)(1\pm \varepsilon) in time poly((nq)k1+k2,1/ε)\mathrm{poly}((nq)^{k_1+k_2},1/\varepsilon). We also study the special case of mixtures of Boolean subcubes over {0,1}n\{0,1\}^n. For this class, we give a deterministic algorithm that exactly computes the total variation distance in time poly(n,2O(k1+k2))\mathrm{poly}(n,2^{O(k_1+k_2)}), and show that exact computation is #P\#\mathsf{P}-hard when k1+k2=Θ(n)k_1+k_2=Θ(n).
Oct 29, 2025

Revisiting GAN with Bayes-Optimal Discrimination

We approach generative adversarial network (GAN) training from its original real-versus-fake classification viewpoint, replacing the cross-entropy discriminator objective with an upper bound on the Bayes error rate (BER). Using the Bayes optimal learning threshold (BOLT) loss, we formulate an adversarial game in which the discriminator tightens this bound and the generator maximizes it. We characterize the unrestricted optimal discriminator and show that, under balanced class priors, the population game is equivalent to minimizing total variation between the data and generator distributions. Restricting the bounded discriminator to be 1-Lipschitz yields BOLT-GAN. For balanced priors and the full discriminator class, we establish upper and lower bounds relating its population discrepancy to Wasserstein-1 distance on bounded domains. Controlled experiments on four image-generation benchmarks show improved sample quality and coverage over WGAN-GP under matched architectures, optimization settings, and gradient penalties. At a common 20-epoch budget, BOLT-GAN reduces Fréchet Inception Distance (FID) from 60.0 to 44.2 on CIFAR-10 and from 102.5 to 28.4 on LSUN Bedroom-64.
Mar 10, 2025

Sublinear Algorithms for Wasserstein and Total Variation Distances: Applications to Fairness and Privacy Auditing

Resource-efficiently computing representations of probability distributions and the distances between them while only having access to the samples is a fundamental and useful problem across mathematical sciences. In this paper, we propose a generic framework to learn the probability and cumulative distribution functions (PDFs and CDFs) of a sub-Weibull, i.e. almost any light- or heavy-tailed, distribution while the samples from it arrive in a stream. The idea is to reduce these problems into estimating the frequency of an appropriately chosen subset of the support of a properly discretised distribution. We leverage this reduction to compute mergeable summaries of distributions from the stream of samples while requiring only sublinear space relative to the number of observed samples. This allows us to estimate Wasserstein and Total Variation (TV) distances between any two distributions while samples arrive in streams and from multiple sources. Our algorithms significantly improves on the existing methods for distance estimation incurring super-linear time and linear space complexities, and further extend the mergeable summaries framework to continuous distributions with possibly infinite support. Our results are tight with respect to the existing lower bounds for bounded discrete distributions. In addition, we leverage our proposed estimators of Wasserstein and TV distances to tightly audit the fairness and privacy of algorithms. We empirically demonstrate the efficiency of proposed algorithms across synthetic and real-world datasets.