[Paper Review] Learning Implicit Generative Models Using Differentiable Graph Tests
This paper proposes differentiable versions of classical two-sample graph tests—Friedman-Rafsky and k-nearest neighbor—by smoothing their combinatorial statistics using undirected graphical models and the matrix tree theorem. The resulting smoothed tests are differentiable, asymptotically normal, and significantly outperform classical versions in power, enabling effective training of implicit generative models via stochastic optimization with improved sample quality.
Recently, there has been a growing interest in the problem of learning rich implicit models - those from which we can sample, but can not evaluate their density. These models apply some parametric function, such as a deep network, to a base measure, and are learned end-to-end using stochastic optimization. One strategy of devising a loss function is through the statistics of two sample tests - if we can fool a statistical test, the learned distribution should be a good model of the true data. However, not all tests can easily fit into this framework, as they might not be differentiable with respect to the data points, and hence with respect to the parameters of the implicit model. Motivated by this problem, in this paper we show how two such classical tests, the Friedman-Rafsky and k-nearest neighbour tests, can be effectively smoothed using ideas from undirected graphical models - the matrix tree theorem and cardinality potentials. Moreover, as we show experimentally, smoothing can significantly increase the power of the test, which might of of independent interest. Finally, we apply our method to learn implicit models.
Motivation & Objective
- To address the challenge of training implicit generative models where density evaluation is infeasible, by enabling gradient-based optimization.
- To make non-differentiable two-sample tests—Friedman-Rafsky and k-NN—compatible with stochastic optimization through differentiable smoothing.
- To improve the statistical power of classical graph-based two-sample tests via smoothing, enhancing their utility in model training.
- To demonstrate that smoothed tests yield better sample quality in generative modeling tasks, such as on MNIST and toy distributions.
Proposed method
- Smooth the combinatorial statistics of the Friedman-Rafsky and k-NN tests using cardinality potentials and the matrix tree theorem from undirected graphical models.
- Construct a differentiable approximation of the test statistic by integrating over spanning trees with temperature-controlled soft-max smoothing.
- Derive a t-statistic for the smoothed test that is asymptotically normal under mild conditions, enabling reliable inference.
- Use the smoothed t-statistic as a differentiable loss function to optimize the parameters of a deep generative model via stochastic gradient descent (e.g., Adam).
- Apply the method to train implicit models by maximizing the expected smoothed test statistic over generated and real data samples.
- Use permutation tests to estimate p-values and validate the normality of the null distribution under smoothing.
Experimental results
Research questions
- RQ1Can non-differentiable two-sample graph tests be made compatible with end-to-end training of implicit generative models?
- RQ2Does smoothing the test statistics using undirected graphical models improve the statistical power of classical graph-based tests?
- RQ3Can the smoothed test statistics be made differentiable while preserving their asymptotic normality and consistency?
- RQ4How does the performance of the smoothed tests compare to MMD and classical tests in terms of test power and generative model quality?
- RQ5What is the impact of the smoothing parameter λ on model convergence and sample quality?
Key findings
- The smoothed Friedman-Rafsky and k-NN tests significantly outperform their classical counterparts in statistical power, especially on scale alternatives in high-dimensional settings.
- As λ decreases, the null distribution of the smoothed test statistic becomes closer to normal, validating the t-statistic approximation and improving optimization stability.
- On the two-moons dataset, decreasing λ leads to better-structured, more symmetric, and better-separated generated samples that closely match the true data distribution.
- On MNIST, the learned models generate realistic digits comparable in quality to those trained with MMD, despite using raw pixel distances and no architectural modifications.
- The smoothed tests achieve higher power than MMD on scale-shift alternatives, demonstrating their advantage in detecting subtle distributional differences.
- The method enables effective training of implicit models using gradient-based optimization, with the loss function being differentiable and amenable to standard deep learning frameworks.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.