Abstract
Model-Based Reinforcement Learning (MBRL) typically relies on autoregressive world models that predict the environment's future state-by-state. However, these models often suffer from compounding errors, where small inaccuracies at each step accumulate into significant long-horizon drift. We present Policy-Guided Trajectory Diffusion (PolyGRAD), a novel framework that generates entire on-policy trajectories in a single diffusion pass. By diffusing a block of random noise into a coherent sequence of states and actions guided by the agent's current policy, PolyGRAD maintains global consistency and achieves substantial speedups over autoregressive diffusion methods.
Introduction: The Challenge of Compounding Error
In MBRL, an agent learns a "world model"—a simulator used to plan or train in "imagination." Traditional models are autoregressive: they predict state $s_{t+1}$ given $s_t$ and $a_t$. The fatal flaw of this approach is compounding error: a tiny prediction error at step one leads to an incorrect state at step two, which further degrades the prediction for step three. By the end of a long horizon, the imagined trajectory often diverges entirely from reality.
While diffusion models have been proposed to mitigate this, applying them step-by-step remains computationally expensive and does not fully address long-horizon consistency. PolyGRAD addresses this by shifting the perspective from step-level prediction to trajectory-level generation.
Methods: Policy-Guided Trajectory Diffusion (PolyGRAD)
PolyGRAD treats a full trajectory—comprising states, actions, and rewards—as a single high-dimensional object. The process begins with a "cloud" of Gaussian noise and iteratively refines it into a realistic, on-policy sequence.
Core Components
- Denoising Dynamics: A neural network (MLP or Transformer) is trained to predict the environment's dynamics by denoising the state-reward sequence.
- Policy Guidance: To ensure generated trajectories are "on-policy," PolyGRAD uses the gradient of the policy's action distribution to nudge the diffusion process. This is mathematically analogous to "classifier-guided diffusion" in image generation, where the policy acts as the classifier steering the model toward specific behaviors.
- Inpainting for Continuity: To ground the trajectory in the agent's current state, the first state of the noisy trajectory is replaced with a real environment state at every diffusion step.
- Adaptive Scaling: An automated mechanism tunes the guidance scale $\delta$ to maintain the appropriate level of action entropy, preventing the model from becoming overly deterministic.
Experimental Evaluation
The authors evaluated PolyGRAD on continuous control benchmarks from the MuJoCo suite (HalfCheetah, Hopper, and Walker2d). These tasks require learning complex locomotion patterns where long-horizon accuracy is critical.
Key Results
- Accuracy and Consistency: PolyGRAD outperformed state-of-the-art baselines like Dreamer-v3 and Transformers in Mean Squared Error (MSE) for short-to-medium horizons, demonstrating superior global consistency.
- Computational Efficiency: By generating a whole trajectory in one diffusion chain (e.g., 128 steps) rather than 128 steps per timestep, PolyGRAD achieved a 10x to 50x speedup over autoregressive diffusion models.
- Effective Imagination Training: RL policies trained entirely on synthetic data from PolyGRAD showed strong performance. In Walker2d, PolyGRAD-trained agents significantly outperformed standard model-free algorithms like PPO and TRPO.
Discussion and Limitations
PolyGRAD represents a significant step toward efficient, non-autoregressive world models. By treating the trajectory as the fundamental unit of diffusion, it bypasses the compounding error problem inherent in step-wise models.
However, challenges remain. Performance begins to degrade on very long horizons (100+ steps), suggesting a need for "latent diffusion" in compressed feature spaces. Additionally, the guidance mechanism can struggle when the policy's entropy becomes very low, potentially leading to training instabilities. Future work will explore applying PolyGRAD to non-Markovian environments and high-dimensional, image-based domains.
Summary updated