Generative models and how they're built
· 29 min read · Updated Nov 2, 2026
Digests are written primarily by LLMs with only readability edits by me. If this one reads like slop, please shoot me an email at max.zhuang@berkeley.edu.
An image generator can contain several kinds of model, each doing a different job. DiT, the Diffusion Transformer introduced in 2022, uses an autoencoder to represent images as smaller arrays, a diffusion process to generate new arrays, and a transformer to make the predictions that process needs. Its authors took the autoencoder off the shelf from earlier work, kept an earlier model’s diffusion training settings, and replaced the network. Because the autoencoders they tried shared one encoder and differed only in their decoders, they could even swap decoders without retraining the diffusion model. DiT
So a generator can be read as a set of parts with separate jobs. Four of them recur through this digest: the representation the generator works in, the training target that says what the network should predict, the network that computes each prediction, and the sampler that turns many predictions into one output. Researchers can change one part while keeping the others, though the parts constrain each other: a representation that keeps more detail can need a larger network to generate as well as a coarser one does.
What does each part do, and when a new model makes better samples, which part deserves the credit? Following an image through DiT’s parts, then through models that change one or more of them, gives these answers:
- Latent diffusion runs the generator’s many network calls on an autoencoder’s smaller array, which makes each call cheaper: DiT’s array has 64 times fewer positions than the image. In the latent-diffusion paper’s fixed-budget comparison, moderate compression gave the best images; too little compression slowed training and too much made quality stop improving early; the authors attribute the first to leaving perceptual compression to the diffusion model, the second to information the autoencoder discarded.
- Diffusion trains on a question whose answer is known: mix noise we drew ourselves into a real example and ask the network for that noise. Training needs one such prediction at a time; only generation chains them, starting from pure noise.
- DiT replaced the U-Net, the network earlier image-diffusion systems commonly used, with a transformer working on patches of the array. In its ImageNet experiments, more computation per prediction gave better image scores, whether it came from a larger network or from smaller patches, which add computation without adding parameters. At about the same computation, larger networks on 8-by-8 patches scored worse than smaller networks on finer patches.
- Flow matching trains the network to predict a velocity along a chosen path from noise to data. Straight training paths can still give curved generation paths, because where training paths cross, squared-error training gives the network the average of their velocities.
- In Stable Diffusion 3’s comparison of 61 training formulations, rectified flow beat the older diffusion recipe only when training also changed how often it drew each noise level. Its new network and its richer autoencoder were separate tests, and the richer autoencoder needed a deeper network to match a coarser one.
- Images can also be generated as a sequence of discrete tokens: one per step in a fixed order (autoregression), or many per round, keeping the confident ones (MaskGIT: 8 rounds, where one-at-a-time decoding takes 256). When fine-tuned on facts stated in one order, masked diffusion language models answered reversed questions more often than autoregressive ones.
- A GAN replaces the constructed target with a second network that learns to tell generated examples from real ones, and commonly generates in one pass. A normalizing flow keeps maximum-likelihood training and builds its generator from invertible maps, so the likelihood can be computed exactly.
- A diffusion sampler and a looped transformer both run one network repeatedly, but diffusion training sets a target at every sampled noise level, while a looped transformer trained at its readout gives its intermediate passes no target of their own. On this digest’s reading, the difference lies in those training tasks, not in a limit of either architecture.
- On this digest’s reading, credit for a gain goes to the part a controlled comparison changed, at the settings of the parts it held fixed. A comparison between whole systems, such as Stable Diffusion 3’s human ratings against other models, cannot say which of their differences mattered.
Latent diffusion
A diffusion model runs its network on the image many times while generating it, so the size of what it processes sets the cost. Latent diffusion does that repeated work on an autoencoder’s smaller array instead of on pixels; in the paper’s comparison at a fixed training budget, moderate compression gave the best images.
An encoder turns an image into an array of learned features; a decoder turns the array back into pixels. Together, these form an autoencoder. It is trained to reconstruct its input: the decoder’s output should reproduce the image the encoder was given. Rombach et al.
The smaller array is called a latent representation. Its values are learned features, so it needn’t look like a miniature photograph. DiT’s pretrained autoencoder, for example, represents a 256-by-256 color image as a 32-by-32 grid with four feature values at each position. That is 64 times fewer positions than the image has pixels, and 4,096 numbers in place of 196,608, 48 times fewer. DiT
Now train a separate generator on those arrays. To produce a new image, generate an array and pass it through the decoder. The encoder is needed to prepare training examples; generating a new image doesn’t require an input photograph. The diagram below shows where each part runs.
This division lets the autoencoder concentrate on representing images while the generator learns which representations to produce. It also introduces a tradeoff, which the latent-diffusion paper measured with the network size and training budget held fixed. When each side of the image shrank by only 1 or 2 times, training progressed slowly; the authors attribute this to leaving the diffusion model to handle imperceptible detail itself.
With much stronger compression, image quality stopped improving early, which the authors attribute to information the autoencoder had discarded. Shrinking each side 4 or 8 times gave the best results, so at that fixed budget moderate compression gave better images than either extreme, with cheaper calls than light compression. Latent diffusion
Variational autoencoders
DiT’s autoencoder is a variational autoencoder, or VAE, a kind of model that can generate images on its own. In latent diffusion it encodes and decodes, and a separate generator learns which arrays to produce. So “uses a VAE” needn’t mean the VAE generates the final image by itself. It may supply one component of a larger system.
In a basic VAE, the encoder predicts a distribution over latent values for each input. A sampled value goes through the decoder, which predicts a distribution over reconstructed examples: for real-valued images, a Gaussian with a mean for each pixel value. Training balances reconstruction against a penalty for departing from a chosen prior, a distribution we can sample without having an image. A Gaussian, or bell-shaped, distribution is a common choice. Kingma and Welling
A VAE can therefore generate on its own: sample a latent value from the prior, then sample an example from the decoder’s distribution. In latent diffusion, a more expressive generator, one able to fit a more complicated distribution, learns the distribution of encoded images instead. The autoencoder supplies the smaller space that generator works in. VAE tutorial
The original latent-diffusion paper tried two ways of keeping the latent values from spreading arbitrarily: a VAE-style prior penalty, and an alternative that replaces each position with one of a learned collection of discrete codes. In the VAE-style autoencoder that DiT reuses, the penalty for departing from the prior is weighted by a factor of about one millionth. The authors keep it that small so reconstructions stay faithful; its job is only to stop the latent values taking an arbitrary scale. Latent diffusion
What makes an autoencoder “variational”?
The encoder approximates the distribution of latent values that could explain an observed example. This approximation defines an evidence lower bound, or ELBO, on the example’s log likelihood. Joint training of the encoder and decoder maximizes that bound. Its usual form produces the reconstruction and prior-matching terms described above.
For independent Gaussian latent coordinates, the encoder predicts a mean and standard deviation for each coordinate. A sample is the predicted mean plus the predicted standard deviation times a draw of standard Gaussian noise. Separating the randomness this way lets derivatives pass through the learned mean and scale: the reparameterization trick.
Image-generation autoencoders can also use perceptual and adversarial losses. A VAE component in such a system needn’t be trained with only the textbook objective. VAE tutorial, Latent-diffusion autoencoder
Denoising diffusion
The autoencoder has made the image smaller, but something still has to learn to generate its arrays. Diffusion trains a network on a question whose answer we know, the noise we mixed into a real example; training needs one such prediction at a time, and only generation chains them.
Take a real example, either pixels or an encoded image, and mix it with Gaussian noise. Choose how much noise to add; that amount is the noise level, and this noising direction is called the forward process. Show the noisy result and its noise level to a network, and ask it to predict the noise. Because we sampled the noise, we know the answer. The loss, the numerical error minimized during training, compares the prediction with that answer. Ho et al.
Follow one value of the array to see the answer being built. Say the real value is 0.8 and the noise drawn for it is −1.2. At the noise level where Ho and colleagues’ recipe weights the two equally, it multiplies each by about 0.71, the square root of one half. The network sees about −0.28 and the noise level, and the answer it should give is −1.2. Knowing the noise recovers the value: subtract 0.71 times −1.2 from −0.28 and divide by 0.71 to get 0.8 back.
Training one denoising prediction doesn’t require generating an entire image. We can directly construct a noisy example at a randomly selected level and train on that one prediction, so the error is never passed back through the whole generation chain. Ho et al.
Generation assembles those predictions into a longer process. At each generation step, a sampler uses the network’s prediction to update the current array. The sampler specifies the update size and whether to add fresh randomness. The same network is called again at the next noise level. One reason to take small steps: from pure noise the input does not say which image was meant, so a single jump would land on an average of many images. The flow-matching section shows this for velocity targets. The diagram below sets this chain beside training.
The Diffusion Transformer
With the training target settled, which network should make each prediction? DiT asked whether diffusion needs the U-Net that earlier image systems commonly used, and tried a standard transformer working on patches of the latent in its place. In its ImageNet experiments, a larger network or smaller patches each added computation per prediction and gave better image scores.
Early image-diffusion systems commonly used a U-Net. It processes features at successively coarser resolutions, then restores finer resolution while incorporating features from earlier stages. This combines broad context with local detail. The architecture originated in biomedical image segmentation, and its organization was adopted for denoising. U-Net, Diffusion models
DiT replaces that network with a transformer, an architecture first built for translating text. It divides the noisy latent array into patches and treats each patch as a token, one element in the network’s input sequence. Attention lets these tokens combine information from other positions. The output supplies diffusion predictions for the sampler. DiT, Transformer
This is a transformer working on an entire noisy representation. It doesn’t need to generate the image one token at a time. The architecture specifies the computations used to make a prediction; it doesn’t, by itself, specify what that prediction should be. DiT kept an earlier model’s diffusion settings, so its own comparisons between networks share one training target.
DiT’s experiments also showed why counting parameters can miss an important change. Smaller patches give the same network more tokens to process, increasing computation without increasing its parameter count. On the 32-by-32 latent, patches 8 positions on a side give 16 tokens, patches of 4 give 64, and patches of 2 give 256. Each halving of the patch side quadruples the tokens and roughly quadruples the computation, with no meaningful change in parameters.
Both this change and larger networks improved FID, the paper’s automated comparison of generated and real image collections. Among its models on 4-by-4 and 2-by-2 patches, those with similar computation reached similar scores even when their parameter counts differed, as its small model on 2-by-2 patches and its base model on 4-by-4 patches did. Larger networks on 8-by-8 patches scored worse than smaller networks on finer patches with about the same computation. The chart below plots the paper’s twelve configurations, four network sizes on three patch sizes each, against the computation each prediction takes. DiT experiments
- 8-by-8 patches, 16 tokens
- 4-by-4, 64 tokens
- 2-by-2, 256 tokens
S, B, L and XL are DiT's small, base, large and extra-large networks, and S/2 is the small network on 2-by-2 patches · FID-50K without guidance after 400K training steps, class-conditional ImageNet at 256 by 256 · the shaded band holds the four models between 5.0 and 7.4 Gflops
Flow matching
Generation calls the network many times, and a straighter path from noise to data could be followed in fewer calls. Flow matching trains the network along a chosen path, but straight training paths can still give curved generated ones, because training pairs noise and data at random and their straight paths cross. In Stable Diffusion 3’s comparison of 61 formulations, rectified flow beat the older diffusion recipe only when training also changed how often it drew each noise level.
The research behind Stable Diffusion 3, published in 2024, combines a transformer with rectified flow, which belongs to the closely related methods called flow matching. These methods train a network to predict a velocity: how each coordinate of the current sample should change as generation advances. Following that velocity from noise to data moves the sample along what these papers call a flow. Stable Diffusion 3 research
Flow-matching papers index the path by time, which sets how much noise the mixture holds and so plays the part of the noise level. Here, as in the flow-matching paper, time zero is pure noise and time one is the real example; Stable Diffusion 3’s paper runs the other way.
For a simple flow-matching example, pair a noise array with a real image representation. Define a straight interpolation between them: noise at time zero, the real example at time one, and an equal mixture halfway through.
At a randomly selected time, give the network the mixture and ask for the velocity along that interpolation. For this particular path, the target is the real example minus the starting noise. With the value from the diffusion example, 0.8 paired with noise of −1.2, the mixture halfway is −0.2 and the target is 2.0, the same at every time along the line. As in diffusion training, we can construct the input and target directly. We don’t have to generate an image to obtain a training example. Flow matching
The ingredients are the ones diffusion used, a real example and drawn noise. What changed is the path that mixes them and the question asked about the mixture.
To generate, start with fresh noise and follow the predicted velocity. A numerical solver approximates the continuous motion with finite steps. This motion is described by an ordinary differential equation, or ODE.
Curved trajectories and reflow
A straight interpolation sounds as though it should permit one perfect generation step, but straight training interpolations do not guarantee straight generated trajectories. The network sees the current mixture and time, without being handed its destination.
Two training lines in one dimension show what that costs. Training draws noise and data independently, so one draw may pair noise of −1 with a data value of +1, and another may pair noise of +1 with −1. At time one half both mixtures are 0, and their targets are +2 and −2. The network is shown the same input twice, the value 0 at time one half, with opposite answers. Squared error is lowest when it predicts their average, 0, so at that point the learned velocity follows neither line.
In general, squared-error training averages the velocities compatible with that input: the learned velocity at each point and time is the average direction of the training lines passing through it. Where lines cross, that average differs from each line, so following the learned field can curve. The rectified-flow paper describes this as rewiring the trajectories that pass through crossings to avoid crossing: the generated paths never cross one another, though the training lines can. Rectified flow
The same averaging shows why one step fails. At time zero the input is pure noise, and because training pairs noise and data independently, it says nothing about the real example it is paired with. So the best velocity points from the noise toward the average of the data, and a single full step would land every sample on that average rather than on any one example. In a toy example in the rectified-flow paper, a single step of the first flow produced the mean of the data. Rectified flow
Rectified flow’s reflow procedure creates new endpoint pairs from a learned flow and trains again to straighten its trajectories. It draws fresh noise, runs the learned flow to see where each draw ends up, and trains again on those noise-and-output pairs. The paper notes that a perfectly straight path could be followed exactly in a single step. The diagram below draws sixteen of the training lines, the flow that training on all such lines learns, and that flow’s reflow pairs, in a one-dimensional example where each sample is a single number. Rectified flow
Each sample is a single number, drawn as height, so the slope of a line is its velocity. In each panel time runs from noise at the left edge to data at the right, where the data sit in two clusters.
Each noise sample joined to a randomly drawn data sample. The 16 lines cross 48 times; at the circled crossing, lines with velocities +3.1 and −1.8 meet.
The network sees only the value and the time, so at the circled point it learns one velocity, −0.85: the average over every possible training line through that point, most of which head to the lower cluster. Paths that follow these averages bend and never cross. One straight step from a start (dashed) lands at 0, the average of the data, between the clusters.
Each start joined to where the learned flow ended. The lines never cross, so in this one-dimensional example a flow retrained on these pairs follows them exactly, and one step reaches the data.
What the Stable Diffusion 3 paper tested
Stable Diffusion 3 tested these choices empirically. Its authors compared 61 training formulations and found that it mattered how often training drew each noise level. Rectified flow that drew every level equally often did not beat the older diffusion recipe from latent diffusion; only versions that changed that distribution did. Their selected formulation drew intermediate noise levels more often than the ends and performed well with fewer sampling steps. Choosing a “flow” formulation didn’t by itself determine the result. The chart below shows how often the selected formulation drew each noise level, and how it and two others ranked.
Each training input mixes a clean example with noise; the axis is the noise's share of the mix. Within a tenth of either end, draws fall to 1.4% each, against 10% under uniform sampling.
A formulation's rank in one evaluation setting is the Pareto front it lands on for FID and CLIP score; rank 1 means no other formulation scored better on both. The 5-step ranks average 4 settings and the 50-step ranks 12, varying the training set (ImageNet or CC12M), weight averaging and, at 50 steps, guidance strength. Scored on COCO images.
The authors’ reason for favouring the middle is that the velocity is harder to predict there than at the ends. At pure noise or at clean data, the input already reveals one endpoint, so the best prediction is an average over the other. The one-step example above is the pure-noise end of that argument.
The second change was to the network: text and image tokens use separate weights but exchange information through attention. In a controlled comparison on one dataset, this design beat three alternatives: DiT, a cross-attention variant of DiT, and UViT, a hybrid of U-Net and transformer. It did better on validation loss and on automated scores of image quality and of how well the image matched its text. This change is to the architecture, separate from the change in training formulation.
The paper’s gains in prompt following and typography, the rendering of written text inside an image, were measured differently: human raters compared the full 8-billion-parameter model with other systems. That model differed from at least some of them in more than its network: it used three text encoders (the large T5 and two CLIP encoders) and trained on captions half of which a vision-language model had written. Removing T5 hurt typography more than prompt following or aesthetic quality.
They also changed the representation. Their autoencoder keeps 16 feature values at each position instead of the 4 in DiT’s, and in their tests it reconstructed images more faithfully than their 4- and 8-value versions. A generator trained on the 16-value space needed more depth to match one trained on an 8-value space. The paper’s Figure 10 caption puts the point where the gap between the 8-value and 16-value versions became negligible at depth 22. The authors chose 16 because they planned to scale to much larger models. Esser et al.
So Stable Diffusion 3’s advance combined several interventions, which the paper tested one at a time. They were a training schedule that spends more updates on intermediate noise levels, a network that gives text and image tokens separate weights, and an autoencoder that keeps more detail. The last also shows the parts constraining each other, since the richer representation needed a deeper network to match a coarser one.
How flow matching overlaps with diffusion
Continuous Gaussian diffusion also has a deterministic sampling description: the probability-flow ODE. With matching initial distributions, exact predictions, and exact integration, it follows the same distribution of samples at each time as the corresponding stochastic process. The individual trajectories can differ.
This construction uses the score: the derivative of log probability density with respect to the sample’s coordinates. It describes the direction and rate of the steepest local increase in log density. It is not a rating of image quality. For Gaussian corruption, score prediction and noise prediction are closely related. Song et al.
Flow matching can learn velocity fields for diffusion-style paths as well as other paths. A deterministic sampler therefore does not tell you whether a model was trained by flow matching. The training target, probability path, and sampler all matter. Flow matching
For Gaussian noise, a velocity target can be rewritten as a noise target with a different weight at each noise level. Changing that weight does not change the best possible prediction, but it can change how training gets there. The Stable Diffusion 3 paper uses this to write each formulation it compares, diffusion and flow alike, as a different weighting of one objective. Esser et al.
Autoregressive and masked generation
Every generator so far updates an array of continuous values. An image can also be generated as a sequence of discrete choices. Autoregressive models such as PixelRNN make one choice per step in a fixed order; masked models such as MaskGIT predict many at once and keep the confident ones.
PixelRNN, introduced in 2016, predicts pixel values in an order across an image. Each prediction depends on values already supplied. This is autoregression, or AR: the same dependency used by a language model predicting the next token. PixelRNN
For an illustrative sentence, pretend each word is a token:
the → the enzyme → the enzyme works → ...
Training raises the probability the model assigns to the observed next token. Generation samples a token from the predicted distribution, appends it, and repeats. Multiplying the conditional probabilities gives the probability of the whole sequence; for text of varying length, that includes the probability of the token that ends it.
The distinction between training and generation matters here too. During training, the correct preceding tokens are available, and supplying them is called teacher forcing. A transformer can then predict at many positions in parallel while a causal attention mask prevents it from seeing later tokens. Ordinary generation remains sequential because those later tokens haven’t been chosen yet. Transformer
PixelRNN used recurrence across image positions to make its predictions. A transformer can perform the same autoregressive task using attention. Either way, generation is still one token at a time: the network changed, and the generation order did not.
MaskGIT
MaskGIT, published in 2022, also represents an image as discrete tokens, but its tokens are learned codes rather than pixel values. An image encoder shrinks each side of the image 16 times and replaces each position with one of 1,024 learned codes, so a 256-by-256 image becomes 256 tokens. MaskGIT then trains a transformer to recover randomly hidden tokens from the visible ones.
At generation time, it begins with every position masked and predicts replacements for them together. It retains confident predictions, masks less confident ones again, and repeats with progressively fewer masks. On ImageNet it generated an image in 8 rounds, where VQGAN, a transformer that fills the same kind of tokens one at a time, takes 256, and its samples were also better. The diagram below runs those 8 rounds beside a generator that fills one token per round in reading order. MaskGIT
The published VQGAN model was trained separately, with its own settings. To separate the masked approach from those settings, the MaskGIT authors also trained a one-token-at-a-time baseline with MaskGIT’s tokenizer and hyperparameters, and MaskGIT still did better at both image sizes they tested. MaskGIT
Several parts of an image can be proposed in the same round, and committed tokens provide context for the next round. The method’s advantage depends on more than predicting hidden tokens: the masking schedule and the rule for retaining predictions turn that ability into a generator. With the best schedule, quality peaked at 8 to 12 rounds and got worse with more.
Masked diffusion for text
LLaDA, introduced in 2025, develops a related alternative for text. Its forward corruption process replaces tokens with masks, and training learns to recover tokens across different masking levels. A transformer can attend to the full visible context. Its generation procedure fills masked tokens over repeated rounds. LLaDA
This is discrete diffusion: corruption changes token identities instead of adding continuous Gaussian noise. A masked objective alone leaves choices about the corruption process, loss weighting, and sampler unspecified. LLaDA supplies those choices and studies language generation with them.
The paper also reports a behavioral difference on one benchmark: given a line from a famous Chinese poem, produce the next line (forward) or the line before it (reversal). LLaDA scored 51.8 forward and 45.6 in reversal; GPT-4o scored 82.7 and 34.3. The autoregressive models were stronger forward and were trained on far more data, so this comparison is not controlled. The LLaDA authors attribute the small gap to a training task that conditions on context in more than one direction. LLaDA experiments
Comparisons that matched the fine-tuning data point the same way. When masked diffusion and autoregressive models were fine-tuned on the same facts stated in one order, the autoregressive models answered at most 16 percent of reversed questions and the masked models between 27 and 100 percent. Nie et al. 2024, Jeon et al. 2026
Why masked training has this effect is not settled.
Two studies of why masked training helps with reversed facts
A 2025 study gave autoregressive models a fill-in-the-blanks task during fine-tuning, without changing their architecture, and closed most of the gap. Pan et al. 2025
The 2026 study argues that the task alone does not explain the transfer. In a one-layer model it traces the transfer to how the network stores a fact in its weights and how attention retrieves it, and it finds the predicted signatures in LLaDA. Jeon et al. 2026
GANs and normalizing flows
Every method so far learns from a target constructed for each real example: the next token, a hidden token, the added noise, or a velocity. A GAN replaces that target with a second network that learns to tell generated examples from real ones; a normalizing flow keeps the maximum-likelihood objective that autoregressive models use, but makes the likelihood computable a different way.
GANs and StyleGAN
A generative adversarial network, or GAN, trains a generator alongside a discriminator that learns to distinguish generated examples from real ones. The generator updates its parameters to make examples the discriminator classifies as real. It doesn’t need each random input to reconstruct a particular training image.
After training, the generator can produce an image without the discriminator, commonly in one forward pass. The cost is a training problem involving two changing networks. It can also suffer mode collapse: producing convincing individual examples while covering too little of the variety in the data. GANs
StyleGAN, introduced in 2018, shows what an architectural change can add within that framework: separate control over coarse and fine features of the image. It maps a random input into an intermediate representation that controls image synthesis at different resolutions. In its face experiments, changing controls at coarse resolutions changes features such as pose, while finer controls affect details and colors. StyleGAN
That intermediate representation is also called latent. The word identifies unobserved values; it doesn’t imply a VAE encoder, a particular prior-matching loss, or a diffusion process. StyleGAN learns its representation through adversarial training.
Normalizing flows and Real NVP
Real NVP takes another route. It transforms samples from a simple distribution through a series of invertible mappings. These mappings are designed so the model can calculate how each transformation stretches or compresses volume. That makes the resulting probability density computable, allowing training to maximize the likelihood assigned to real examples. Real NVP
A one-dimensional case shows the step from volume to density. Doubling every sample of a standard Gaussian spreads the same probability over twice the length, so the density halves: the output’s density at 2 is the input’s density at 1, about 0.242, divided by 2, about 0.121. Real NVP’s layers keep that calculation cheap. Each leaves part of the coordinates unchanged and scales and shifts the rest by amounts computed from the unchanged part, so the layer’s change in volume is the product of those scales. Real NVP
This is a normalizing flow. Its architecture is constrained to make probability calculations tractable. In DiT the network and the training target were separate choices; here the training objective constrains the architecture.
A continuous normalizing flow instead describes its transformation with an ODE. Flow matching is one way to train such a transformation using velocity targets, without solving the full ODE for each training example. “Normalizing flow” and “flow matching” therefore describe related choices, with different roles. Flow matching
Diffusion steps and looped transformers
A diffusion sampler calls the same network several times, and a looped transformer runs the same block repeatedly. The loops differ in what they update and in what training asks each pass to produce: diffusion training sets a target at every sampled noise level, while a looped transformer trained at its readout gives its intermediate passes none.
One way to state the difference is that diffusion gets “intermediate supervision” and a looped transformer does not. The authors of the looped language model discussed below also name the training objective as a key difference from diffusion. The comparison concerns these particular training tasks, not an inherent limit of either architecture.
A diffusion sampler updates a noisy image representation. A looped transformer updates its hidden states, the internal numerical representations used to compute a prediction. Reusing a block adds computation without requiring a new set of parameters for each pass. Universal Transformers
Geiping and colleagues’ 2025 recurrent language model performs several internal passes before a readout converts the resulting states into next-token probabilities. It can then sample a token and begin predicting the next one. The internal loop increases work per prediction while the outer generation procedure remains autoregressive. Geiping et al.
Where each loop gets its training target
In standard diffusion training, we construct a corrupted example at a chosen noise level. That level has a defined meaning, and the corruption process supplies the target for a prediction there.
For a looped transformer trained at its final readout, the intermediate states come from the model’s own earlier passes. We specify what the final output should predict without prescribing what its internal state must represent after pass three. Geiping and colleagues also draw the number of passes at random during training, so their readout learns to work after many different numbers of passes; even so, no hidden state gets a target of its own.
Here, final means the last internal pass. Language-model training can still supply a next-token target at every sequence position. The diagram below sets the two training setups side by side.
Training only at the final readout does not mean only the final pass learns. A gradient describes how the loss changes with the model’s parameters; backpropagation computes it. Fully unrolling a loop lets the final error train earlier passes through their effects on later states. Implementations can shorten that calculation to reduce memory use: Geiping and colleagues propagate gradients through at most the last eight recurrent iterations in their main setup. Geiping et al.
So diffusion’s “intermediate supervision” refers to targets at sampled noise levels. It doesn’t mean every hidden layer receives its own target. Both kinds of network use backpropagation, and both can be extended with additional training losses. The comparison concerns the particular training tasks, rather than an inherent limit of either architecture.
The looped-transformer digest develops this distinction further, including AlphaFold recycling.
How the parts fit together
Every case changed one or more of four parts: the representation generation works in, the training target, the network that makes each prediction, and the sampler that turns predictions into an output. The parts constrain each other, as Stable Diffusion 3’s autoencoder showed. A gain is evidence about the part a controlled comparison changed, at the settings of the parts it held fixed.
In DiT, the autoencoder determines the representation in which generation happens. The diffusion objective teaches the network to predict the noise in noisy examples. The sampler assembles those predictions into a new sample. The transformer performs the computation inside each prediction.
The other cases change different parts of that system. Flow matching changes the path between noise and data and what the network predicts along it. In Stable Diffusion 3’s comparison, though, rectified flow beat the older diffusion recipe only when training also changed how often it drew each noise level. MaskGIT changes how discrete choices are proposed and retained. StyleGAN obtains feedback from a learned discriminator. Real NVP constrains the mapping so likelihood is tractable. Recurrence adds work inside a prediction. The map below describes each of the digest’s eight models by the same four parts and shades the parts its section used that model to show.
Shaded: the part the digest uses that model to show
| Model | Representationthe values it generates | Training targetwhat each prediction is scored against | Networkthe computation inside each prediction | Samplerhow predictions become an output |
|---|---|---|---|---|
| DiT | Representationa pretrained autoencoder’s 32×32 latent, 4 values per position | Training targetthe noise that was added | Networktransformer on 2×2 patches of the latent: 256 tokens (the part this section shows) | Sampler250 denoising steps, then decode once |
| Stable Diffusion 3 | Representationautoencoder latent with 16 values per position (the part this section shows) | Training targetvelocity along a straight path, middle noise levels drawn most often (the part this section shows) | Networktransformer with separate weights for text and image tokens (the part this section shows) | SamplerEuler steps along the velocity (5 to 50 in its tests), then decode once |
| PixelRNN | Representationpixel color values, each one of 256 choices (the part this section shows) | Training targetthe next value | Networkrecurrent layers that scan the image | Samplerone value at a time, row by row (the part this section shows) |
| MaskGIT | Representation16×16 grid of learned codes, each one of 1,024 | Training targettokens hidden at random, in a randomly drawn share | Networktransformer that attends in both directions | Sampler8 rounds, each keeping the most confident predictions (the part this section shows) |
| LLaDA | Representationtext tokens | Training targetmasked tokens, at a masking rate drawn at random from 0 to 1 (the part this section shows) | Networktransformer without a causal mask | Samplerrounds that fill every mask, then mask some again (the part this section shows) |
| StyleGAN | Representationpixels, 1024×1024, made from a random code | Training targetno built target: a discriminator’s judgement (the part this section shows) | Networkmapping network that sets styles at each resolution (the part this section shows) | Samplerone forward pass |
| Real NVP | Representationpixels, as continuous values | Training targetno built target: the exact likelihood, which PixelRNN maximizes too | Networkinvertible layers whose change in volume is cheap to compute (the part this section shows) | Samplerone inverse pass from a Gaussian draw |
| Looped transformer | Representationtext tokens | Training targetthe next token, read out after the last pass | Networkone block repeated, a random number of times in training (the part this section shows) | Samplerone token at a time, the loop running before each |
These distinctions matter when interpreting a result. Better images after changing the representation tell us something different from better images after changing the network. The two are not independent, though. In Stable Diffusion 3’s experiments, an autoencoder with 16 values per position reconstructed images better than ones with 4 or 8, but a generator trained on its space needed more depth to match one trained on the 8-value space. Esser et al.
The comparisons in this digest that can assign credit hold everything fixed except what they test. They are DiT’s patch sizes, Stable Diffusion 3’s 61 formulations and its comparison of networks, and MaskGIT’s one-at-a-time baseline built with MaskGIT’s own tokenizer and settings. That last one credits the masked approach as a whole (its training task, two-way attention and filling order) rather than any one of those parts. The fine-tuning studies of reversed facts matched the fine-tuning data but not the models’ pretraining. Comparisons between whole systems, such as Stable Diffusion 3’s human ratings or LLaDA against GPT-4o on poem lines, cannot say which of their differences mattered.
Faster sampling may come from a different solver, a different learned path, or fewer sequential decisions. It may also come from training. In Stable Diffusion 3’s comparison, the selected formulation, which drew intermediate noise levels more often than the ends, had the best rank in the paper’s table when sampling with only 5 steps. A network can also be distilled: trained to map noise directly to the sample that many steps of a learned flow would reach. Esser et al., Rectified flow
Where mixtures of experts fit (DiT does not use them)
A sparse mixture of experts, or MoE, changes which learned parameters participate in a prediction. A router chooses a subset of subnetworks for each token. Switch Transformers, for example, send each token to one expert in an expert layer.
The experts are learned subnetworks; they needn’t correspond to subjects such as chemistry or grammar. Routing can increase total model capacity while limiting the computation used for each token. It leaves the generation rule to other choices. Switch Transformers
To understand a new model, follow one training example and one generated sample, and ask how training chooses which examples and noise levels to draw. Identify what the model sees, what it predicts, and how its predictions become an output. Then ask whether the comparison behind a reported gain changed one part or several.
What is settled and what is open
The mechanisms and measured results below each rest on a primary source cited above, in the setting that source tested. Reading a generator as four parts is this digest’s interpretation, and how far the parts can be changed one at a time is open.
Settled:
- Latent diffusion runs the generator on an autoencoder’s learned features. In the latent-diffusion paper’s comparison at a fixed network size and training budget, shrinking each side of the image 4 or 8 times gave the best images.
- Standard diffusion and flow-matching training build each noisy input and its target directly from a real example and drawn noise, so training needs one prediction at a time and never runs the generation chain. Reflow is the exception: it runs the learned flow to make its new pairs.
- Straight training paths need not give straight generated paths: where training lines cross, squared-error training learns the average of their velocities. Reflow trains again on the learned flow’s own noise-and-output pairs to straighten the paths.
- In DiT, the network and the training target were separate choices. DiT replaced the U-Net with a transformer and kept an earlier model’s diffusion settings, and in its twelve configurations on ImageNet at 256 by 256, after 400,000 training steps, smaller patches and larger networks each added computation per prediction and improved FID. Among models on 4-by-4 and 2-by-2 patches, similar computation gave similar scores even when parameter counts differed.
- In Stable Diffusion 3’s comparison of 61 formulations on two datasets, rectified flow beat the older diffusion recipe only when training also changed how often it drew each noise level; the selected formulation drew intermediate levels more often than the ends. In the same paper, a 16-value autoencoder reconstructed better but needed a deeper network to match an 8-value one.
- Autoregression factors a sequence’s probability one token at a time; recurrence and causal attention both implement it, and generation stays sequential either way. On ImageNet, MaskGIT generated 256 tokens in 8 rounds and beat a one-token-at-a-time baseline with its tokenizer and settings.
- When fine-tuned on facts stated in one order, masked diffusion language models answered between 27 and 100 percent of reversed questions and autoregressive models at most 16 percent (fine-tuning data matched, pretraining not).
- A GAN learns from a discriminator instead of a constructed target; a normalizing flow such as Real NVP keeps maximum likelihood and makes it computable through invertible maps.
- A looped transformer trained at its readout gives its intermediate states no target of their own, unlike diffusion training, which builds an input and a target at every sampled noise level.
Interpretation, this digest’s own:
- That a generator is usefully read as four parts (representation, training target, network, sampler), each of which a paper may change. The parts are questions to ask, not exclusive classes: a VAE, a GAN or an autoregressive model each fixes more than one of them.
- That credit for a gain goes to the part a controlled comparison changed, at the settings of the parts it held fixed. Whole-system comparisons, such as Stable Diffusion 3’s human ratings against other models or LLaDA against GPT-4o on one poem benchmark, cannot assign it.
- That the difference between diffusion steps and looped-transformer passes lies in their training tasks, not in a limit of either architecture. The looped model’s authors also name the training objective as a key difference.
Open:
- How far the parts can be changed one at a time. In Stable Diffusion 3, a richer representation needed a deeper network; this digest does not review later work on how that coupling behaves as models grow.
- Why masked diffusion language models answer reversed questions more often. A 2025 study closed most of the gap by giving autoregressive models a fill-in-the-blanks task during fine-tuning; a 2026 study argues the task alone does not explain the transfer and traces it, in a one-layer model, to how facts are stored and retrieved.
Further reading
Primary papers, in the order the sections use them.
- Representations: Latent diffusion and the VAE tutorial.
- Denoising and architecture: Denoising Diffusion Probabilistic Models and DiT.
- Paths and velocity targets: Flow matching, rectified flow, and Stable Diffusion 3.
- Token generation: PixelRNN, MaskGIT, and LLaDA; on reversed facts, Nie et al., Pan et al. and Jeon et al..
- GANs and normalizing flows: StyleGAN and Real NVP.
- Repeated internal computation: Universal Transformers and Geiping et al..
- Protein models: masked generators can fill amino acids while autoregressive generators append them, and those generation choices also affect how models learn from feedback, as explored in the protein post-training digest.