← AI Terminology

Flow Model

A flow model (normalising flow) is a generative model that learns an invertible mapping between a simple distribution (e.g. Gaussian) and the complex data distribution — enabling exact likelihood computation and efficient sampling in both directions.

Unlike GANs or diffusion models, flows are exact: every data point can be mapped to a latent code and back, with exact log-likelihood.
Why It Matters in AI
Flow models offer something diffusion models and VAEs don't: exact log-likelihood evaluation, which is valuable for density estimation, anomaly detection, and scientific applications where uncertainty quantification matters. RealNVP and Glow generated impressive images; modern variants (normalising flows + transformers) are used in molecule generation and audio synthesis. For most image generation tasks, diffusion models have overtaken flows in quality.
Key Points
Aspect Description
Invertible f and f⁻¹ both computable — encode data to latent and decode latent to data exactly
Limitation Require invertible architectures — less expressive than unconstrained networks of same size
Applications Density estimation, anomaly detection, audio (WaveGlow), molecular design, latent-space manipulation
Autoregressive MAF, IAF — model each dimension conditioned on previous ones — flexible but slow to sample
Change of vars log p(x) = log p(z) + log
Coupling layers RealNVP: split x into two halves, transform one conditioned on the other — tractable Jacobian
Simple Analogy
A rubber sheet stretched and folded in a specific, reversible way to map a circle into a complex shape. You can unfold it (inverse) to go back to the circle — and you know exactly how much the sheet stretched at every point (Jacobian determinant). Flows are generative models whose "folding operation" is carefully engineered to be exactly reversible.
Common Usage Examples
  • nflows Python library: flow = zuko.flows.NSF(features=10, context=5) — neural spline flow
  • WaveGlow: flow-based speech synthesis from mel-spectrograms — real-time on GPU
  • Glow (OpenAI): image generation with flows — enables semantic face attribute manipulation
  • Molecular generation: normalising flows sample over molecular conformations with exact likelihood
  • Anomaly detection: train flow on normal data; log-likelihood of new points flags anomalies
Summary
In short: Flow models are generative models with exact invertible mappings between data and noise — offering exact likelihoods and bidirectional generation at the cost of architectural constraints.