Efficiently Access Diffusion Fisher: Within the Outer Product Span Space

Fangyikang Wang, Hubery Yin, Shaobin Zhuang, Huminhao Zhu, Yinan Li, Lei Qian, Chao Zhang, Hanbin Zhao, Hui Qian, Chen Li

Abstract

Diffusion Models (DMs) have revolutionized generative modeling by utilizing first-order score information to navigate data distributions. However, many advanced applications—including likelihood evaluation and adjoint optimization—require second-order information, specifically the Hessian of the log-density, known as the Diffusion Fisher (DF). Traditionally, accessing the DF has been computationally prohibitive due to the quadratic complexity of automatic differentiation. This paper demonstrates that the Diffusion Fisher is not an arbitrary matrix but resides within a specific space spanned by the outer products of data samples. Leveraging this structural insight, we propose two algorithms: DF-TM (Trace Matching) and DF-EA (Endpoint Approximation). These methods reduce computational complexity to linear time, achieving up to a 30,000x speedup in trace evaluation and enabling superior performance in guided sampling and likelihood estimation.

Introduction

In the current landscape of generative AI, Diffusion Models operate primarily through "first-order" gradients or scores. While effective for sampling, this approach ignores the rich structural information contained in the Hessian. The Diffusion Fisher (DF) is essential for tasks such as calculating the exact Negative Log-Likelihood (NLL) of a sample or performing fine-grained "adjoint optimization" for controlled generation.

The primary barrier to utilizing the DF is the computational cost. For high-dimensional models like Stable Diffusion, calculating the trace of the Hessian using standard Vector-Jacobian Products (VJPs) can take nearly thirty minutes for a single sample. Furthermore, these black-box approximations often lack the accuracy required for precise downstream tasks. This research addresses these bottlenecks by uncovering the underlying geometry of the Diffusion Fisher.

The Geometry of the Diffusion Fisher

The central theoretical breakthrough of this work is the proof that the Diffusion Fisher can be expressed as a weighted sum of outer products of the initial data samples and the noise schedule. This "Outer Product Span" insight reveals that the Hessian is fundamentally constrained by the training data's distribution rather than being a random artifact of the neural network's architecture.

By identifying this structure, the researchers move away from treating the model as a black box. Instead, they exploit the mathematical relationship between the score function and the data manifold to simplify second-order operations.

Proposed Methodologies

Based on the Outer Product Span theory, the authors introduce two distinct approaches for accessing second-order information efficiently:

1. DF-TM (Trace Matching)

To evaluate the trace of the Hessian—a requirement for likelihood calculation—the authors propose training a small, scalar-valued helper network ($t_\theta$). This network is designed to estimate the weighted norm of the data. By shifting the problem from a quadratic-time Hessian calculation to a linear-time scalar estimation, DF-TM allows for near-instantaneous trace evaluation.

2. DF-EA (Endpoint Approximation)

For tasks requiring matrix-vector multiplication, such as adjoint guidance, the authors introduce a training-free approximation. They observe that as the timestep $t$ approaches zero, the summation in the Diffusion Fisher is dominated by the closest data sample ($x_0$). By replacing the complex sum with a single outer product of the endpoint sample, the mathematical operations are drastically simplified without requiring additional training.

Experimental Results

Performance and Speed

The proposed methods were validated using Stable Diffusion 1.5 and SD-2-base, trained on the Laion2B-en dataset. The results demonstrate a "complexity collapse":

  • Trace Evaluation Speed: In practical tests on Stable Diffusion, the time required for a single iteration dropped from 2195 seconds to 0.072 seconds, representing a ~30,000x speedup.
  • Accuracy: DF-TM achieved a relative error of only 5.81% in NLL evaluation at low noise levels, compared to a staggering 70.95% error for traditional VJP methods.

Optimal Transport Verification

The paper utilizes these efficient tools to conduct the first numerical experiment testing whether the "Probability Flow ODE" (the deterministic path of a DM) constitutes an optimal transport (OT) map. The findings settle a theoretical debate: while the path is optimal for Gaussian or affine data, it fails to maintain optimality for general non-affine data distributions.

Guided Sampling

In adjoint guidance tasks—such as optimizing for FaceID similarity or aesthetic scores—DF-EA consistently outperformed VJP baselines. The resulting images exhibited higher visual realism and significantly fewer artifacts, proving that accurate second-order information is vital for high-fidelity controlled generation.

Conclusion and Future Work

By uncovering the Outer Product Span of the Diffusion Fisher, this research transforms second-order information from a computational liability into a practical tool. While the current formulation faces challenges at the $t=0$ singularity where noise variance vanishes, the speed and accuracy gains are transformative for the field. Future research may extend these geometric insights to other generative frameworks, such as Flow-Matching or Variational Inference, potentially uncovering similar second-order efficiencies across the broader spectrum of AI models.

Summary updated

BibTeX
@inproceedings{wang2025efficiently,
  author = {Fangyikang Wang and Hubery Yin and Shaobin Zhuang and Huminhao Zhu and Yinan Li and Lei Qian and Chao Zhang and Hanbin Zhao and Hui Qian and Chen Li},
  title = {{Efficiently Access Diffusion Fisher: Within the Outer Product Span Space}},
  booktitle = {International Conference on Machine Learning},
  year = {2025},
  url = {https://openreview.net/forum?id=b3xzkfd0G1},
}
Figure