Maximum Entropy Inverse Reinforcement Learning of Diffusion Models with Energy-Based Models

Sangwoong Yoon, Himchan Hwang, Dohyun Kwon, Yung-Kyun Noh, Frank C. Park

TL;DR

This paper introduces DxMI (Diffusion by Maximum Entropy Inverse Reinforcement Learning), a framework that treats diffusion model training as an IRL problem where an Energy-Based Model (EBM) learns the reward function (data density). By incorporating a novel reinforcement learning subroutine called DxDP (Diffusion by Dynamic Programming), the authors significantly improve the sample quality of diffusion models in high-speed, low-step regimes (4–10 steps) and enable stable EBM training for anomaly detection without needing expensive MCMC sampling.

What Problem Does This Paper Address?

Diffusion models have become the gold standard for generative modeling, but they suffer from a major practical bottleneck: speed. Standard training (like DDPM) is essentially a form of behavioral cloning, where the model learns to mimic a predefined, fine-grained trajectory of 1,000+ steps.

When we try to speed things up by taking fewer steps during generation, a "distribution shift" occurs. The model finds itself in states it never saw during its long-trajectory training, leading to degraded sample quality. While distillation methods exist to compress these models, they are often capped by the performance of the original "teacher" model. The authors aim to move beyond simple mimicry by framing generative modeling through the lens of Inverse Reinforcement Learning (IRL).

Methods

The authors propose two interconnected algorithms:

  1. DxMI (Diffusion by Maximum Entropy IRL): This formulates generative modeling as a minimax game. A diffusion model ($\pi$) acts as the "policy" trying to maximize a reward, while an Energy-Based Model (EBM, $q$) acts as the "reward function" representing the log-density of the training data.
  2. The EBM is trained to assign high reward to real data and low reward to samples from the diffusion model.
  3. The diffusion model is trained to maximize this reward while also maximizing its own entropy. This entropy term is crucial; it encourages exploration and ensures the system reaches an equilibrium where both models match the true data distribution.
Figure 1: (Left) Overview of DxMI. The diffusion model π(x) is trained using the energy of q(x) as a reward. The EBM q(x) is trained using samples from π(x) as negative samples. (Right) ImageNet 64 generation examples from a 10-step diffusion model before DxMI fine-tuning (up) and after fine-tuning (down). Only the last six steps out of ten are shown.
  1. DxDP (Diffusion by Dynamic Programming): Updating a diffusion model using standard RL (like policy gradients) is notoriously difficult due to memory constraints and gradient instability when back-propagating through many time steps. DxDP solves this by:
  2. Transforming the RL objective into an optimal control problem.
  3. Using value functions and discrete-time dynamic programming (Bellman updates) to update the model locally at each step, eliminating the need to back-propagate through the entire generation chain.
  4. Introducing Adaptive Velocity Regularization (AVR), which automatically tunes the step-wise constraints to keep the training objective tight.

Datasets

The researchers evaluated their approach across several domains:

  • 2D Synthetic Data: An 8-Gaussian mixture to visualize density estimation and entropy effects.
  • Image Generation: Unconditional CIFAR-10 (32x32), conditional ImageNet (64x64), and unconditional LSUN Bedroom (256x256).
  • Anomaly Detection: The MVTec-AD dataset, consisting of high-resolution images of 15 object/texture categories for industrial inspection.

Key Insights and Ideas

  • Generative Modeling = Imitation Learning: The core "aha" moment is that if standard diffusion training is behavioral cloning, then improving it should look like IRL. Instead of just mimicking steps, the model learns the underlying "intent" (the data density).
  • Entropy is a Stabilizer: In DxMI, maximizing entropy isn't just a regularizer; it's what allows the minimax game to converge stably. Without it ($\tau=0$), the model behaves like a GAN, often suffering from limited exploration.
  • Value Functions > Backprop through Time: By using DxDP, the authors show that you can fine-tune a diffusion model much more efficiently. The value function captures the "future value" of a noisy image, guiding the denoising process more effectively than simple step-wise mimicry.
Figure 2: 2D density estimation on 8 Gaus- sians. Red shades indicate the energy (white is low), and the dots are generated samples.

Key Results

  • High-Quality Fast Sampling: On CIFAR-10 and ImageNet, DxMI-tuned models with only 4 or 10 steps achieved competitive (and sometimes superior) FID scores compared to full 1,000-step models and other state-of-the-art fast samplers. For example, on CIFAR-10, DxMI achieved an FID of 3.19 in 10 steps, surpassing the original DDPM's 1,000-step performance (3.21).
  • Superior Anomaly Detection: DxMI enables training EBMs without the need for computationally expensive MCMC sampling. When applied to the MVTec-AD benchmark, DxMI achieved an average anomaly detection AUC of 97.0%, outperforming specialized models like UniAD (96.5%).
  • Robustness: The method proved robust across different diffusion backbones, including DDPM, DDGAN, and EDM.

Limitations and Future Work

  • Complexity: DxMI requires training three separate networks simultaneously: the diffusion model, the EBM, and the value function. This introduces more hyperparameters and computational overhead during training (though not during inference).
  • Step Count Rigidity: Currently, a model fine-tuned for $T$ steps is fixed to that $T$ at test time; it doesn't offer the flexibility to change step counts dynamically after training.
  • Single-Step Generation: DxMI is designed for multi-step iterative refinement and isn't directly applicable to single-step "one-shot" generation, though the authors suggest DxMI models could be further distilled for that purpose.

Future research directions include establishing stronger theoretical convergence guarantees for the non-linear reward settings used in DxMI and exploring unified methods for selecting the entropy regularization parameters.

Summary updated

Abstract

We present a maximum entropy inverse reinforcement learning (IRL) approach for improving the sample quality of diffusion generative models, especially when the number of generation time steps is small. Similar to how IRL trains a policy based on the reward function learned from expert demonstrations, we train (or fine-tune) a diffusion model using the log probability density estimated from training data. Since we employ an energy-based model (EBM) to represent the log density, our approach boils down to the joint training of a diffusion model and an EBM. Our IRL formulation, named Diffusion by Maximum Entropy IRL (DxMI), is a minimax problem that reaches equilibrium when both models converge to the data distribution. The entropy maximization plays a key role in DxMI, facilitating the exploration of the diffusion model and ensuring the convergence of the EBM. We also propose Diffusion by Dynamic Programming (DxDP), a novel reinforcement learning algorithm for diffusion models, as a subroutine in DxMI. DxDP makes the diffusion model update in DxMI efficient by transforming the original problem into an optimal control formulation where value functions replace back-propagation in time. Our empirical studies show that diffusion models fine-tuned using DxMI can generate high-quality samples in as few as 4 and 10 steps. Additionally, DxMI enables the training of an EBM without MCMC, stabilizing EBM training dynamics and enhancing anomaly detection performance.
BibTeX
@inproceedings{yoon2024maximum,
  author = {Sangwoong Yoon and Himchan Hwang and Dohyun Kwon and Yung-Kyun Noh and Frank C. Park},
  title = {{Maximum Entropy Inverse Reinforcement Learning of Diffusion Models with Energy-Based Models}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2024},
  url = {https://openreview.net/forum?id=V0oJaLqY4E},
}
Figure