Abstract
Score matching is an alternative to maximum likelihood (ML) for estimating a probability distribution parametrized up to a constant of proportionality. By fitting the "score" of the distribution, it sidesteps the need to compute this constant of proportionality (the partition function), which is often intractable. While score matching and its variants are popular in practice, the precise theoretical benefits and tradeoffs compared to maximum likelihood—both computational and statistical—have remained poorly understood. In this work, we provide the first example of a natural exponential family of distributions where the score matching loss is computationally efficient to optimize and possesses statistical efficiency comparable to ML, while the ML loss is provably NP-hard to optimize using gradient-based methods. Our results demonstrate that score matching is not merely a heuristic shortcut but a fundamentally more tractable approach for specific energy-based models.
Introduction
Energy-based models (EBMs) represent probability distributions through an energy function $E_\theta(x)$, where the probability density is defined as $p(x; \theta) \propto \exp(-E_\theta(x))$. To ensure this density integrates to one, it must be divided by the partition function $Z_\theta = \int \exp(-E_\theta(x)) dx$. In high-dimensional spaces or for complex energy functions, calculating $Z_\theta$ is often computationally intractable.
Maximum Likelihood Estimation (MLE) is the standard statistical tool for parameter estimation, but it requires the gradient of the log-partition function, typically necessitating slow Markov Chain Monte Carlo (MCMC) sampling. Score Matching (SM) offers an alternative by fitting the "score"—the gradient of the log-density with respect to the input $x$. Because the derivative of $\log Z_\theta$ with respect to $x$ is zero, SM avoids the partition function entirely. This paper establishes a formal separation between these two methods, identifying settings where SM succeeds while MLE is computationally impossible.
The Exponential Family Framework
The authors focus on a specific exponential family of distributions on $\mathbb{R}^n$. The energy function is defined by polynomials of a fixed degree $d$ (specifically $d=7$ for the hardness results), with a base measure including a high-degree "tail" term $\exp(-\sum x_i^{d+1})$ to ensure the distribution remains well-behaved at infinity.
For this family, the score matching objective is particularly attractive: it is a quadratic function of the parameters $\theta$. This allows the optimal parameters to be found by solving a system of linear equations, a process that is inherently efficient and avoids the pitfalls of iterative gradient descent in non-convex landscapes.
Computational Hardness of Maximum Likelihood
The core contribution of this work is the proof that MLE is NP-hard for this natural family of distributions. The authors employ a reduction from the 3-SAT problem, constructing a polynomial whose "valleys" correspond to satisfying assignments of a logic formula. They prove that:
- Providing a zeroth-order (value) oracle for the MLE loss is NP-hard.
- Providing a first-order (gradient) oracle for the MLE loss is NP-hard.
Essentially, any gradient-based method attempting to optimize the MLE loss would be forced to solve an NP-hard problem, making MLE computationally intractable for this class of models.
Statistical Efficiency and Parity
A common critique of score matching is that it might be statistically inefficient, requiring significantly more samples than MLE to achieve the same level of accuracy. The authors address this by analyzing the Fisher Information Matrix and employing Poincaré inequalities to bound sample complexity.
They introduce a "restricted" Poincaré constant to relate the variance of functions linear in the sufficient statistics to the expected norm of their gradients. Their findings show that for the defined polynomial family, the statistical efficiency of SM is comparable to MLE. Specifically, for a dimension $n$ and parameter radius $B$, the error for both estimators scales polynomially:
$$\|\hat{\theta} - \theta^*\|^2 \leq O\left(\frac{(nB)^{poly(d)}}{N}\right)$$
where $N$ is the number of samples. This demonstrates that the computational "shortcut" provided by SM does not come at the cost of an exponential increase in required data.
Discussion and Insights
The separation between SM and MLE stems from a "Local vs. Global" tradeoff. MLE is a global objective; it must account for the total volume of the distribution to normalize it correctly. In contrast, score matching is a local objective, focusing only on the slope of the density at specific points. This locality is precisely what enables computational efficiency.
This work provides a continuous-space analogue to known results in discrete spaces (such as Ising models), where pseudolikelihood is often more tractable than MLE. By proving that SM is both computationally and statistically efficient in a setting where MLE fails computationally, the authors provide a rigorous theoretical foundation for the use of score-based methods in modern machine learning, including diffusion models and energy-based generative modeling.
Limitations and Future Work
While this paper marks a significant theoretical milestone, several avenues for future research remain. The hardness results are currently tied to a specific degree ($d=7$), and the exact polynomial dependencies in the sample complexity bounds could be further optimized. Furthermore, extending these provable guarantees to non-linear models, such as deep neural energy-based models, remains a major challenge for the field.
Summary updated