Synthetic Experience Replay

Cong Lu, Philip J. Ball, Yee Whye Teh, Jack Parker-Holder

In the domain of supervised learning, massive datasets like ImageNet have enabled the training of gargantuan models, unlocking the "scaling laws" that drive modern Computer Vision and Natural Language Processing. In Reinforcement Learning (RL), however, agents are fundamentally "data-starved." They must collect their own experience through environmental interaction, which is frequently limited, noisy, or expensive to obtain. This scarcity often forces researchers to rely on small, shallow neural networks to avoid overfitting, preventing RL from fully benefiting from deep learning's scaling capabilities.

To address this bottleneck, researchers propose SynthER (Synthetic Experience Replay). By leveraging the power of diffusion models, SynthER demonstrates that limited experience can be "upsampled" into a vast pool of high-quality synthetic data. This unlocks the ability to train larger models and achieve superior performance without altering the underlying RL algorithms.

The Data Scarcity Problem in Deep RL

Deep RL relies heavily on experience replay, where an agent stores past transitions $(s, a, r, s')$ in a buffer and re-samples them for training. When this buffer is small—a common scenario in real-world robotics or early-stage training—the agent quickly overfits to its limited history.

Historically, researchers have combated this using two main strategies:

  1. Data Augmentation: Adding random noise to states (e.g., Additive or Dynamics noise). While helpful, this often creates "impossible" transitions that violate the environment's physics.
  2. Algorithmic Tweaks: Designing complex architectures (like REDQ) to handle high "update-to-data" (UTD) ratios.

SynthER takes a more direct approach: generating better, physically plausible data. Previous attempts using VAEs or GANs often failed because those models struggled to capture the complex, multi-modal distributions of RL transitions accurately without mode collapse.

The SynthER Approach

SynthER treats the experience replay buffer as a training set for a generative model, creating a "plug-and-play" module that can be integrated with standard off-the-shelf RL methods.

SynthER Pipeline
  • The Generative Engine: SynthER utilizes Diffusion Models (specifically the Elucidated Diffusion Model or EDM). Unlike VAEs, diffusion models excel at modeling complex distributions without collapsing into a single mode.
  • Transition-Level Modeling: Instead of modeling entire trajectories—which is computationally expensive—SynthER models individual transitions: $(s, a, r, s')$.
  • Algorithm Agnostic: Practitioners can take real data, train a diffusion model on it, generate millions of synthetic transitions, and feed a mix of real and synthetic data into any standard RL algorithm (e.g., SAC, IQL, or TD3+BC).
  • Latent Scaling: For pixel-based environments, SynthER avoids generating raw images. Instead, it trains the diffusion model in the latent space of a pre-trained CNN encoder, significantly accelerating the process.

Experimental Setup and Key Insights

The researchers evaluated SynthER across standard benchmarks, including D4RL (MuJoCo locomotion and Maze2D/AntMaze), V-D4RL (pixel-based offline RL), and DeepMind Control Suite/OpenAI Gym for online RL.

Diversity and Accuracy: The most striking finding is that SynthER generates transitions that are highly diverse (far from the original data) yet physically accurate. Traditional noise-based augmentation creates diverse but physically nonsensical data; SynthER creates diverse data that remains plausible.

Alleviating the Representational Bottleneck: In offline RL, simply increasing the size of a neural network usually degrades performance due to overfitting. However, when using SynthER to upsample the data, larger networks suddenly become viable, yielding an 11.7% performance boost in tested environments.

Data Compression: SynthER also acts as a massive data compressor. A 6.5M parameter diffusion model can represent an 84M-float dataset, achieving a 12.9x reduction in storage requirements.

Key Results

SynthER demonstrates substantial improvements across both offline and online RL settings, matching or exceeding specialized algorithms.

Performance Comparison
  • Offline Parity: SynthER achieved near-original performance on the Walker2d-Medium-Expert task using only 3% of the original data by upsampling it.
  • Online Efficiency: In online settings, a standard SAC agent augmented with SynthER significantly outperformed standard SAC and matched the state-of-the-art, complex REDQ algorithm across six environments.
  • Pixel-Based Success: On the V-D4RL benchmark, SynthER provided a +9.5% gain on DrQ+BC by generating transitions in the latent space.
  • Robustness: The method proved robust across six different RL algorithms, confirming its utility as a general-purpose tool.

Limitations and Future Work

While powerful, SynthER has areas for future refinement:

  • Sampling Cost: Training the diffusion model is relatively fast, but generating millions of samples takes time (approximately 90 seconds for 100k samples). In high-speed online training, this generation step could become a bottleneck.
  • Discrete Variables: The current model uses a simple rounding threshold (0.5) for discrete variables like "terminal" flags. More sophisticated categorical diffusion could improve accuracy here.
  • Raw Pixels: The current reliance on a latent space for visual tasks is efficient, but future work could explore generating raw video frames, albeit at a higher computational cost.

Ultimately, SynthER suggests that the future of data-efficient RL might not require increasingly complex agents, but rather better generative "imagination" engines capable of turning a handful of real experiences into a vast, high-fidelity training ground.

Summary updated

BibTeX
@inproceedings{lu2023synthetic,
  author = {Cong Lu and Philip J. Ball and Yee Whye Teh and Jack Parker-Holder},
  title = {{Synthetic Experience Replay}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2023},
  url = {https://openreview.net/forum?id=6jNQ1AY1Uf},
}
Figure