TL;DR
This paper introduces DistEstimate, the first algorithm capable of estimating the Total Variation (TV) distance between two high-dimensional discrete distributions using a polynomial number of queries. By leveraging a practical conditional sampling model (SUBCOND), it bypasses the well-known exponential sample requirements of standard sampling models, delivering up to a $10^7\times$ query reduction on 70-dimensional problems.
What Problem Does This Paper Address?
Evaluating how close two high-dimensional discrete probability distributions are to one another—measured via Total Variation (TV) distance—is a foundational task in computer science. It is critical for verifying MCMC algorithms, probabilistic programs, and modern generative models (like LLMs).
However, doing this exactly is #P-hard, even for simple product distributions. If you only have standard sample access to the distributions, calculating this distance requires an exponential number of samples ($\Omega(2^n/n)$), making it completely impractical when the number of dimensions ($n$) grows.
To bypass this exponential barrier, researchers have turned to conditional sampling models (COND), where you can request samples from a specific conditional subset of the domain. Unfortunately, conditioning on arbitrary subsets is computationally unrealistic. This paper addresses this gap by using a weaker, highly practical oracle called Subcube Conditional Sampling (SUBCOND), which only conditions on fixing a subset of individual variables (e.g., "sample a token given that the first three tokens are fixed").
Methods
The authors present DistEstimate, an algorithm that achieves a query complexity of $\tilde{\mathcal{O}}(n^3/\varepsilon^5)$ using the SUBCOND oracle.
The core algorithmic challenge in high dimensions is that estimating probabilities via the chain rule can cause query complexity to explode if any conditional marginal probability is close to zero. To solve this, the authors introduce $\theta$-tamed distributions. These are modified versions of the original distributions where marginal probabilities are bounded away from zero, yet the overall TV distance remains provably close to the original distribution.
The heavy lifting is done by a subroutine called SubToEval. Instead of standard sampling (fixing the number of trials and counting successes), SubToEval uses a variance reduction technique based on the Negative Binomial distribution (fixing the number of target successes and counting how many queries it takes to get there). By multiplying these inverted marginal estimates together via the chain rule, the algorithm accurately approximates the total variation distance without getting stuck in low-probability regions.
Datasets
The authors implemented DistEstimate in Python and evaluated it against distributions generated by two state-of-the-art combinatorial samplers: STS and CMSGen. They utilized two datasets:
- Scalable Benchmarks: Synthetic random Boolean functions where the number of dimensions ($n$) was scaled from 30 up to 70.
- Real-World Benchmarks: 6 distinct instances from the ISCAS89 dataset, a standard benchmark suite used in combinatorial testing and hardware verification, with dimensions ranging from $n=33$ to $n=37$.
Key Insights and Ideas
- Taming the Tail: The key "aha moment" is that you don't need to query the exact distribution to estimate distance. By constructing a "tamed sibling" distribution that clips extremely low-probability marginals, you can bound the query complexity to a polynomial function while keeping the approximation error tightly controlled.
- Flipping the Sampling Perspective: Moving from a Binomial to a Negative Binomial sampling strategy in
SubToEvalprovides an elegant way to handle variance reduction, ensuring the algorithm terminates efficiently even when dealing with complex conditional structures. - Alignment with Modern AI: Because
SUBCONDnaturally models autoregressive generation (predicting the next token/pixel given previous ones), this theoretical framework is uniquely positioned to evaluate state-of-the-art LLMs and image generation models.
Key Results
- Massive Query Reductions: For a 70-dimensional space ($n=70$),
DistEstimateoutperformed the baseline sample-based estimator by a factor greater than $10^7$. Where a standard sampler would require an impossible $\approx 10^{18}$ queries,DistEstimatesuccessfully ran within a practical bound.
- Real-World Execution: The algorithm successfully completed execution on all real-world ISCAS89 benchmarks up to 37 dimensions within a 24-hour timeout window, providing high-quality distance estimates verified against ground truths.
Limitations and Future Work
- The Complexity Gap: A theoretical gap remains between
DistEstimate's upper bound query complexity of $\tilde{\mathcal{O}}(n^3/\varepsilon^5)$ and the known lower bound of $\Omega(n/\log n)$. Closing this gap is an open problem for all conditional sampling models. - Alphabet Scaling: While the paper shows how to extend the algorithm from binary domains ($\{0,1\}^n$) to discrete hypergrids ($\Sigma^n$), the query complexity scales linearly with the alphabet size ($|\Sigma|$). For applications like LLMs with massive vocabularies (where $|\Sigma| \approx 32,000+$), this linear dependence could still prove computationally expensive.
Summary updated