TL;DR
Online reinforcement learning (RL) in sparse-reward environments is notoriously sample-inefficient. This paper introduces ATraDiff (Adaptive Trajectory Diffuser), a diffusion-based generative model that synthesizes full, flexible-length trajectories from offline data to augment an online agent's replay buffer. By seamlessly plugging into existing RL algorithms, ATraDiff significantly accelerates learning and achieves state-of-the-art performance across various complex benchmarks.
What Problem Does This Paper Address?
Deep reinforcement learning has achieved remarkable success, but it usually requires massive amounts of online interaction with the environment. This sample-inefficiency becomes a major bottleneck in real-world scenarios characterized by sparse rewards—for instance, a robotic arm trying to manipulate an object might only receive a success signal (a reward of 1) after hundreds of precise steps, getting 0 everywhere else.
To tackle this, researchers often use fixed offline datasets to pretrain policies or extract "skills." However, these static datasets limit an agent's ability to generalize to new tasks. Recently, generative diffusion models have been used for data augmentation in RL, but prior methods only generate isolated transitions (single state-action pairs). This underutilizes the power of diffusion models, as isolated transitions lack the long-term temporal coherence and rich context provided by full trajectories.
Methods
ATraDiff overcomes these limitations by generating complete synthetic trajectories conditioned on the agent's current state. The framework consists of two main architectural designs:
- Coarse-to-Precise Length Control: Because RL task horizons are unpredictable, generating fixed-length trajectories can introduce harmful or redundant data. ATraDiff trains multiple ($M$) diffusion models across varying length scales (e.g., lengths of 5, 10, 15, etc.). A pretrained network estimates the required length for the current state and selects the closest model scale. After generation, a non-parametric trajectory pruner trims any redundant trailing frames based on state similarity.
- Online Adaptation Mechanism: To handle the inevitable distribution shift between offline training data and new online tasks, ATraDiff is periodically fine-tuned on real online experiences. It utilizes an importance sampler (guided by TD-error or reward indicators) to select high-value data for updates, alongside a random dropping strategy to prevent catastrophic forgetting.
Notably, ATraDiff supports both state-level generation and image-level generation. The image-level variant leverages a pretrained Stable Diffusion model fine-tuned on the environment's frames, paired with an end-to-end decoder to extract states, actions, and rewards.
Datasets
The authors evaluated ATraDiff across several standard and customized off-policy RL benchmarks:
- D4RL Locomotion: Standard tasks (Hopper, HalfCheetah, Walker2d) spanning 12 datasets of varying data quality (random, medium, expert, etc.).
- D4RL AntMaze: Six highly challenging sparse-reward navigation tasks.
- D4RL Kitchen: A complex robotic manipulation environment requiring the execution of a sequence of subtasks.
- Meta-World: The authors designed two custom, highly challenging tasks (a multi-task setting and an 8-subtask sequence setting) specifically to evaluate how well the model handles severe distribution shifts.
- V-D4RL: Used to validate performance on pixel-based visual RL.
Key Insights and Ideas
- Trajectories > Transitions: Synthesizing full trajectories provides a much richer and more informative dataset for the replay buffer than generating disconnected, individual transitions. This temporal coherence is what allows the online agent to learn significantly faster.
- The Power of Pretrained Visual Priors: Image-level trajectory generation consistently outperforms state-level generation trained from scratch in complex environments. This is because the model can exploit the robust visual representations already embedded within large pretrained models like Stable Diffusion.
- Generative Models Must Adapt: A static data generator is insufficient for online RL. As the agent explores and encounters distribution shifts, the generative model itself must dynamically adapt online to continue producing relevant, high-quality data.
Key Results
- Accelerating Online RL: When integrated with standard online RL algorithms like SAC and REDQ on D4RL Locomotion, ATraDiff consistently and significantly improves sample efficiency and normalized returns.
- State-of-the-Art in Complex Settings: In offline-to-online settings (AntMaze, Kitchen, Meta-World), ATraDiff combined with advanced baselines (like RLPD, SPiRL, and PARROT) achieves top-tier performance, showing particularly massive gains in sparse-reward and multi-task environments.
- Ablation Success: Image-level generation variants showed noticeable performance gains over state-level generation in complex tasks, validating the hypothesis that pretrained generation models provide a substantial advantage.
Limitations and Future Work
The primary limitation of ATraDiff is its computational complexity. Training and maintaining a collection of multiple diffusion models for different trajectory lengths is resource-intensive, and the problem scales up with longer target trajectories.
As a next step, the authors suggest developing a single, unified diffusion model capable of directly generating trajectories of varied and flexible lengths, eliminating the need to train and select from an ensemble of separate models.
Summary updated