pi-Flow: Policy-Based Few-Step Generation via Imitation Distillation

Hansheng Chen, Kai Zhang, Hao Tan, Leonidas Guibas, Gordon Wetzstein, Sai Bi

TL;DR

$\pi$-Flow breaks the quality-diversity trade-off in few-step generative model distillation by having the student network predict a cheap, network-free trajectory policy instead of a direct shortcut to the data. Combined with an on-policy imitation distillation algorithm ($\pi$-ID), it enables high-fidelity, structurally coherent, and highly diverse image generation in as few as 1 to 4 network evaluations.

What Problem Does This Paper Address?

While diffusion and flow-matching models generate stunning images, their iterative denoising process is computationally expensive, requiring dozens of sequential neural network evaluations (NFEs) to solve a probability flow ODE.

To speed things up, distillation methods try to compress these models into few-step generators. However, traditional approaches force the student network to predict a direct "shortcut" from noise to clean data. This creates a format mismatch: the teacher predicts local velocities, while the student tries to jump across the entire trajectory. To bridge this gap, researchers rely on complex training objectives like adversarial losses (GANs) or Variational Score Distillation (VSD). Unfortunately, these often lead to training instability, severe text-rendering artifacts, or mode collapse (a catastrophic loss of sample diversity).

Methods

The authors introduce $\pi$-Flow (Policy-Based Flow Models), which rethinks the student's role. Instead of predicting a single velocity or a shortcut, the student network outputs an entire network-free policy ($\pi$) at a given timestep.

Comparison of standard, shortcut-predicting, and policy-based models.

This policy is a cheap parametric function (such as a factorized Gaussian Mixture Model, termed the GMFlow policy) that can compute velocities for future substeps analytically. This allows the system to perform dense, accurate ODE integration over multiple substeps with virtually zero extra computational overhead—bypassing the need for additional network evaluations.

To train this model, the authors propose $\pi$-ID (Policy-Based Imitation Distillation), an on-policy imitation learning scheme inspired by the DAgger algorithm:

  1. The student network generates a policy and rolls out its own trajectory.
  2. Intermediate states along this rollout are sampled.
  3. The frozen teacher model is queried at these exact intermediate states to provide a "corrective" velocity signal.
  4. The student policy is optimized to match the teacher's velocity using a simple $\ell_2$ flow matching loss.
Figure 3: On-policy flow imitation dis- tillation. Intermediate states are sampled along the detached policy rollout, where the loss matches the policy to the teacher.

Additionally, the authors introduce GM Dropout to stochastically perturb rollouts during training (boosting policy robustness) and Micro-window Velocity Matching to smooth out local trajectory variations and reduce image blur.

Datasets

The method was validated across several major benchmarks:

  • ImageNet $256\times256$: Used for class-conditioned generation using a Diffusion Transformer (DiT) architecture.
  • COCO-10k / HPSv2 / OneIG-Bench: Used to evaluate high-resolution ($1024\times1024$) text-to-image generation.
  • Distillation Targets: The authors distilled state-of-the-art large-scale models, specifically FLUX.1-12B and Qwen-Image-20B, using a dataset of 2.3M one-megapixel images captioned by Qwen2.5-VL (as well as a data-free variant using only prompt text).

Key Insights and Ideas

  • Decoupling NFEs from Integration Substeps: The core realization is that ODE integration itself isn't slow; evaluating a multi-billion parameter neural network at every step is what hurts performance. By outputting a closed-form parametric velocity field, $\pi$-Flow retains the mathematical benefits of dense ODE integration for free.
  • On-Policy Error Bounding: Traditional off-policy distillation suffers from compounding errors that scale quadratically ($O(n^2\epsilon)$). By training the policy on its own rollouts ($\pi$-ID), the teacher teaches the student how to recover from its own mistakes, dropping the error bound to linear ($O(n\epsilon)$).
  • Simplicity via Format Alignment: Because the student policy predicts velocities and the teacher evaluates velocities, the distillation objective simplifies to a standard $\ell_2$ regression loss. This avoids the complex auxiliary networks, adversarial tuning, or expensive Jacobian-vector products (JVPs) required by competing methods.

Key Results

  • State-of-the-Art 1-NFE Performance: On ImageNet $256\times256$, $\pi$-Flow achieved a 1-NFE FID of 2.85, outperforming all previous 1-NFE DiT models (such as Consistency Trajectory Models and MeanFlow).
  • Preserving Teacher Diversity: When distilling FLUX.1-12B and Qwen-Image-20B down to 4 steps, $\pi$-Flow completely avoided the mode collapse typical of VSD/DMD methods, matching the structural diversity and text-rendering capabilities of the original 50-step teacher models.
Qualitative comparison of diversity between $\pi$-Flow and VSD/DMD methods.
  • Negligible Overhead: In inference benchmarks, running 32 policy integration substeps took only ~14–15 milliseconds, accounting for a mere 3% of the total network evaluation time.

Limitations and Future Work

A key challenge emerged when distilling the FLUX.1 dev model. Because FLUX.1 dev is already a guidance-distilled model rather than a pure flow model, it is highly sensitive to out-of-distribution states. The authors had to implement a specialized "scheduled trajectory mixing" strategy to stabilize training.

For future work, the authors suggest exploring even more robust policy families, refining the distillation objectives further, and extending the $\pi$-Flow paradigm to video generation tasks.

Summary updated

BibTeX
@inproceedings{chen2026pi,
  author = {Hansheng Chen and Kai Zhang and Hao Tan and Leonidas Guibas and Gordon Wetzstein and Sai Bi},
  title = {{pi-Flow: Policy-Based Few-Step Generation via Imitation Distillation}},
  booktitle = {International Conference on Learning Representations},
  year = {2026},
  url = {https://openreview.net/forum?id=1vAte8dsap},
}
Figure