Diffusion Spectral Representation for Reinforcement Learning

Dmitry Shribak, Chen-Xiao Gao, Yitong Li, Chenjun Xiao, Bo Dai

Diffusion models have taken the generative AI world by storm, but in Reinforcement Learning (RL), they’ve hit a major speed bump: inference cost. While diffusion is incredible at modeling the complex, multimodal distributions found in real-world environments, generating a single sample typically requires tens or hundreds of iterative denoising steps. In the "inner loop" of an RL agent—where decisions must be made in milliseconds—this latency is often a dealbreaker.

A new paper, "Diffusion Spectral Representation for Reinforcement Learning," offers a clever way out. Instead of using diffusion to generate samples, the authors use it to learn representations. Their framework, Diff-SR, captures the expressive power of diffusion while running at the speed of a standard neural network.

The Bottleneck in Diffusion RL

The core challenge in RL is learning a "value function"—a map that tells an agent how much reward to expect from a certain state and action. To do this well, the agent needs to understand the environment's transition dynamics.

Standard methods often simplify these dynamics using low-rank approximations (like Linear MDPs). However, real-world data is rarely linear; it’s messy, high-dimensional, and multimodal. Diffusion models are perfect for this messiness, but existing "Diffusion RL" approaches (such as Diffusion Policies or World Models) rely on iterative sampling to plan or act. This makes them computationally heavy and slow.

The authors ask a pivotal question: Can we exploit the flexibility of diffusion models to learn better features for RL without the heavy cost of iterative sampling?

Methods: The Diffusion-EBM Connection

The researchers’ key insight is a mathematical bridge between Diffusion Models and Energy-Based Models (EBMs).

  1. Spectral Representation: Any transition function can be factorized into two parts: a feature mapping for the current state-action pair ($\phi(s, a)$) and a mapping for the next state ($\mu(s')$). If you can learn a good $\phi$, the value function becomes a simple linear equation.
  2. Tweedie’s Identity: The authors show that by training a diffusion-style denoising objective, they are effectively learning the "score" (the gradient of the log-density) of the environment's transitions. Using a statistical tool called Tweedie’s Identity, they extract the underlying spectral representation ($\phi$) directly from this score function.
  3. Diff-SR Framework: Unlike standard diffusion, which uses the learned score to iteratively denoise a sample, Diff-SR uses the score function to construct a finite-dimensional feature vector.
  4. Bypassing the Chain: Because the value function is represented linearly with respect to these learned features, the agent can perform policy optimization and planning using standard, fast RL algorithms (like Soft Actor-Critic). The slow "reverse diffusion" chain is completely bypassed during inference.

Experimental Setup

The authors evaluated Diff-SR across a variety of challenging benchmarks:

  • Gym-MuJoCo: Standard continuous control tasks like HalfCheetah, Ant, Hopper, and Walker2d.
  • Meta-World: A more difficult suite of image-based tasks requiring robotic manipulation, such as bin-picking, door-opening, and drawer-closing.
  • Partial Observability Variants (POMDPs): Versions of the MuJoCo tasks where velocity information is masked, forcing the agent to rely on a history of observations.

Key Insights

  • Representation > Generation: You don't need to generate a future state to understand it. The gradients learned during the diffusion training process contain enough structural information to serve as a powerful basis for value functions.
  • Nonlinear Features, Linear Value: While the value function is linear in terms of $\phi$, the features themselves are derived from a deep, nonlinear diffusion process. This provides the expressiveness of deep generative models alongside the stability and speed of linear value approximation.
  • Built-in Exploration: Because the representation is tied to the density of the data, the authors can derive a UCB-style (Upper Confidence Bound) bonus. This allows the agent to be "optimistic" and explore areas of the state space where the diffusion model is less certain.

Key Results

The empirical results suggest that Diff-SR is both more effective and significantly more efficient than existing methods.

Learning curves comparing Diff-SR against baselines across continuous control tasks.
  • Performance Boost: On the MuJoCo "Ant" and "Walker" tasks, Diff-SR outperformed the strongest representation-learning baseline (LV-Rep) by 90% and 48%, respectively.
  • Visual Success: In the image-based Meta-World tasks, Diff-SR achieved a >90% success rate on 7 out of 8 tasks. For comparison, the next best baseline only managed this on 3 tasks.
  • 4x Speedup: When compared to PolyGRAD (a state-of-the-art RL method that samples from a diffusion model), Diff-SR was roughly 4 times faster in terms of wall-clock runtime, confirming that bypassing the iterative sampling process provides a massive efficiency gain.

Limitations and Future Work

While Diff-SR is a significant step forward, the authors note a few areas for improvement:

  • Real-World Scaling: Current experiments are limited to simulated environments. Testing on real-world robotic hardware with noisy sensors and unpredictable physics is the next logical step.
  • Multi-Task Learning: The paper focuses on single-task performance. Future work could investigate whether these diffusion-based spectral representations can be shared across multiple different tasks to enable faster transfer learning.
  • High-Dimensional Latents: While they successfully used a VAE to handle pixels in Meta-World, further research is needed to see how these spectral representations scale to even more complex, high-resolution visual environments.

Summary updated

BibTeX
@inproceedings{shribak2024diffusion,
  author = {Dmitry Shribak and Chen-Xiao Gao and Yitong Li and Chenjun Xiao and Bo Dai},
  title = {{Diffusion Spectral Representation for Reinforcement Learning}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2024},
  url = {https://openreview.net/forum?id=C3tEX45hJX},
}
Figure