Offline-to-Online Reinforcement Learning with Classifier-Free Diffusion Generation

Xiao Huang, Xu Liu, Enze Zhang, Tong Yu, Shuai Li

Introduction

Transitioning a Reinforcement Learning (RL) agent from offline pre-training to online fine-tuning often fails due to the "distribution shift" between static datasets and live environments. To address this, researchers have introduced Classifier-Free Diffusion Generation (CFDG), a novel data augmentation method that uses diffusion models to generate high-quality synthetic data for both offline and online distributions. This approach yields a notable 15% average performance boost across standard benchmarks.

The Challenge: Distribution Mismatch

In Reinforcement Learning, "Offline-to-Online" (O2O) learning is highly desirable for real-world applications like robotics. The standard pipeline involves training an agent on a massive, pre-collected "offline" dataset—which is safe and inexpensive—and then fine-tuning it through "online" interactions with the real world.

The core challenge in this transition is distribution mismatch. The offline data is typically collected by a different, often suboptimal, policy. When the agent begins learning online, the new data it encounters looks vastly different from its training data. While previous research has attempted to use generative models to augment this data, existing methods often struggle to generate samples that truly align with the rapidly changing online policy, or they require complex, multi-stage training pipelines that are difficult to tune.

Methodology: Classifier-Free Diffusion Generation

To bridge this gap, the authors propose CFDG as a "plug-and-play" data augmentation module. Its key components include:

  • Conditional Diffusion: Instead of merely learning the offline data distribution, the diffusion model is trained to recognize two distinct labels: "offline" and "online."
  • Classifier-Free Guidance (CFG): Rather than training a separate, noisy classifier to guide the generation (which is computationally expensive and unstable), CFDG uses a single neural network. This network predicts the "score" (the direction to move to create a realistic sample) both with and without the labels. By interpolating between these two predictions, the system can precisely control how much the generated data resembles the "online" versus "offline" distributions.
  • Data Reweighting: Because the ultimate goal is online fine-tuning, the method prioritizes "online-like" synthetic data. This ensures the agent focuses on samples most relevant to its current environment interactions while still benefiting from the diversity of the offline data.
  • Algorithmic Integration: CFDG acts as a versatile data engine rather than a standalone RL algorithm. It has been successfully integrated into state-of-the-art O2O RL frameworks, including Implicit Q-Learning (IQL), Policy Expansion (PEX), and Adaptive Policy Learning (APL).

Key Insights and Visualizations

A major insight from this work is the importance of augmenting the new data, not just the old. Because online data is sparse and highly valuable, generating more synthetic online data proves to be a highly effective strategy for stable fine-tuning. Furthermore, by utilizing Classifier-Free Guidance, CFDG avoids the complex "energy-guided" mechanisms of previous state-of-the-art methods like EDIS, making the generation process far more adaptable.

t-SNE visualization comparing EDIS and CFDG generated data distributions.

Using t-SNE plots to visualize high-dimensional data, the authors demonstrated that their generated data fills the gaps between sparse online points much more effectively than previous methods. This creates a smoother "bridge" for the agent to learn across during its transition to online environments.

Results and Performance

The authors evaluated CFDG on the industry-standard D4RL benchmark, testing it on Locomotion tasks (teaching robots to run), AntMaze navigation, and highly complex Adroit robotic hand manipulation tasks.

Aggregated performance curve showing CFDG outperforming SynthER and EDIS.
  • 15% Performance Jump: Across the MuJoCo and AntMaze tasks, CFDG provided a consistent 15% average improvement over the base algorithms.
  • State-of-the-Art Performance: CFDG consistently outperformed other diffusion-based augmentation methods, such as SynthER and EDIS, in aggregated performance.
  • Robustness in Complex Tasks: In the notoriously difficult Adroit hand-manipulation tasks, CFDG achieved a remarkable 50% improvement over the baseline, proving its capability in high-dimensional control problems where data scarcity is a severe bottleneck.
  • Efficiency: While diffusion models inherently add computational weight, the authors managed this overhead by optimizing the update frequency of the generative model, keeping overall training times manageable.

Limitations and Future Work

Despite its success, CFDG has limitations. Diffusion models remain computationally heavier than simpler generative models like VAEs, and sampling thousands of points during training adds a non-negligible time penalty. Additionally, the current framework focuses on state-based RL. Expanding this approach to pixel-based environments (learning directly from video or images) represents the next major frontier and will require even more robust generative architectures. Finally, like most diffusion methods, CFDG exhibits hyperparameter sensitivity, requiring careful tuning of the guidance weight and the ratio of synthetic data to balance diversity and accuracy.

Summary updated

BibTeX
@inproceedings{huang2025offline,
  author = {Xiao Huang and Xu Liu and Enze Zhang and Tong Yu and Shuai Li},
  title = {{Offline-to-Online Reinforcement Learning with Classifier-Free Diffusion Generation}},
  booktitle = {International Conference on Machine Learning},
  year = {2025},
  url = {https://openreview.net/forum?id=4JbQK1qGpA},
}
Figure