RTDiff: Reverse Trajectory Synthesis via Diffusion for Offline Reinforcement Learning

Qianlan Yang, Yu-Xiong WangICLR 2025

TL;DR

RTDiff is a novel data augmentation framework for offline reinforcement learning (RL) that uses diffusion models to synthesize trajectories in reverse—moving from unknown states back toward known data. By flipping the direction of generation, the authors effectively neutralize the "overestimation" trap that plagues standard augmentation, leading to state-of-the-art performance across major robotics and navigation benchmarks.

The Challenge: Distribution Shift in Offline RL

Reinforcement Learning usually thrives on trial and error. However, in "offline" RL, the agent is forbidden from interacting with the world; it must learn solely from a static, pre-collected dataset.

The biggest hurdle here is distribution shift. If an agent considers an action not present in the dataset, it often "hallucinates" that the resulting state is highly valuable, leading to overestimation. To fix this, researchers often use generative models to create synthetic data to fill in the gaps.

The catch? Standard generative models synthesize trajectories in the forward direction (from a starting state into the future). If the model makes a mistake, it might create a path that leads the agent from a safe area into a dangerous or unknown one. If the agent learns from this, it might mistakenly believe that veering off-course leads to high rewards, causing it to fail during real-world testing.

The Solution: RTDiff

To address this, the authors introduce RTDiff (Reverse Trajectory Diffuser). Instead of trying to predict where an agent might go next, RTDiff predicts where it might have come from.

RTDiff Paradigm and Illustrative Example

1. Reverse Trajectory Synthesis

The core innovation is generating trajectories that converge toward states already in the offline dataset.

  • Forward Synthesis: Known State $\to$ Unknown/Hallucinated State (Risky).
  • Reverse Synthesis: Unknown/Hallucinated State $\to$ Known State (Safe).

Because the agent starts its actual task in a "known" state, it will never naturally encounter the "unknown" starting point of a reverse synthetic trajectory. However, it will benefit from the transitions that lead back into the high-confidence data regions.

2. Generation Length Control

Diffusion models can sometimes wander too far into nonsense. RTDiff employs an Out-of-Distribution (OOD) detector based on Mahalanobis distance. It automatically cuts a generated trajectory the moment it becomes too unrealistic, ensuring the augmented data remains high-quality.

3. Noise Management for Efficiency

Generating millions of samples is slow. To make the process more efficient, the authors use a "repulsive" noise strategy. When generating multiple trajectories from the same state, they ensure the initial random noise vectors are spread far apart. This forces the diffusion model to produce diverse, non-redundant trajectories, maximizing the information gain per sample.

Key Insights

  • The "Safety" of Reverse Paths: The most brilliant insight is that a hallucination at the beginning of a reverse trajectory is harmless. Since the agent plans forward from known states, it will never reach the hallucinated origin of a reverse path. It only sees the "on-ramp" leading back to the dataset.
  • Longer is Better: Because reverse synthesis is inherently more stable (anchored to a known destination), RTDiff can generate much longer trajectories than previous methods without degrading the agent's performance.
  • Generality: RTDiff isn't a standalone RL algorithm; it’s a plug-and-play data booster. The authors showed it improves existing popular algorithms like IQL and TD3+BC.

Key Results

The authors evaluated RTDiff on standard offline RL benchmarks, including D4RL (Maze2d, AntMaze, Locomotion, Kitchen) and Meta-World for Visual RL. RTDiff consistently outperformed state-of-the-art data augmentation baselines like SynthER and ATraDiff.

Performance on Maze2d, AntMaze, and Kitchen environments
  • Maze2d-Large: RTDiff improved the IQL algorithm's score by 14.3 points, nearly doubling the improvement seen by previous methods.
  • Kitchen-Partial: It achieved a massive 13.6 point boost, whereas previous methods struggled to reach half that.
  • Visual RL: In Meta-World tasks (like "Coffee Push" or "Basketball"), RTDiff significantly improved success rates, proving that the reverse synthesis logic holds up even when dealing with complex image-based inputs.

Limitations and Future Work

Like all diffusion-based methods, RTDiff is computationally expensive. Generating millions of trajectories to augment a dataset takes significant time and GPU resources. Furthermore, while noise control helps, the method still requires a large number of synthetic samples to reach peak performance. Future work will likely focus on refining the noise control components to achieve the same performance with fewer samples, potentially making the method viable for real-time or resource-constrained training.

Summary updated

BibTeX
@inproceedings{yang2025rtdiff,
  author = {Qianlan Yang and Yu-Xiong Wang},
  title = {{RTDiff: Reverse Trajectory Synthesis via Diffusion for Offline Reinforcement Learning}},
  booktitle = {International Conference on Learning Representations},
  year = {2025},
  url = {https://openreview.net/forum?id=0FK6tzqV76},
}
Figure