STARFlow: Scaling Latent Normalizing Flows for High-resolution Image Synthesis

Jiatao Gu, Tianrong Chen, David Berthelot, Huangjie Zheng, Yuyang Wang, Ruixiang Zhang, Laurent Dinh, Miguel Ángel Bautista, Joshua M. Susskind, Shuangfei Zhai

Normalizing Flows (NFs) have long been considered the "elegant but difficult" sibling in the generative modeling family. While Diffusion models conquered image quality and Autoregressive (AR) models mastered discrete sequences, NFs—which offer exact likelihood estimation and invertible mappings—have historically struggled to scale to high resolutions.

Apple’s new paper, STARFlow, changes that narrative. It represents the first successful demonstration of normalizing flows at the scale and resolution required for modern text-to-image synthesis.

High-resolution images generated by STARFlow

TL;DR

STARFlow is a 3.8-billion parameter generative model that proves Normalizing Flows can compete with state-of-the-art Diffusion and Autoregressive models. By utilizing a "deep-shallow" transformer architecture and modeling in latent space, it achieves high-fidelity image synthesis while maintaining the mathematical elegance of exact maximum likelihood training.

The Scalability Gap in Generative AI

Generative AI currently faces a significant trade-off:

  • Diffusion models produce incredible images but require expensive, iterative denoising processes.
  • Autoregressive models (like those powering LLMs) are fast but typically require "quantizing" images into discrete tokens, which can lead to information loss and visual artifacts.

Normalizing Flows theoretically offer the best of both worlds: they operate in continuous space (avoiding quantization) and can be trained using exact maximum likelihood. However, previous attempts to scale them (such as TARFlow) were computationally inefficient and struggled with the complex dependencies of high-resolution pixels. STARFlow was designed specifically to bridge this "scalability gap."

Core Innovations

The researchers built STARFlow on three major architectural and algorithmic innovations:

Diagram illustrating the autoregressive flow architecture
  1. Deep-Shallow Architecture: Instead of spreading model capacity evenly across many flow blocks, STARFlow uses one massive "deep" Transformer block (acting as a Gaussian Language Model) followed by several "shallow" blocks. The deep block handles the heavy lifting of global structure, while the shallow blocks act as a computationally cheap yet highly effective learned refinement stage.
  2. Latent Space Modeling: Following the success of models like Stable Diffusion, STARFlow operates in the latent space of a pretrained autoencoder rather than on raw pixels. This drastically reduces the sequence length the Transformer must process, making high-resolution generation feasible.
  3. Principled Gaussian Guidance: Classifier-Free Guidance (CFG) is the "secret sauce" for text-to-image quality. Previous flow models used a naive linear extrapolation for guidance that became unstable at high weights. STARFlow introduces a novel guidance algorithm derived from score functions that remains stable even when pushed to extremes.

Crucially, despite these additions, the model remains a single, end-to-end invertible flow, allowing for exact density estimation.

Key Insights and Theoretical Foundations

  • The Universality of 2-Block Flows: The authors provide a theoretical proof showing that just two blocks of autoregressive flows with alternating orderings are sufficient to model complex continuous distributions. This justifies why the architecture doesn't require dozens of expensive flow layers.
  • Compute Skewing: They discovered that "effective compute" concentrates in the layers closest to the noise. By making the first block deep and subsequent blocks shallow, they achieved a $2\times$ speedup in inference without sacrificing quality.
  • NFs ❤️ Latents: Normalizing Flows align naturally with compressed latents. Because NFs model continuous densities, they avoid the "quantization gap" that plagues discrete AR models when trying to reconstruct fine details from VAE latents.

Performance and Results

The models were trained on massive datasets, including ImageNet-1K, CC12M, and an in-house collection of ~700M text-image pairs.

  • State-of-the-Art NF Performance: On ImageNet-256, STARFlow achieved an FID of 2.40, significantly outperforming the previous TARFlow baseline (5.56) and rivaling top-tier Diffusion models like DiT (2.27).
  • Zero-Shot Excellence: On the COCO text-to-image benchmark, the model achieved an FID of 9.1, placing it ahead of many established models like DALL-E 2 and GigaGAN.
  • Multimodal Versatility: Because the model is invertible, it can perform image inpainting and interactive editing (e.g., "change the cat to a dog") via simple fine-tuning, often outperforming diffusion-based editing which requires complex inversion tricks.

Limitations and Future Work

While a breakthrough for Normalizing Flows, STARFlow still faces hurdles:

  • Inference Speed: While faster than many diffusion setups, the autoregressive nature of the deep block means tokens are still generated sequentially, which remains a bottleneck for very high resolutions.
  • Pretrained Dependencies: The model currently relies on a fixed, pretrained VAE. Jointly training the latent space and the flow model is a promising next step.
  • Modality Expansion: The current work is limited to images. Extending this scalable flow architecture to video or 3D scenes remains an open research question.

Project Resources: Code and weights are available at github.com/apple/ml-starflow.

Summary updated

BibTeX
@inproceedings{gu2025starflow,
  author = {Jiatao Gu and Tianrong Chen and David Berthelot and Huangjie Zheng and Yuyang Wang and Ruixiang ZHANG and Laurent Dinh and Miguel Ángel Bautista and Joshua M. Susskind and Shuangfei Zhai},
  title = {{STARFlow: Scaling Latent Normalizing Flows for High-resolution Image Synthesis}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2025},
  url = {https://openreview.net/forum?id=3YguS2rxdk},
}
Figure