Understand the technology
Understand the mapping before the mathematics.
For May and November 2027. This lesson is higher level only. SL students are not required to study this hybrid-model content. HL students need a broad understanding of flow-based models.
01 | TRANSFORM DATA WITHOUT LOSING THE WAY BACK
Some calculations are easy to reverse. If a rule multiplies a value by 2 and adds 3, the reverse rule subtracts 3 and divides by 2.
A flow-based generative model , in the normalizing-flow sense discussed here, learns a sequence of invertible transformations between a simple distribution and a more complex data distribution.
The case study introduces flow-based models as possible hybrid components. HL students need a broad understanding: focus on the mapping, its reverse and the limits of what that means.
02 | WHAT IS A MAPPING?
A mapping associates inputs with outputs according to a rule. A model’s learned mapping is defined by its operations and parameter values.
For a reversible mapping, the output retains enough information to recover its corresponding input. There must not be two different permitted inputs that become the same output.
Using the same trained parameters is essential when applying the reverse. A different checkpoint can define a different mapping.
03 | A ONE-TO-ONE RELATIONSHIP
An invertible mapping has an inverse on its stated domain and output range. Each output in that range corresponds to one input.
For the rule y = 2x + 3, x = 4 gives y = 11. Applying x = (y − 3) ÷ 2 recovers 4.
This simple rule illustrates invertibility. Real image models combine many learned transformations; one arithmetic rule is not a trained image generator.
04 | SEE WHAT BREAKS REVERSIBILITY
The rule y = x² is not one-to-one over all real numbers: both 2 and −2 produce 4. Without additional information, the result does not tell us which input was used.
Cropping an image or rounding values can also discard information. A later computation cannot generally recover discarded details exactly from the remaining data alone.
Invertibility depends on the domain. Squaring restricted to non-negative inputs has a different reversibility question from squaring over all real numbers.
05 | SIMPLE NOISE AND COMPLEX IMAGES
A flow model can begin with a simple base distribution, often a standard Gaussian distribution. A sampled latent value is transformed into data-like output.
During learning, the transformations are adjusted to model the distribution of training examples. The goal is not simply to shuffle arbitrary noise and hope an image appears.
Different samples can lead to different outputs under the same learned mapping. The exact distribution and architecture depend on the chosen model.
06 | CHOOSE A DIRECTION AND LABEL IT
We will write generation as
x = g(z)
: latent sample z is mapped to data x. The reverse is
z = g⁻¹(x)
.
Some explanations use the symbol f for the data-to-latent direction instead. The letter matters less than clearly labelling which direction is being discussed.
Base-distribution sample z → learned invertible mapping → data x.
Data x → inverse of that same mapping → corresponding z.
These are two directions of a defined transformation, not two unrelated networks that merely try to approximate each other.
07 | REVERSE A CHAIN IN THE RIGHT ORDER
Imagine two stages: first multiply by 2, then add 3. To reverse the full chain, subtract 3 first, then divide by 2.
For z = 4: 4 → 8 → 11. Reversing gives 11 → 8 → 4. Undoing operations in the wrong order generally produces the wrong input.
A flow composes multiple invertible stages. The inverse applies the inverse stages in reverse order.
08 | A TWO-COMPONENT EXAMPLE
Let z = [a, b]. Define x₁ = a and x₂ = b + 2a. For z = [3, 4], the output is x = [3, 10].
Recover a = x₁ = 3, then b = x₂ − 2x₁ = 10 − 6 = 4. The information needed to reverse the operation remains available.
This is a deliberately small coupling-style illustration, not a complete trained flow. It shows how one component can help transform another without losing the original pair.
09 | WHY ARCHITECTURE MATTERS
A conventional normalizing flow needs transformations that are both invertible and computationally manageable. Arbitrary neural-network layers do not automatically satisfy those conditions.
Coupling transformations are one way to build useful invertible stages. Parts of the input influence how other parts change, while the inverse remains calculable.
There are many possible designs. The case study does not require students to implement coupling layers or derive advanced mathematics.
10 | DIMENSIONS ARE NOT SIMPLY DISCARDED
In a standard continuous bijective flow, the complete latent representation and data representation have the same total dimensionality. Intermediate rearrangements can change shape without discarding components.
This differs from assuming that any small compressed code can exactly reconstruct a much larger unrestricted input.
Advanced variants can alter these assumptions, but for this broad explanation remember that exact invertibility places constraints on the representation. It is not ordinary lossy compression with an extra reverse button.
11 | LEARNING USES PROBABILITY DENSITIES
Because the mapping is invertible and designed with tractable calculations, a flow can relate a data density to its base density using a change-of-variables rule.
Training can maximise the likelihood of examples under that model. A Jacobian determinant accounts for how the transformation expands or contracts local volume.
Those terms explain why flow architectures are designed carefully. You do not need to calculate determinants here; the key is that probability modelling and invertibility work together.
12 | LIKELIHOOD IS NOT A CREATIVE QUALITY SCORE
A model’s density or likelihood measures fit under its probability model. It is not a direct rating of beauty, brand suitability or factual accuracy.
For continuous data, density at a point is not the probability of that exact single point. Avoid saying that a density value automatically expresses “the percentage chance this image is good”.
Visionary Studios should inspect generated quality and useful variety even when the model supports tractable density evaluation.
13 | WHAT DOES EXACT REVERSIBILITY MEAN?
Mathematical invertibility means that applying the inverse to a mapped value recovers its corresponding input in the defined model.
Computer arithmetic has finite precision. Rounding, clipping, quantisation or export operations outside the invertible chain may lose information, so a displayed or saved image need not preserve exact reversibility.
Digital image modelling may include preprocessing or dequantisation. The relevant domain and pipeline must be specified rather than promising universal byte-for-byte recovery of any uploaded file.
14 | TRACEABILITY IS NOT A SEMANTIC EXPLANATION
The booklet associates reversible mappings with tracing how an image was formed. Inverting a defined mapping can recover the corresponding latent values and lets us follow the computational route.
That does not automatically explain why a particular face or style emerged in human terms. Latent coordinates may still be difficult to interpret.
It also does not reveal a unique training photograph that caused the output, establish ownership or prove that the result is ethically acceptable.
15 | COMPARE WITH A VAE
A VAE encoder estimates a latent distribution and its decoder reconstructs approximately under a learned objective. The two paths are not generally exact inverses.
A standard flow instead uses a defined invertible mapping, with architectural and dimensional constraints that support reversing it.
Both use latent representations and probability, but those shared words do not make their mechanisms identical. Neither guarantees exact control of every artistic attribute.
16 | POSSIBLE ROLE IN A HYBRID
A hybrid could use an invertible component where a reversible transformation or tractable probability calculation is useful, alongside another component serving a different purpose.
The whole system is not automatically invertible. If another stage crops, compresses lossily or performs a non-invertible transformation, the complete route may lose information.
Explain which component supplies which capability. Combining model names is not sufficient evidence of improved quality, speed or transparency.
17 | APPLY IT TO VISIONARY STUDIOS
Assess quality, useful variation, resource use and practical control. The case study does not prescribe a specific flow architecture for the company.
18 | TEST YOUR REVERSIBLE EXPLANATION
In your book, reverse the rule y = 2x + 3 for y = 11. Then recover the input of the two-component example from x = [3, 10].
Explain why cropping after generation can break full recovery, and distinguish recovering a latent value from identifying the training source of an image.
Reveal a possible explanation
For y = 11, x = (11 − 3) ÷ 2 = 4. For [3, 10], a = 3 and b = 10 − 2 × 3 = 4, giving [3, 4]. Cropping discards output information required by the original inverse.
The inverse identifies the latent value associated with that output under the mapping. It does not identify a unique training photograph or provide a complete semantic explanation.
HL only. The booklet requires broad understanding of flow-based models. Numerical examples and technical qualifications here are independent teaching explanations.
CHECK YOUR UNDERSTANDING | FOLLOW THE MAPPING