TL;DR
Diffusion-MPC bridges the gap between the flexibility of Model Predictive Control (MPC) and the stability of reinforcement learning for legged robots. By training a diffusion model to jointly generate future states and actions, the system serves as a learned dynamics prior that can be steered on the fly using test-time reward gradients and constraint projections. Deployed in real time at 50 Hz on a Unitree Go2 quadruped, it achieves agile locomotion and zero-shot behavior adaptation without retraining.
What Problem Does This Paper Address?
Creating adaptive controllers for legged locomotion is notoriously difficult. Contact-rich dynamics make traditional MPC computationally heavy and heavily reliant on simplified, hand-crafted physics models that degrade in complex environments. Conversely, model-free reinforcement learning (RL) achieves great stability and sim-to-real transfer, but locks behaviors into a rigid, fixed policy: changing tasks, imposing new physical constraints, or adjusting targets at test time typically requires designing new reward functions and retraining from scratch.
Recent diffusion-based policies show promise as expressive behavioral priors, but they are often restricted to generating actions only (ignoring dynamics) or are too slow for real-time closed-loop robot control. Diffusion-MPC tackles this trade-off by turning trajectory diffusion into an expressive, real-time predictive controller.
Methods
Diffusion-MPC combines learned generative modeling with optimization-based control:
- Joint State–Action Diffusion Prior: Rather than generating actions conditioned on states, the diffusion model jointly samples future trajectories $\tau = [s_{t:t+H}; a_{t:t+H}]$. This captures implicit environment dynamics without needing an explicit simulator or analytical equations.
- Test-Time Reward Guidance & Constraint Projection: Trajectories are refined during the reverse denoising process:
- Reward Planning: Trajectories are nudged toward task goals using gradients from analytic objectives (e.g., posture, smooth acceleration) and learned neural reward heads (e.g., base height, power consumption).
- Constraint Projection: After each reverse step, state-action predictions are projected back into feasible sets (e.g., joint angle limits).
- Candidate Ranking: Multiple candidate trajectories are sampled in parallel and ranked to select the best plan.
- Interactive Finetuning (Reward-Weighted Denoising): Offline demonstrations collected under simplified conditions often degrade in real-world deployment. The authors use an interactive online loop where the robot collects trajectories in simulation, filters them by realized environmental returns, and updates the denoiser via exponential reward-weighted regression (RWD).
- Real-Time Asynchronous Execution: To run at 50 Hz on an onboard Intel NUC, the controller uses an asynchronous planning pipeline (horizon $H=11$, replanning margin $D=3$) combined with early-denoising step caching ($m=7$) and periodic cache resets, reducing planning latency to ~21 ms.
Datasets
- Offline Demonstration Dataset: 4,000 trajectories of 1,000 steps each, collected in Isaac Gym from a PPO-trained baseline policy in a static, nominal setting.
- Online Interactive Finetuning: Collected across 4,096 parallel Isaac Gym environments over 1,500 interaction steps per environment, applying domain randomization across robot mass, inertia, ground friction, motor strength, and sensor latency.
- Real-World Evaluations: Conducted directly on a physical Unitree Go2 quadruped on indoor surfaces, pendulum impact setups, and outdoor terrains (uneven grass and grassy slopes).
Key Insights and Ideas
- Joint trajectories eliminate explicit forward models: Generating both states and actions simultaneously lets gradients from reward functions steer the full predicted trajectory directly at each denoising step, avoiding compounding error from external learned dynamics models.
- Reward-weighted denoising avoids policy-gradient instability: Finetuning diffusion models with standard RL policy gradients often suffers from high variance and critic exploitation. Weighting standard denoising objectives with realized rollout returns stabilizes policy improvement while preserving the prior's diversity.
- Early-step caching makes diffusion viable for high-rate control: Early diffusion steps establish coarse trajectory shapes that barely change between consecutive planning windows. Warm-starting from a time-shifted previous plan eliminates redundant computation, achieving low-latency (~21 ms) execution without dropping to low-fidelity sampling.
Key Results
- Simulation Finetuning Gains: Across 1,000 test environments, interactive finetuning dramatically outperformed un-finetuned diffusion baselines, especially at higher speeds. At 1.0 m/s, stability improved from 18.4% to 98.8%, and velocity tracking error dropped from 74.8% to 29.1%.
- Zero-Shot Task Composition: Without retraining, test-time reward shaping successfully modulated base height (smoothly descending from 25 cm to 18 cm, a transition absent from the dataset) and rear calf postures.
- Energy Efficiency: Integrating an energy-saving reward reduced the robot's real-world power consumption by 20% compared to unguided locomotion by reducing excessive foot clearance.
- Robust Balancing: When hit with a 3.8 kg swinging pendulum at impact speeds up to 4.54 m/s, Diffusion-MPC achieved 90%–100% recovery rates across all release angles, outperforming unguided execution (60%–90%).
- Real-World Deployment: The finetuned policy achieved a 100% success rate across commanded speeds up to 1.0 m/s outdoors on uneven grass and slopes, whereas untuned models failed completely due to execution lag.
Limitations and Future Work
- Simple Constraints: Current constraint enforcement relies on elementwise projections (e.g., box bounds on joint limits and rates). Extending the framework to non-convex or time-varying obstacle avoidance constraints remains open.
- Proprioception Only: The policy currently lacks exteroceptive sensing (such as depth cameras or LiDAR), limiting planning to local dynamics rather than long-horizon navigation.
- Reliance on Demonstrations: Although the authors demonstrate a proof-of-concept trained from scratch, the full system still primarily benefits from an initial bootstrap using offline demonstration data.
Summary updated