TL;DR
MeanFlow-RAE combines few-step MeanFlow generative models with Representation Autoencoders (RAEs) to drastically accelerate both training and inference. By replacing the heavy Stable Diffusion VAE decoder and stabilizing training with a trajectory-aware initialization and distillation pipeline, it achieves state-of-the-art 1-step image generation quality on ImageNet while slashing training costs by 83% and inference computation by 38%.
What Problem Does This Paper Address?
Diffusion and flow matching models generate stunning images but are notoriously slow because they require dozens or hundreds of sequential neural network evaluations (NFEs) to generate a single sample. "Flow map" models like MeanFlow (MF) solve this by learning to take "long jumps" from noise directly to clean data in just one or two steps.
However, when applied to high-dimensional images, vanilla MF relies on the standard Stable Diffusion VAE (SD-VAE) latent space. Surprisingly, as shown in Figure 1, the SD-VAE decoder is so computationally heavy that it consumes roughly 73% of the total generation cost, bottlenecking the speedups gained from few-step sampling. Furthermore, training MF is highly unstable (prone to gradient explosions), requires expensive Jacobian-vector products (JVPs), and demands tedious tuning of classifier-free guidance (CFG) hyperparameters.
Methods
The authors introduce MeanFlow-RAE (MF-RAE), which addresses these bottlenecks through a redesigned architecture and training pipeline:
- RAE Latent Space & DiT$^{DH}$ Architecture: Instead of SD-VAE, they use a Representation Autoencoder (RAE) consisting of a frozen semantic vision encoder (like DINOv2) and a lightweight ViT decoder. They adapt the DiT$^{DH}$ backbone to explicitly encode both absolute time ($t$) and time differences ($t-s$).
- Consistency Mid-Training (CMT) Initialization: Naive training in the high-dimensional RAE space causes immediate gradient explosion. The authors use CMT to provide a trajectory-aware initialization based on a pre-trained flow-matching teacher, stabilizing the weights before the main training phase.
- Two-Stage Training (MFD + Bootstrapping): They first perform MeanFlow Distillation (MFD) from the teacher to minimize variance. Then, they introduce an optional bootstrapping phase using a one-point velocity estimator (MeanFlow Training, or MFT) to break past the teacher's performance ceiling.
- Finite-Difference JVP Approximation: They replace exact Jacobian-vector products with a finite-difference approximation, speeding up training by ~1.5x and making it compatible with modern components like Flash Attention without custom implementations.
Datasets
The model was trained and evaluated on the standard class-conditional ImageNet 256×256 and scaled up to ImageNet 512×512 benchmarks.
Key Insights and Ideas
- The Decoder is the Real Bottleneck: In few-step generation, the transformer backbone is no longer the primary computational sink; the VAE decoder is. Shifting to an RAE cuts decoder costs by nearly 3x (from 310 GFLOPS to 106 GFLOPS).
- Guidance-Free Conditional Generation: Thanks to the semantically rich latent space provided by the RAE's vision encoder, MF-RAE achieves high-quality class-conditional generation without any classifier-free guidance (CFG), eliminating complex hyperparameter grid searches.
- Breaking the Teacher Ceiling: The authors' theoretical analysis shows that while distillation (MFD) reduces variance, it inherits the teacher's bias. Following it with a brief one-point estimation (MFT) phase reduces this bias, allowing the student to outperform its teacher.
Key Results
- ImageNet 256: Achieved a state-of-the-art 1-step FID of 2.03 (outperforming vanilla MF's 3.43).
- Computation Slashing: Reduced total training cost by 83% (from over 600 H100 GPU-days down to just 100). Sampling computation dropped by 38% (from 424 GFLOPS to 263 GFLOPS).
- ImageNet 512: Scaled successfully to 512x512 resolution, achieving a competitive 1-step FID of 3.23 while maintaining the lowest computational cost (1051 GFLOPS) among all baselines.
Limitations and Future Work
The authors note that the performance of MF-RAE is inherently bounded by the reconstruction fidelity of the underlying RAE. Additionally, while this work deliberately avoids guidance techniques to simplify the pipeline and reduce hyperparameter tuning, exploring how advanced guidance methods could be integrated into the RAE latent space remains an open and promising direction for achieving even higher image quality.
Summary updated