Diffusing States and Matching Scores: A New Framework for Imitation Learning

Runzhe Wu, Yiding Chen, Gokul Swamy, Kianté Brantley, Wen Sun · OpenReview

Abstract

Adversarial Imitation Learning is traditionally framed as a two-player zero-sum game between a learner and an adversarially chosen cost function, and can therefore be thought of as the sequential generalization of a Generative Adversarial Network (GAN). A prominent example of this framework is Generative Adversarial Imitation Learning (GAIL). However, in recent years, diffusion models have emerged as a non-adversarial alternative to GANs that merely require training a score function via regression, yet produce generations of a higher quality. In response, we investigate how to lift insights from diffusion modeling to the sequential setting. We propose diffusing states and performing score-matching along diffused states to measure the discrepancy between the expert's and learner's states. Thus, our approach only requires training score functions to predict noises via standard regression, making it significantly easier and more stable to train than adversarial methods. Theoretically, we prove first- and second-order instance-dependent bounds with linear scaling in the horizon, proving that our approach avoids the compounding errors that stymie offline approaches to imitation learning. Empirically, we show our approach outperforms GAN-style imitation learning baselines across various continuous control problems, including complex tasks like controlling humanoids to walk, sit, and crawl.

Introduction

Imitation Learning (IL) aims to train an agent to mimic an expert's behavior. Historically, this has been approached in two ways: Behavioral Cloning (BC) and Adversarial Imitation Learning (AIL). BC is a simple supervised learning approach that often fails because small errors lead the agent into unfamiliar states—a phenomenon known as compounding errors. AIL methods like GAIL frame IL as a two-player game where a discriminator tries to distinguish expert data from learner data. While powerful, these are essentially GANs for sequences; they are notoriously unstable, prone to mode collapse, and difficult to tune.

This paper introduces SMILING (Score-Matching Imitation LearnING), a framework that moves imitation learning away from unstable adversarial training toward the stable, regression-based world of diffusion models.

The SMILING Framework

The core innovation of SMILING is replacing the adversarial discriminator with a score-matching objective. Instead of a classifier, the authors define the Diffusion Score Divergence (DS Divergence), which measures the squared difference between the "scores" (the gradient of the log-probability) of the expert’s and the learner’s state distributions.

The SMILING algorithmic loop: Expert and learner data are used to train score functions via regression, which then define a cost function for RL.

The training process is a non-adversarial loop:

  1. Pre-train a score function $g^e$ on the expert's state demonstrations.
  2. Iteratively collect data from the current learner policy $\pi$.
  3. Train a score function $g^\pi$ on the history of learner data (the replay buffer).
  4. Define a cost function $c(s)$ based on the discrepancy between these scores.
  5. Update the policy using standard Reinforcement Learning (e.g., SAC or DreamerV3) to minimize this cost.
Conceptual illustration of DS Divergence: State distributions P and Q are diffused toward a Gaussian, and their scores are matched along the trajectory.

Because score-matching is a regression-based procedure, the training process is much more stable than the min-max optimization used in GANs.

Theoretical Guarantees

A significant contribution of this work is the proof that SMILING achieves first- and second-order instance-dependent regret bounds. Crucially, these bounds scale linearly with the time horizon ($H$). This is a major theoretical advantage over offline approaches like BC, which suffer from quadratic compounding errors ($H^2$). This linear scaling ensures that the agent's performance gap does not explode as the task duration increases.

Experimental Evaluation

The framework was evaluated on a suite of continuous control benchmarks, including the DeepMind Control Suite (DMC) and the highly complex HumanoidBench.

Key Results

  • Superior Performance: SMILING outperformed major baselines (DAC, IQ-Learn, DiffAIL) on 5 out of 6 tasks. On the most difficult humanoid tasks like crawl and pole, SMILING was often the only method to achieve significant progress, while baselines like DAC frequently collapsed.
  • Sample Efficiency: On the Humanoid-walk task, SMILING reached expert-level performance with only 5,000 expert states, whereas the leading baseline (DAC) required 25,000 states.
  • Stability: Unlike previous diffusion-based IL methods (like DiffAIL), which suffered from numerical instabilities on humanoid tasks, SMILING remained stable throughout training across all environments.

Conclusion

SMILING demonstrates that the benefits of diffusion models—stability and high-quality generation—can be successfully ported to the sequential decision-making domain. By turning the "reward discovery" phase of imitation learning into a regression problem, the authors bypass the training instabilities of GAN-based methods. While there is some computational overhead due to the discretization steps required for score functions, the gains in stability and performance on complex humanoid tasks suggest that score-matching is a promising new direction for robust imitation learning.

Summary updated

BibTeX
@inproceedings{wu2025diffusing,
  author = {Runzhe Wu and Yiding Chen and Gokul Swamy and Kianté Brantley and Wen Sun},
  title = {{Diffusing States and Matching Scores: A New Framework for Imitation Learning}},
  booktitle = {International Conference on Learning Representations},
  year = {2025},
  url = {https://openreview.net/forum?id=kWRKNDU6uN},
}
Figure