Abstract
We investigate the use of diffusion models as neural density estimators. The current approach to this problem involves converting the generative process to a smooth flow, known as the Probability Flow ODE. The log density at a given sample can be obtained by solving the ODE with a black-box solver. We introduce a new, highly parallelizable method that computes log densities without the need to solve a flow. Our approach is based on estimating a path integral by Monte Carlo, in a manner identical to the simulation-free training of diffusion models. We also study how different training parameters affect the accuracy of the density calculation, and offer insights into how these models can be made more scalable and efficient.
Introduction
Diffusion models have revolutionized generative AI, yet they face a significant hurdle when used as neural density estimators. Calculating the exact probability density of a data point typically requires solving a deterministic "Probability Flow ODE." This process is inherently sequential, computationally expensive due to Jacobian trace calculations, and suffers from variable runtimes that complicate batch processing. This paper introduces a "path integral" approach that bypasses these bottlenecks, offering a faster and more parallelizable alternative for density estimation.
The Path Integral Method
The proposed method replaces sequential ODE solvers with a Monte Carlo-based path integral. Much like the simulation-free training of diffusion models, this approach "jumps" to random instants in time using known Gaussian transition kernels.
A critical mathematical innovation is the use of an integration-by-parts trick. By shifting the gradient operator from the neural network onto the transition probability, the method eliminates the need for expensive Jacobian computations during evaluation. This makes the density calculation significantly more efficient and suitable for high-dimensional data.
The study also highlights the efficiency of Entropy Matching (EM). Unlike standard score matching, EM models learn the necessary information to transform the prior to the target distribution more directly. Interestingly, the research found that EM models can reach peak performance with very few training epochs and sometimes benefit from fewer time samples ("throws") during training, suggesting high information efficiency.
Experimental Results
The path integral estimator was tested on Gaussian Mixture Models (GMMs) in 3, 6, and 9 dimensions. By comparing estimated densities against ground truth, the study confirmed that the path integral approach achieves accuracy on par with standard ODE-based methods.
Beyond accuracy, the method demonstrates superior scalability and consistency. Because the path integral is a sum of independent samples, it can be fully vectorized on GPUs. Unlike adaptive ODE solvers, which vary in runtime depending on sample complexity, the path integral method provides consistent evaluation times, making it ideal for large-scale batch processing.
Conclusion
By breaking the ODE bottleneck, this path integral approach makes diffusion-based density estimation practical and efficient. The combination of simulation-free evaluation and the integration-by-parts trick allows for high-speed, parallelizable density calculations without sacrificing accuracy. Future work will explore scaling these techniques to high-dimensional real-world data and leveraging efficient density estimation for tasks such as zero-shot classification.
Summary updated