Summary
A normalizing flow transports a base density through invertible transformations, accounting for their local volume changes. For the differentiable bijections here, density evaluation uses the inverse coordinate and the inverse Jacobian’s absolute determinant:
An invertible coordinate is not a nontrivial VAE-style posterior distribution. Tractable discrete-layer likelihood and fast sampling depend on the selected architecture; neither property uniquely belongs to flows.
The change-of-variables formula
Require a differentiable inverse and nonzero Jacobian determinant on the relevant support. For :
For a composition of flows, the log-determinant decomposes additively:
Evaluate each layer’s determinant at its actual intermediate state. Evaluate standard Gaussian density at . Set and . The states are , with determinant factors two and . The local area triples while probability mass is conserved, so . Gaussian log density gives:
Change of variables
Expanding volume lowers density while preserving probability mass
Derivation
What happens to density if the same mass occupies twice the area?
Inverting returns ; multiplying its transformed density by tripled local area recovers the same mass.
RealNVP / coupling layers (the workhorse)
Split . Then:
The Jacobian is block triangular, with log absolute determinant . Inverse reconstruction uses and . The internal s/t networks need not themselves be invertible.
Stack many coupling layers, alternating which half passes through, with shuffles or 1×1 convs between them.
Change a Scale into Coupling
New task: Use , through constant , .
Picture and change: Apply the triangular coupling and evaluate its explicit inverse.
Check: maps to , determinant two; inverse second coordinate is .
Use when: A structured invertible layer needs a tractable determinant without inverting its internal neural networks.
Change the Required Fast Direction
New task: Prioritize density scoring in three coordinates over generation latency.
Picture and change: In MAF, known x prefixes support masked parallel inverse-coordinate evaluation. Sampling must resolve the x prefixes sequentially; IAF reverses this directional convenience.
Check: Generating x1, x2, x3 takes three dependent coordinate stages in this ordering.
Use when: Density queries and sample generation have different serving priorities.
The map is not a bijection on the real line: positive and negative z collide. Using only one inverse branch in the stated formula loses probability mass.
Common flow families
| Family | Structure | Important limit |
|---|---|---|
| Coupling | Triangular Jacobian; NICE is an additive special case | Expressiveness needs suitable compositions |
| MAF/IAF | Autoregressive coordinate dependence | Fast direction differs |
| Continuous time | ODE and divergence integration | Solver/trace estimation introduces numerical or Monte Carlo error |
| Invertible channel mixing | Learned nonsingular linear transform | Retain determinant and conditioning checks |
When to use flows in 2026
Compare density estimation, simulation-based conditional inference, forecasting, and generative tasks under their actual accuracy and compute criteria. A high likelihood does not automatically identify in-distribution semantics or provide a reliable anomaly/OOD score. Do not infer a universal image-quality or training-speed ranking from model-family names.
Common pitfalls
- Wrong determinant direction: density evaluation adds inverse log determinant, equivalently subtracting forward log determinant.
- Discrete observations: dequantization models a continuous auxiliary distribution; relate its density objective to discrete likelihood explicitly.
- Numerics: finite precision, nearly singular transforms, and ODE tolerances can invalidate an unqualified “exact” claim.
Related
- Variational autoencoders. Alternative latent-variable generative model.
- Autoregressive vs. diffusion. Broader paradigm comparison.