openpi icon indicating copy to clipboard operation
openpi copied to clipboard

Question about denoising process in flow-matching

Open HomerIsAFool opened this issue 11 months ago • 1 comments

Hi all, Thanks a lot for your great work.

I have just look into the src/openpi/models_pytorch/pi0_pytorch.py, and in the forward() func(), https://github.com/Physical-Intelligence/openpi/blob/main/src/openpi/models_pytorch/pi0_pytorch.py/#L327 it calculate the x_t in a adding-noise-process x_t = time_expanded * noise + (1 - time_expanded) * actions, where time_expanded=1 means pure noise.

But when i look into the Isaac-Gr00t DiT module, it calculate the x_t in a denoising-process: noisy_trajectory = (1 - t) * noise + t * actions, where t = 1 means the ground truth actions.

My question is: what is the difference between modeling as a adding-noise-process and as a denoising process? If I write this line in π₀ as a denoising process, what impact would it have?

HomerIsAFool avatar Dec 09 '25 06:12 HomerIsAFool

Hi, I'm not from PI but chime in to provide general info. The forward() is called during training. To train a DiT with flowmaching is an add-noise process. The sample_actions() is called during inference, which is a denoising process. As you can see in the code, in forward(), x_t starts as actions. In sample_actions(), x_t starts as noise. If one writes denoising process for forward() that is intended for training a DiT with flow-matching losses to be a generative model, it is theoretically wrong. In practise, if some surprising coincidences happen, it might work, since the noise is at the end symmetric. More detail can be found if you search for diffusion model and flow-matching. They are beyond code-level implementation. I didn't search for GR00T repo but the theory remains.

einKai avatar Jan 08 '26 14:01 einKai