Total Variation Distance Estimation Is as Easy as Probabilistic Inference

Arnab Bhattacharyya, Sutanu Gayen, Kuldeep S. Meel, Dimitrios Myrisiotis, A. Pavan, N. V. Vinodchandran

TL;DR

This paper establishes an efficient, structure-preserving reduction from relative total variation (TV) distance estimation to probabilistic inference on Bayesian networks. As a result, the authors design the first Fully Polynomial-Time Randomized Approximation Scheme (FPRAS) for estimating the TV distance between Bayes nets with logarithmic treewidth—resolving an open question even for tree-structured models.

What Problem Does This Paper Address?

Total variation (TV) distance is a gold standard metric for measuring how distinct two probability distributions are. However, calculating the TV distance between high-dimensional distributions is computationally difficult: exact computation is $\#\text{P}$-complete even for simple product distributions. Furthermore, it is $\text{NP}$-hard to even determine whether the TV distance between two Bayes nets with in-degree 2 is zero.

Prior to this work, relative-error approximation algorithms (specifically, FPRAS) were known only for product distributions (graphs with no edges). The central question addressed here is: Can we efficiently estimate the TV distance between distributions over general graphical models whenever probabilistic inference is computationally tractable?

Methods

The paper's core technical contribution is a structure-preserving probabilistic reduction:

  1. Local Partial Couplings: While standard optimal couplings between two distributions $P$ and $Q$ do not preserve the underlying graph factorizations, the authors introduce a relaxed notion called a local partial coupling $\mathcal{L} = (X, Y)$. It forms a Bayes net over the exact same directed acyclic graph (DAG) $G$ (with an expanded alphabet of size $\ell^2$), guarantees that the marginal distribution of $X$ exactly matches $P$, and matches the conditional overlap $\min(P_{i \mid \Pi(i)}, Q_{i \mid \Pi(i)})$ at each node $i$, without requiring $Y$ to follow $Q$.
  2. Normalizing Constant & Importance Sampling: The normalization constant $Z = \Pr_{\mathcal{L}}[X \neq Y]$ satisfies the crucial bound $Z \le 2n \cdot d_{\text{TV}}(P, Q)$. The TV distance can then be expressed as $Z \cdot \mathbb{E}_{w \sim \pi}[f(w)]$, where $f(w) \in [0, 1]$ and $\pi$ is an auxiliary distribution.
  3. Inference Oracles: Using standard probabilistic inference queries over $\mathcal{L}$, the algorithm evaluates $Z$ and efficiently samples from $\pi$ symbol-by-symbol via chain rule conditioning.
  4. Monte Carlo Approximation: Because the expectation is lower bounded by $\Omega(1/n)$, taking $m = \widetilde{O}(n^2 \varepsilon^{-2})$ samples yields a $(1 + \varepsilon)$-relative approximation via Hoeffding's inequality.

Datasets

Not discussed in the paper. (This is a purely theoretical computer science and complexity theory paper; no empirical datasets or experimental benchmarks were used.)

Key Insights and Ideas

  • Couplings Need Not Be True Couplings: Strict optimal couplings destroy the independence structure of the graph. Relaxing the joint distribution to a partial coupling preserves the DAG structure while still tightly sandwiching the true TV distance within an $O(n)$ factor.
  • TV Distance Estimation $\le$ Probabilistic Inference: The reduction requires queries only to a Bayes net defined on the identical DAG $G$ (with alphabet size $\ell^2$). Any algorithmic advance in probabilistic inference directly transfers to TV distance estimation.
  • Uniform Distribution Contrast: When one distribution is uniform ($U$), exact TV distance computation remains $\#\text{P}$-complete (via a reduction from $\#\text{SAT}$), but admitting a relative approximation does not even require bounded treewidth: an FPRAS exists for any Bayes net compared against $U$.

Key Results

  • General Reduction (Theorem 1): Estimating $d_{\text{TV}}(P, Q)$ within $(1 \pm \varepsilon)$ with failure probability $\delta$ makes $O(n^3 \varepsilon^{-2} \ell \log \delta^{-1})$ probabilistic inference queries to a network over the same DAG with alphabet $\ell^2$.
  • FPRAS for Bounded Treewidth (Corollary 3): Combined with variable elimination, this yields an FPRAS running in time $\text{poly}(n) \cdot O(\varepsilon^{-2} \log \delta^{-1})$ for any two Bayes nets defined on the same DAG with treewidth $O(\log n)$ and alphabet size $O(1)$. This immediately resolves the open problem for trees (treewidth 1).
  • Distance to Uniformity (Theorems 4 & 5):
  • Exactly computing $d_{\text{TV}}(P, U)$ is $\#\text{P}$-complete even when $P$ has bounded in-degree.
  • Estimating $d_{\text{TV}}(P, U)$ admits an FPRAS running in time $O(n^3 \ell^{2d+2} \varepsilon^{-2} \log \delta^{-1})$ for arbitrary DAGs with maximum in-degree $d$.

Limitations and Future Work

  • Shared DAG Structure: The reduction currently requires both Bayes nets $P$ and $Q$ to share the same underlying DAG.
  • Logarithmic Treewidth Barrier: For general DAGs with unbounded treewidth, inference is generally intractable, and relative estimation remains hard in the worst case (consistent with the known $\text{NP}$-hardness of distinguishing $d_{\text{TV}} = 0$).
  • Undirected Models & Other Metrics: The authors highlight extending these ideas to undirected graphical models (Markov Random Fields) and alternative probability metrics (such as the Wasserstein distance) as open problems.

Summary updated

BibTeX
@inproceedings{bhattacharyya2024total,
  author = {Arnab Bhattacharyya and Sutanu Gayen and Kuldeep S. Meel and Dimitrios Myrisiotis and A. Pavan and N. V. Vinodchandran},
  title = {{Total Variation Distance Estimation Is as Easy as Probabilistic Inference}},
  booktitle = {International Conference on Machine Learning},
  year = {2024},
  url = {https://openreview.net/forum?id=6OSLjErBhh},
}
Figure