DL0151 Diffusion Policy and pi0 Flow Matching

How does Diffusion Policy generate continuous robot action chunks through denoising, and how does Physical Intelligence’s π0 instantiate the same idea as a flow-matching action expert on top of a pretrained vision-language backbone?

Answer

Neither model emits one action per forward pass. Both treat a whole chunk of H future actions as a single high-dimensional sample from a conditional generative model, and they produce it by starting from Gaussian noise and running an iterative sampler conditioned on the current observation. Diffusion Policy does this with a DDPM: a 1D temporal U-Net (or a transformer variant) predicts the noise inside a noisy action sequence, and K denoising steps turn A^K \sim \mathcal{N}(0, I) into an executable chunk, of which only the first T_a actions are executed before replanning. π0 keeps that output object and changes two things. The sampler becomes conditional flow matching along a straight noise-to-action path integrated with about 10 Euler steps, and the denoiser becomes a 300M-parameter action expert placed inside a PaliGemma 3B VLM as a second set of weights in one transformer. Images and language flow through the VLM weights, the robot state and the 50 noisy action tokens flow through the expert weights, and a single shared self-attention operation joins them, which is why the backbone is initialized from a VLM and fine-tuned rather than kept literally frozen.

(1) Chunks, Not Single Actions: the policy models p(A_t \mid O_t) over an H \times d matrix, which suppresses per-step jitter and makes long idle or contact phases survivable.
(2) Denoising Is The Policy: sampling replaces regression, so the network never has to collapse several valid demonstrated behaviors into their average.
(3) Multimodality Is Preserved: an MSE regressor asked to pass left or right of an obstacle outputs the mean of the two, which hits the obstacle; a denoiser draws one mode per rollout.
(4) Receding Horizon Closes The Loop: predict H, execute T_a \leq H, re-observe, resample. This is the only feedback mechanism the chunk has.
(5) Flow Matching Straightens The Path: a linear interpolation between noise and data gives an almost constant velocity field, so 10 integration steps suffice for a 50-step chunk at 50 Hz.
(6) Two Experts, One Attention: π0 routes tokens to modality-specific weights but keeps one attention operation, and the prefix KV cache is computed once per observation while only the small expert runs on every integration step.

Top row shows three line plots of two action dimensions over the fifty steps of a chunk, starting as pure Gaussian noise, then partially denoised, then a smooth executable trajectory, with denoise arrows between them. Bottom panel shows three overlapping horizontal bars representing chunks predicted at successive replanning times, each with a shaded leading segment marking the executed portion.

Figure 1: The sampler operates on the entire chunk at once, so temporal smoothness is a property of the generated sample rather than something enforced by a filter. At the bottom, only the leading T_a actions of each chunk are executed, so the replanning period sets the reaction latency to anything the model did not anticipate.

The reason to pay for an iterative sampler is the shape of the demonstration data. Teleoperated demonstrations are multimodal and idle-heavy: the same scene is solved in several ways, and a maximum-likelihood Gaussian head trained with MSE returns the conditional mean, which is frequently not a valid action. Discretizing each dimension independently avoids averaging but breaks cross-dimension coordination, and a joint discretization is exponential in d. Diffusion Policy’s published recipe uses observation horizon 2, prediction horizon 16, execution horizon 8, 100 DDPM training steps with 10 DDIM inference steps, FiLM conditioning of the observation embedding into a 1D temporal convolutional U-Net, and end-effector position control rather than velocity control, reporting an average 46.9% relative improvement over prior behavior-cloning baselines across 15 tasks.

Diffusion Policy (DDPM formulation):
A_t = (a_t, a_{t+1}, \ldots, a_{t+H-1})
\hat{\epsilon} = \epsilon_{\theta}(O_t, A_t^k, k)
A_t^{k-1} = \alpha_k (A_t^k - \gamma_k \hat{\epsilon}) + \sigma_k z
\mathcal{L}_{\mathrm{DP}} = \mathbb{E}\|\epsilon - \hat{\epsilon}\|^2

The same object, an H \times d chunk, is what π0 produces, but the generative process is a continuous-time flow rather than a discrete Markov chain. Training samples a noise vector and a time \tau \in [0,1] from a beta distribution that deliberately over-weights the noisy end of the path, forms the linear interpolant, and regresses the network onto the constant velocity that carries noise to data. Because the path is straight by construction, inference integrates with a fixed step \delta = 0.1 from \tau = 0 to \tau = 1, which is 10 network evaluations for a chunk of 50 actions at 50 Hz. Cross-embodiment training is handled crudely and effectively: every state and action vector is zero-padded to the largest action dimension in the mixture (18 in the released model), and robots with fewer joints simply ignore the padded slots.

Architecture diagram with four input lanes for camera images, language instruction, robot state, and the noisy action chunk with its tau embedding, each passing through its own encoder into a single transformer stack that contains two weight sets: PaliGemma VLM weights for the prefix tokens and a 300 million parameter action expert for state and action tokens, joined by shared self-attention, producing a velocity field that is integrated by ten Euler steps into the final action chunk.

Figure 2: π0 is a mixture of two experts inside one transformer: the token type decides which weight matrices are applied, while attention is computed jointly over the whole sequence. Only the small expert is re-run per integration step, so the reported cost of a chunk is one 3B prefill plus ten passes over 300M parameters, roughly 73 ms in the released report.

Flow-matching action expert:
A_t^{\tau} = \tau A_t + (1-\tau)\epsilon
u(A_t^{\tau} \mid A_t) = A_t - \epsilon
\mathcal{L}_{\mathrm{FM}} = \mathbb{E}\|v_{\theta}(A_t^{\tau}, o_t) - u\|^2
A_t^{\tau+\delta} = A_t^{\tau} + \delta\, v_{\theta}(A_t^{\tau}, o_t)
H \Delta t = 50 \times 20\ \text{ms} = 1000\ \text{ms}
C = C_{\mathrm{VLM}} + 10\, C_{\mathrm{expert}}

Where:

  • A_t \in \mathbb{R}^{H \times d} is the action chunk starting at time t, a_i one action, H the prediction horizon (16 in Diffusion Policy, 50 in π0), and d the padded action dimension.
  • O_t and o_t are the conditioning observations: for Diffusion Policy a short stack of image features and proprioception, for π0 the image tokens, language tokens, and the state token.
  • k \in \{K, \ldots, 1\} indexes discrete denoising steps and \epsilon_{\theta} is the noise-prediction network; \alpha_k, \gamma_k, \sigma_k come from the noise schedule and z \sim \mathcal{N}(0, I) is the injected sampling noise.
  • \tau \in [0,1] is the continuous flow time, \epsilon \sim \mathcal{N}(0, I) the noise endpoint, and A_t^{\tau} the linear interpolant between them.
  • u is the target velocity field of the straight path, v_{\theta} the action expert’s prediction of it, and \delta = 0.1 the Euler step, giving 10 evaluations per chunk.
  • \Delta t = 20\ \text{ms} is the control period at 50 Hz, so one chunk covers one second; C_{\mathrm{VLM}} and C_{\mathrm{expert}} are the per-pass costs of the 3B prefix and the 300M expert.
Three by three block attention matrix with rows as query blocks and columns as key blocks. The prefix row attends only to the prefix column and is marked bidirectional and cached. The state row attends to prefix and state. The action row attends to all three blocks and is bidirectional within the chunk. The remaining upper right cells are hatched as masked.

Figure 3: The blockwise causal mask is what makes the cost structure possible. Because the image and text prefix never attends to the noisy action tokens, its keys and values do not depend on \tau and stay valid across all 10 integration steps, while the action block attends bidirectionally within the chunk so every predicted timestep sees every other.

PropertyDiffusion Policy (2023)π0 (2024)
Generative processDiscrete-time DDPM, epsilon-prediction, cosine or squared-cosine scheduleContinuous-time conditional flow matching on the straight interpolant
Sampler steps100 training steps, 10 DDIM steps at inference10 forward Euler steps with fixed step 0.1
Denoiser1D temporal U-Net with FiLM, or a small transformer variant300M action expert sharing attention with PaliGemma 3B weights
ConditioningResNet image features plus proprioception, no languageUp to 3 camera views, natural-language instruction, state token
Chunk and ratePredict 16, execute 8, typically about 10 Hz controlPredict 50 actions, one second of control at 50 Hz
Embodiment scopeOne robot and task per trained policyCross-embodiment mixture, all vectors zero-padded to 18 dimensions
Dominant failure modeNo semantic generalization; the visual encoder is trained from a few hundred demosOpen-loop within a chunk, and prefill latency dominates the control budget

Login to view more content


Log in to track your progress

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *