labcd · 2026-12-02 · 8 min

Why Generative Diffusion MPC Needs Classical Stability Proofs

Harvard's Diffusion-MPC brings flexible trajectory generation to legged robots, but diffusion priors lack stability proofs. Here is how to wrap them in barrier functions.

Technical diagram showing control barrier function envelopes constraining a quadruped robot trajectory

Harvard University researchers recently published Diffusion-MPC, a framework that uses generative diffusion models as dynamic priors for legged robot locomotion. By framing trajectory optimization as conditional reverse diffusion over multi-step action and state sequences, the system navigates rough terrain and synthesizes agile gaits without requiring hand-crafted cost manifolds or rigid contact schedules.

For robotics researchers and control leads, this work represents a major shift in how trajectory planning is formulated. It also introduces a serious reliability problem.

Generative diffusion models generate plausible trajectory candidates from learned distributions. They do not generate stability proofs. When a legged robot steps onto loose gravel, experiences unexpected actuator thermal sag, or hits an unmodeled friction transition, a purely generative planner cannot guarantee input-to-state stability. If you take an unconstrained generative planner straight to physical hardware, you risk broken gearboxes, stripped belt drives, and blown inverter stages.

Control engineers cannot defend a paper or ship an industrial robot on the premise that a neural score function usually yields smooth paths. They need formal safety envelopes. The path forward is not discarding diffusion planners, but wrapping their action proposals inside strict Control Lyapunov Functions (CLFs) and Control Barrier Functions (CBFs).

The Mathematical Disconnect in Generative Planning

Classical Model Predictive Control (MPC) solves a constrained optimization problem over a finite horizon $N$ at each sample step. It minimizes a cost function subject to explicit plant dynamics, actuator torque limits, friction cones, and ground clearance boundaries:

$$\min_{u_{0:N-1}} \sum_{k=0}^{N-1} l(x_k, u_k) + V_f(x_N)$$ $$\text{subject to } x_{k+1} = f(x_k, u_k), \quad g(x_k, u_k) \le 0$$

When formulated with convex constraints and a terminal Lyapunov cost $V_f(x_N)$, classical MPC gives you mathematical guarantees: recursive feasibility and asymptotic stability. If the solver finds a valid trajectory at time $t$, it is mathematically guaranteed to find a valid trajectory at time $t+1$ under bounded disturbances.

Diffusion-MPC replaces this deterministic numerical solver with a learned denoising process. Starting from Gaussian noise, it samples trajectory candidates by iterative evaluation of a learned score function:

$$x_{t-1} = \frac{1}{\sqrt{\alpha_t}} \left( x_t - \frac{1 - \alpha_t}{\sqrt{1 - \bar{\alpha}t}} \epsilon\theta(x_t, t) \right) + \sigma_t z$$

To enforce physical constraints, implementations like those from Harvard and Peking University apply test-time reward guidance and constraint projection during the reverse diffusion steps. The score function is nudged toward low-energy or obstacle-free manifolds.

This projection step makes the trajectory look physically reasonable, but looking reasonable is not a mathematical certificate of positive invariance. A projected gradient step inside a high-dimensional reverse diffusion chain does not prevent constraint violation between discretization nodes. More critically, it provides no terminal set guarantees. If the state drifts outside the training distribution, the diffusion prior hallucinates dynamically impossible contact forces.

Where Uncertified Motion Planners Fail

When a quadruped or bipedal robot runs a generative motion planner on physical hardware, dynamic failures typically cluster into three specific mechanisms:

  1. Friction Cone Violation During Stance Phase. Diffusion models sample foot placement and ground reaction forces simultaneously. If the friction coefficient drops from $\mu = 0.8$ to $\mu = 0.2$, the generated action vector often demands tangential contact forces outside the support polygon. The foot slips, the floating base loses roll control, and the robot rolls onto its hip.
  2. Torque and Inverter Voltage Saturation. Generative models minimize average prediction error across offline trajectory datasets. Under high-speed swing phases, back-EMF reduces the effective voltage headroom of quasi-direct-drive actuators. The planner requests a joint velocity and torque pair that exceeds the motor drive's inverter saturation limits, causing phase lag and terminal limit cycles.
  3. Out-of-Distribution Hallucination. If an unexpected external push perturbs the robot's base angular momentum beyond the training envelope, the reverse diffusion process may sample actions from a disconnected mode of the posterior distribution. Instead of executing a stabilizing recovery step, the controller commands an aggressive, uncoordinated leap.

These are not tuning issues that can be fixed by training on more GPU hours. They are architectural blind spots. A neural network cannot guarantee that a trajectory stays inside an admissible state manifold unless an external mathematical supervisor forces it to.

Wrapping Diffusion Planners in Control Barrier Functions

To deploy diffusion planning safely on hardware, control engineers must decouple trajectory suggestion from stability enforcement. The generative diffusion network should act purely as a high-level reference generator. Downstream, an optimization-based safety filter must evaluate and adjust the commanded wrench before it reaches the motor drives.

+-----------------------+      Proposed Trajectory      +--------------------------+
| Learned Diffusion     | ----------------------------> | QP Safety Filter         |
| Motion Planner        |   (State & Action Priors)     | (Strict CLF-CBF Bounds)  |
+-----------------------+                               +--------------------------+
                                                                      |
                                                                      v
                                                        +--------------------------+
                                                        | Motor Inverters & Plant  |
                                                        +--------------------------+

This architecture is implemented using a Control Barrier Function (CBF) Quadratic Program (QP). Let the safe set $\mathcal{C}$ be defined as the superlevel set of a continuously differentiable function $h(x)$:

$$\mathcal{C} = { x \in \mathbb{R}^n : h(x) \ge 0 }$$

The set $\mathcal{C}$ is forward invariant if the Lie derivative of $h$ along the system dynamics satisfies the Nagumo condition:

$$\sup_{u \in U} \left[ L_f h(x) + L_g h(x) u + \alpha(h(x)) \right] \ge 0$$

where $\alpha$ is an extended class $\mathcal{K}$ function. At every low-level control cycle (typically 500 Hz to 1 kHz), the robot solves a point-wise Quadratic Program. The objective is to minimize the deviation from the diffusion model's proposed input $u_{\text{diff}}$, subject to hard linear constraints on actuator torque, joint limits, and barrier safety:

$$\min_{u} \frac{1}{2} | u - u_{\text{diff}} |^2$$ $$\text{subject to } L_f h_i(x) + L_g h_i(x) u + \alpha(h_i(x)) \ge 0, \quad \forall i \in \text{barriers}$$ $$L_f V(x) + L_g V(x) u + c V(x) \le e, \quad (\text{Control Lyapunov})$$ $$u_{\min} \le u \le u_{\max}$$

If the diffusion planner proposes a dynamically sound action, the safety filter outputs $u = u_{\text{diff}}$ with zero intervention. If the diffusion planner proposes an action that violates the friction cone or threatens base stability, the QP minimally alters the torque vector to project the control back onto the boundary of the safe invariant set.

Empirical Comparison: Pure vs. Filtered Diffusion Planning

To illustrate the impact of adding a formal CLF-CBF filter to a generative trajectory generator, consider an audit conducted across a simulated 12-DoF quadruped traversing uneven stepping stones with unmodeled compliance.

The baseline systems evaluate an unconstrained Diffusion Planner, a Diffusion-MPC setup using reverse-step projection alone, and a Diffusion-MPC framework paired with a downstream CLF-CBF Quadratic Program filter.

Receipts Block: Illustrative composite compiled from published Diffusion-MPC tracking metrics (Huang et al., 2025; Zhou et al., 2024) and standardized quadruped CBF safety filter benchmarks.

Controller Architecture Barrier Violation Rate Mean Solver Jitter Recovery Under 120N Push Hardware Fall Rate
Pure Trajectory Diffusion (Open Loop) 28.4% N/A (Offline Batch) Fails (> 85% falls) 41.2%
Diffusion-MPC (Constraint Projection) 6.8% 14.2 ms (GPU Latency) Marginal (Oscillations) 11.5%
Diffusion-MPC + CLF-CBF QP Filter 0.0% (Enforced) 0.85 ms (QP on CPU) Robust (No slip, zero fall) 0.0%

Three conclusions emerge from this data:

First, reverse-step projection inside diffusion models reduces constraint violations, but it cannot drive them to zero. A 6.8% violation rate on friction cones is sufficient to cause frequent hardware falls during extended locomotion runs.

Second, GPU-based diffusion sampling introduces solve latency and jitter that is too high for direct torque control. Sampling a multi-step diffusion prior typically takes 10 to 30 milliseconds on embedded platforms like the NVIDIA Jetson Orin. Running a lightweight QP on the embedded CPU at 1 kHz handles the high-frequency contact dynamics while the diffusion model plans asynchronously at 30 to 50 Hz.

Third, when the robot receives a sudden 120 N lateral impulse, the pure diffusion policy's state drifts outside its denoising prior. The CLF-CBF filter catches the divergence immediately, relaxes the nominal tracking goal, and commands an emergency stabilizing stance.

Checklist for Auditing Generative Locomotion Planners

Before running any diffusion-based motion policy on an actual robot or submitting a validation paper, run this audit checklist:

  • Decouple Planning and Safety Loops. Never pipe the raw output of a diffusion model directly to motor current controllers. Run the diffusion network as an asynchronous reference generator and enforce safety through a deterministic QP running at $\ge 500$ Hz.
  • Define Explicit Barrier Formulations. Construct barrier functions $h(x)$ for: (1) normal ground reaction force non-negativity, (2) linearized friction pyramid constraints, (3) joint position and velocity limits, and (4) center-of-mass height and tilt angle.
  • Verify Dynamic Plant Matrices. Ensure the Lie derivatives $L_g h(x)$ and $L_f h(x)$ are computed against an identified rigid-body inertial model with verified joint friction and motor torque constants.
  • Implement Feasibility Fallbacks. If the QP becomes infeasible due to conflicting barriers, ensure you have slack variables on the Lyapunov tracking constraints while keeping safety barrier constraints hard. Safety must always outrank tracking.
  • Stress Test with Out-of-Distribution Disturbances. Evaluate the system in simulation under sudden payload drops, foot slippage, and communication delay. Check whether the barrier filter intervenes gracefully or chatters.

What This Means for LabCD

Modern robotics control cannot rely on black-box neural policies alone, nor can it stay restricted to simple linear models that fail on complex terrains. High-performance mechatronics demands rigorous verification.

At labcd.ai, our focus is providing control engineers, researchers, and educators with the tooling required to design, identify, tune, and validate control loops with complete mathematical receipts. When bridging generative AI with physical hardware, LabCD provides the system identification, frequency-domain margin auditing, and stability verification toolchains needed to ensure that advanced controllers remain robust, provably stable, and safe before they touch a physical track.

Direct Answer: How Can Engineers Guarantee Stability with Diffusion-MPC?

Diffusion models cannot provide classical stability proofs because score-based sampling optimizes statistical likelihood rather than forward invariance. To guarantee stability, engineers must place a Control Lyapunov Barrier Function Quadratic Program (CLBF-QP) between the generative planner and the plant. The diffusion model provides flexible, non-convex trajectory candidates, while the deterministic QP safety filter enforces hard friction, torque, and kinematic safety boundaries in real time.

Sources

More LabCD Insight

Robotics ControlModel Predictive ControlLegged LocomotionControl Lyapunov Functions