Abstract
Diffusion models may be formulated as a time-indexed sequence of energy-based models, where the score corresponds to the negative gradient of an energy function. As opposed to learning the score directly, an energy parameterization is attractive as the energy itself can be used to control generation via Monte Carlo samplers. Architectural constraints and training instability in energy parameterized models have so far yielded inferior performance compared to directly approximating the score or denoiser. We address these deficiencies by introducing a novel training regime for the energy function through distillation of pre-trained diffusion models, resembling a Helmholtz decomposition of the score vector field. We further showcase the synergies between energy and score by casting the diffusion sampling procedure as a Feynman Kac Model where sampling is controlled using potentials from the learnt energy functions. The Feynman Kac model formalism enables composition and low temperature sampling through sequential Monte Carlo.
Introduction
Standard diffusion models are primarily score-based, learning to estimate the gradient of a data distribution. While highly effective for high-fidelity generation, this approach complicates complex operations like attribute composition (e.g., combining "smiling" and "wearing glasses"). Energy-Based Models (EBMs), where the score is the negative gradient of an energy function, offer a more mathematically elegant framework for such compositions. However, EBMs are notoriously difficult to train. Previous attempts at Energy-parameterized Denoising Score Matching (E-DSM) suffered from extreme training instability and lower image quality. This work bridges that gap, providing a stable distillation-based training regime and a Sequential Monte Carlo (SMC) sampling framework for fine-grained control.
Methodology
Conservative Distillation Loss
To overcome the instability of training energy functions from scratch, the authors propose a "conservative distillation" loss. Instead of using noisy data directly, they distill a pre-trained, high-quality score model (the "teacher") into a new energy-based student model. This process acts as a conservative projection, forcing the student to find the energy function whose gradient best matches the teacher's score field. This is essentially a Helmholtz decomposition that strips away rotational components to isolate the underlying potential.
As shown in Figure 1, this distillation approach avoids the extreme loss spikes characteristic of E-DSM, leading to significantly more stable convergence. Furthermore, the resulting score field is highly conservative, as evidenced by the vanishing asymmetry metric across the diffusion trajectory.
Feynman-Kac / SMC Sampling
The diffusion sampling process is reframed as a Feynman-Kac model. By utilizing Sequential Monte Carlo (SMC)—a particle-filtering technique—the generation process can be guided using the learned energy functions as "potentials." This allows for "AND" compositions (multiplying densities) and "low-temperature" sampling (sharpening the distribution) by re-weighting and resampling particles at each step, without requiring model re-training.
Key Results and Insights
- State-of-the-Art Energy Performance: On CIFAR-10, the distillation method achieved an FID of 3.01, significantly outperforming the previous best energy-based diffusion model (E-DSM at 6.17) and approaching the teacher model's performance (2.21).
- Initialization and Convergence: Initializing the student with the teacher's weights led to drastically faster convergence, reaching high-quality results in roughly 30,000 iterations.
- Improved Attribute Adherence: Low-temperature SMC sampling improved adherence to complex prompts. For the prompt "Man with make-up," the CLIP adherence score increased from 0.35 to 0.40 compared to the base model.
- Compositional Power: In the energy domain, composing independent attributes is simplified to the addition of their energy functions. The SMC-based approach accurately recovers joint distributions where standard reverse diffusion often fails.
Discussion and Limitations
While this method provides a robust path for energy-based diffusion, it remains a distillation technique dependent on high-quality pre-trained score models. Additionally, while SMC improves fidelity through resampling, it can lead to "weight degeneracy," potentially reducing sample diversity if potentials are overly aggressive. Future work includes scaling these techniques to high-resolution latent diffusion models and addressing "score blindness" in distributions with isolated components.
Summary updated