Total Variation Distance Estimation Is as Easy as Probabilistic Inference

Arnab Bhattacharyya, Sutanu Gayen, Kuldeep S. Meel, Dimitrios Myrisiotis, N. V. Vinodchandran · DOI

Abstract

Measuring the distance between high-dimensional probability distributions is a fundamental task in statistics and machine learning. While Total Variation (TV) distance is a standard metric, its exact computation is #P-complete for most graphical models. This paper establishes a novel "structure-preserving" reduction that transforms TV distance estimation into the more manageable task of probabilistic inference. By leveraging "partial couplings," the authors provide the first Fully Polynomial-Time Randomized Approximation Scheme (FPRAS) for Bayesian networks with small treewidth, bridging a significant gap in computational complexity theory.

1. Introduction

In many applications—from genetic modeling to causal inference—we represent complex dependencies using Bayesian networks. A critical question arises when comparing two such models, $P$ and $Q$: how different are they? The Total Variation (TV) distance provides a robust answer, representing the maximum difference in probability assigned to any event. However, calculating this distance has remained a significant computational bottleneck.

Historically, efficient approximation algorithms (FPRAS) for TV distance were restricted to product distributions, where variables are independent. For structured models where variables interact, the problem was thought to be significantly harder. This paper, presented at ICML 2024, demonstrates that TV distance estimation is not fundamentally more difficult than standard probabilistic inference, provided one uses the right reduction techniques.

2. The Complexity of Distance Estimation

The exact computation of TV distance is #P-complete, even for relatively simple models. This hardness persists even when comparing a structured Bayesian network to a simple uniform distribution. Consequently, researchers have focused on finding approximation schemes.

The primary challenge in approximating TV distance for graphical models is that traditional methods often destroy the underlying structure of the graph. A reduction might transform a simple tree into a dense, computationally intractable graph, rendering the "approximation" useless in practice.

3. Methodology: Partial Couplings and Structure Preservation

The authors' primary contribution is a "structure-preserving" reduction. This is achieved through two main technical innovations:

3.1 Partial Couplings

In probability theory, a coupling is a joint distribution that allows two variables to be compared directly. While "optimal couplings" (which achieve the TV distance) are difficult to compute for complex graphs, the authors introduce partial couplings. These are joint distributions that are computationally efficient to construct and, crucially, maintain the dependency structure of the original Bayesian networks.

3.2 Importance Sampling

Using the partial coupling, the authors construct an estimator for the TV distance. By applying importance sampling to this estimator, they can achieve a relative error approximation ($\epsilon$). The process relies on an "inference oracle"—a black-box algorithm capable of answering queries like $\Pr[X \in S]$ on the graph.

4. Key Results

The paper provides several landmark results that redefine the boundaries of what is computable in graphical models:

  • General Reduction (Theorem 1.1): The authors prove that if an efficient algorithm exists for probabilistic inference on a specific graph structure, an FPRAS exists for estimating the TV distance between two distributions on that same structure.
  • Small Treewidth (Theorem 1.2): The paper establishes the first FPRAS for Bayesian networks with $O(\log n)$ treewidth. This effectively solves the long-standing open problem of whether TV distance can be efficiently estimated for tree-structured models (treewidth 1).
  • Efficiency: For a graph with $n$ nodes and alphabet size $\ell$, the algorithm for small treewidth operates in $O(n^3 \epsilon^{-2} \ell \log \delta^{-1})$ time.
  • Hardness of Exact Calculation: The authors confirm that exactly calculating the distance between a Bayesian network and a uniform distribution remains #P-complete, reinforcing the necessity of their approximation approach.

5. Discussion and Limitations

While this work represents a major leap forward, it identifies several avenues for future research. Currently, the reduction requires $P$ and $Q$ to share the same Directed Acyclic Graph (DAG) structure. This is suitable for parameter learning scenarios but does not yet address cases where the causal structures themselves differ.

Furthermore, the current framework is specifically designed for directed models (Bayesian networks). Extending these "structure-preserving" results to undirected models, such as Markov Random Fields, remains an open challenge. Finally, the authors suggest that similar reductions might be possible for other metrics, such as Wasserstein distance or KL divergence.

6. Conclusion

By showing that "inference is enough," this paper simplifies a complex problem in computational statistics. It provides a theoretical bridge between two previously distinct tasks, ensuring that as our ability to perform inference on complex models grows, so too does our ability to measure the distance between them.

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