How a model is built, and the algorithms it learns by.
7 papers
Written by Junkun Yuan.
Click here to go back to main contents.
Table of contents ▶
Papers are displayed in reverse chronological order. High-impact or inspiring works are highlighted in red.
Improved Mean Flows: On the Challenges of Fastforward Generative Models
CMU · MIT · Adobe · THU
Conference on Computer Vision and Pattern Recognition (CVPR), 2026
Dec 01, 2025 iMF (90) code (349)
Recast MeanFlow's self-written target as plain velocity regression, and turn its frozen guidance scale into one more test-time condition.
What MeanFlow regresses (§3, Eq. 4–7). MeanFlow identity (Eq. 4), with (Eq. 5), makes trainable: target (Eq. 6) is fitted by (Eq. 7) — standing for in both places.
The identity read backwards (§4.1, Eq. 8–10). Solve for (Eq. 8), make it as (Eq. 9) and minimize (Eq. 10) — fully equivalent to Eq. 6–7, and now a v-loss re-parameterized by u-pred.
The input that should not be there (Eq. 11, Fig. 1a). Written out, that compound function is , reading the conditional velocity as a second argument — illegitimate for a regressor of , and traceable to Eq. 6, which put the conditional where Eq. 5 asks for the marginal.
Predict the tangent instead (Eq. 12). (Eq. 12) — both arguments are now network outputs of alone. Stop-gradient survives, but inside the prediction rather than on the target, and is kept because dropping it brings second-order gradients in .
Two cheap (§4.1, Tab. 1a). The boundary condition is free — FID 32.69 → 29.42 unguided, 3.43 → 2.99 on XL/2. An auxiliary -head over the last 8 layers, on its own flow-matching loss, free at inference, does worse unguided, 30.76, and better guided, 5.68.
Why the conditional tangent hurts (§4.1, Eq. 2, Fig. 3). Feeding to the loss leaks nothing, since the true regression target is the marginal ; but as the JVP's tangent its variance is magnified by the Jacobian it multiplies, which is what the two loss curves separate.
Guidance, fixed and unfixed (§4.2, Eq. 13–15). MeanFlow bakes (Eq. 13) in at one chosen before training. iMF makes it an input, (Eq. 15), with drawn on , skewed toward the small .
The target it fits (App. A, Eq. 17). (Eq. 17) is MeanFlow's guided target with an input, so means no guidance. FID 5.68 → 5.52, small only because MeanFlow's fixed already suited the B/2 model.
The interval is a condition too (§4.2, Tab. 1b). Pass , sampling and and switching guidance off () when falls outside — 5.52 → 4.57, while the column itself improves 30.76 → 20.95, so training across scales generalizes better.
In-context conditioning (§4.3, Eq. 16, Tab. 1c). (Eq. 16) is too heterogeneous for one adaLN-zero to sum; replicate each into tokens — 8 for the class, 4 for the rest — concatenated with the image patches: 4.57 → 4.09, and 133M → 89M once adaLN is gone.
Experiments (§5). ImageNet-256 in the VAE latent, from scratch, 1-NFE FID-50K on MeanFlow's code and B/2 baseline: the changes step 6.17 → 5.68 → 4.57 → 4.09, SwiGLU, RMSNorm and RoPE 3.82, 640 epochs 3.39 at 89M; iMF-XL/2 takes 1.72 at 1-NFE and 1.54 at 2-NFE.
The size labels do not calibrate (§5.2, Tab. 2). Without adaLN-zero, parameters go to depth: iMF-XL/2 has 48 layers, 610M and 174.6 Gflops to MF-XL/2's 28, 676M and 119.0, so 1.72 against 3.43 is not at matched FLOPs; iMF-M/2's 2.27 at 49.9 Gflops over MF's 5.01 at 54.0 is.
The training and sampling algorithm and its code. Follow Algorithm 2 of paper.
def train():
# 1. Sample timesteps r and t from lognorm(-0.4, 1.0), sorted so r <= t; 50% of rows get r = t
r, t = sample_time_steps(bs)
# 2. Sample the guidance scale and interval; rows with r = t get the full interval [0, 1]
omega = sample_cfg_scale(bs) # omega ~ omega^-beta on [1, 8]; assume beta=1
t_min, t_max = sample_cfg_interval(bs, r == t) # t_min ~ U[0, 0.5], t_max ~ U[0.5, 1]
# 3. Build the noisy latent z_t and its velocity v_t
z_t = (1 - t) * z_0 + t * noise # linear path
v_t = noise - z_0 # conditional velocity
# 4. Predict the average velocity u and the instantaneous velocity v with a class dropout
dropped = rand(bs) < 0.1 # 10% class dropout
y_in = where(dropped, null, y)
u, v = model(z_t, r, t, omega, t_min, t_max, y=y_in) # Eq. (16); omega and the interval are inputs
# 5. Predict cond and uncond instantaneous velocity at t with the v head; omega = 1 outside the interval
omega_t = where((t >= t_min) & (t <= t_max), omega, 1)
with no_grad():
v_c, v_u = model(cat([z_t, z_t]), cat([t, t]), cat([t, t]), cat([omega_t, ones]), cat([zeros, zeros]),
cat([ones, ones]), y=cat([y, null]), predict_u=False).chunk(2)
# 6. Build the guided velocity target
v_target = v_t + (1 - 1 / omega_t) * (v_c - v_u) # Eq. (17)
v_target = where(dropped, v_t, v_target)
# 7. Build the compound prediction V, with the predicted v_c as the JVP tangent
fn = lambda z, r_, t_: model(z, r_, t_, omega, t_min, t_max, y=y_in, predict_v=False)
_, dudt = jvp(fn, (z_t, r, t), (v_c, zeros_like(r), ones_like(t))) # no_grad, so dudt is sg(du/dt)
V = u + (t - r) * dudt # Eq. (15)
# 8. Calculate loss of the u head and the auxiliary v head
loss = adaptive_loss(V - v_target) + adaptive_loss(v - v_target) # sum of squared error / (sg(.) + 0.01)^1
loss = loss.mean()
def sample():
time_steps = linspace(1, 0, num_steps + 1)
for i in range(num_steps):
t = full((bs,), time_steps[i])
r = full((bs,), time_steps[i + 1])
u, _ = model(z, r, t, omega, t_min, t_max, y=y, predict_v=False) # guidance is a condition: one forward
z = z - (t - r) * uMean Flows for One-step Generative Modeling
CMU · MIT
Advances in Neural Information Processing Systems (NeurIPS), 2025
May 19, 2025 MeanFlow (538) code (609)
Model the average velocity over an interval instead of the instantaneous one — a one-step generator trained from scratch, with guidance in the field.
Average velocity (§4.1, Eq. 3). — displacement across , a field induced by itself and by no network; , and integral additivity already gives , consistency with nothing imposed.
The MeanFlow identity (Eq. 6). Multiply the definition by and differentiate in with fixed; the product rule and the fundamental theorem give , that is — the intractable integral traded for a local relation between the fields.
One JVP computes it (Eq. 8, Tab. 1b). , since , : a Jacobian–vector product with tangent , one extra backward pass. Corrupt it and one-step collapses — 61.06 FID against 137.96–329.22.
The objective (Eq. 9–11). with : the network's own partials stand in for those of the true , the conditional for the marginal, and stop-gradient removes double backpropagation. Zero loss recovers the identity, hence Eq. 3.
Sampling (§4.1, Eq. 12). — the integral is the prediction, so is one call, few steps chaining it.
Guidance inside the field (§4.2, Eq. 19). Define and average it; since , the unconditional half is the network's own diagonal, , so guidance stays a single call ( gives 15.53).
Guidance, improved (App. B.1, Eq. 21, Tab. 5). A mixing scale lets the class-conditional diagonal into the target as well: ; solving it gives Eq. 13's form at the effective scale . At a fixed , from 0 to 0.9 takes the 1-NFE FID 20.15 → 18.63; the released XL/2 ships , .
Adaptive loss weighting (§4.3, App. B.2, Tab. 1e). For the error , the powered loss equals the squared loss under the weight , , , applied as : gives 61.06, Pseudo-Huber-like 63.98, plain 79.75.
Two clocks (§4.3, Tab. 1a/c/d). come from lognorm, and , and only 25% of pairs keep — at 0% the correction vanishes, the loss is exactly flow matching and 1-NFE fails (328.91 against 61.06). The network is fed , best of four embeddings.
The training and sampling algorithm and its code. Follow Algorithm 1 and 2 of paper.
def train():
# 1. Sample timesteps r and t from lognorm(-0.4, 1.0), sorted so r <= t
r, t = sample_time_steps(bs)
# 2. Build the noisy latent z_t and its velocity v_t
z_t = (1 - t) * z_0 + t * noise # linear path
v_t = noise - z_0 # conditional velocity
# 3. Predict the average velocity u with a class dropout
dropped = rand(bs) < 0.1 # 10% class dropout
y = where(dropped, null, y)
u = model(z_t, r, t, y)
# 4. Build CFG-guided velocity
with no_grad():
u_c, u_u = model(cat([z_t, z_t]), cat([t, t]), cat([t, t]), y=cat([y, null])).chunk(2)
v_tilde = 0.2 * v_t + 0.92 * u_c + (1 - 0.2 - 0.92) * u_u # Eq. 21; assume omega=0.2, kappa=0.92
v_hat = where((t <= 0.8) & ~dropped, v_tilde, v_t)
# 5. Calculate average velocity target
_, dudt = jvp(lambda z, r_, t_: model(z, r_, t_, y), (z_t, r, t), (v_hat, zeros_like(r), ones_like(t))) # Eq. 8
u_target = v_hat - (t - r) * dudt # Eq. 10
# 6. Calculate loss
loss = (u - u_target.detach()).square().flatten(1).sum(1) # Eq. 9
loss = (loss / (loss.detach() + 0.01)).mean() # p=1, c=0.01 as the official code; paper: c=1e-3
def sample():
time_steps = linspace(1, 0, num_steps + 1)
for i in range(num_steps):
t = full((bs,), time_steps[i])
r = full((bs,), time_steps[i + 1])
z = z - (t - r) * model(z, r, t, y=y)One Step Diffusion via Shortcut Models
UC Berkeley
International Conference on Learning Representations (ICLR), 2025
Oct 16, 2024 Shortcut Models (379) code (768)
One network, conditioned on step size, jumps any distance along the flow — trained in one run, with no teacher, schedule, or second stage.
Why naive one-step fails (§2, Fig. 2). Flow matching learns the average direction over all pairings passing through ; at that average points at the dataset mean, so one big Euler step lands there — multimodal data is unreachable in a single step even at the optimum.
Condition on the step size (§3, Eq. 3). The shortcut is the normalized jump to the correct next point, ; at it is the flow itself, so shortcut models generalize flow matching — one model serves every budget from 128 steps to one.
Self-consistency instead of a teacher (§3, Eq. 4–5). One step equals two chained halves, : bootstrap targets come from the model itself, while a batch fraction at regresses flow matching. One run, ~16% extra compute.
A binary grid of step sizes (§3.1). 128 base units give eight shortcut lengths , each trained against two of the next size down, keeping bootstrap paths short; many-step quality matches the flow baseline, few- and one-step matches two-stage distillation methods.
Experiments (§5). CelebA-HQ-256 and ImageNet-256, every objective retrained on one DiT-B codebase at matched compute, FID-50K at 128 / 4 / 1 steps: 6.9 / 13.8 / 20.5 and 15.5 / 28.3 / 40.3 — past every end-to-end and two-stage method but progressive distillation's one step.
Bootstrapping still scales, and drives robots (§5.3–5.5). Unlike Q-learning, one-step FID keeps falling with size (DiT-XL: 10.6, 3.8 at 128 steps), and as a one-step policy on Push-T and Transport it scores 0.87 / 0.80 where a one-step diffusion policy collapses to 0.12 / 0.00.
The method straight from the repo, cut to the lines that carry the idea:
# One batch, two target kinds (targets_shortcut.py); 1/bootstrap_every of it bootstraps.
dt_base = ladder_index # the network is conditioned on the log2 exponent, not on dt itself
dt = 1 / 2**dt_base # the binary ladder [1, 1/2, ..., 1/128]
t = randint(0, 2**dt_base) / 2**dt_base # t lands only on multiples of dt
x_t = (1 - (1 - 1e-5) * t) * x_0 + t * x_1 # a 1e-5 noise floor, not an exact lerp
# Bootstrap targets: two half-steps of the model itself (EMA and CFG both optional).
v1 = model(x_t, t, dt_base + 1) # +1 = one rung down the ladder, step dt/2
x_mid = clip(x_t + (dt/2) * v1, -4, 4) # clipped midpoint - stability the paper never mentions
v2 = model(x_mid, t + dt/2, dt_base + 1)
v_target = clip((v1 + v2) / 2, -4, 4) # no grad flows through targets
# Flow-matching targets for the rest of the batch, on the finest grid.
t = randint(0, 128) / 128
v_target = x_1 - (1 - 1e-5) * x_0 # empirical velocity; dt_base = log2(128) encodes d = 0
# One loss serves both target kinds (train.py).
loss = mean((model(x_t, t, dt_base) - v_target) ** 2)Simplifying, Stabilizing and Scaling Continuous-Time Consistency Models
OpenAI
International Conference on Learning Representations (ICLR), 2025
Oct 14, 2024 sCM (276)
It made continuous-time consistency training work at scale — TrigFlow, tangent normalization and a JVP recipe that MeanFlow, rCM and the newer few-step families build on.
Simplify consistency models, stabilize the continuous-time limit by taming its tangent, scale to 1.5B: two steps within 10% of the teacher.
TrigFlow (§3, Eq. 3–5). With noise at the data's scale, , : EDM's coefficients become , , ; the PF-ODE is , trained on with ; the CM is a DDIM step, . EDM enters by ; flow matching is a special case.
Where the tangent blows up (§4.1, Eq. 6–7). : , the ODE and are tame and well-conditioned, so the culprit is — three factors, one fix each. Fig. 4: EDM with Fourier scale 16 sends the norm past 150, positional EDM still explodes at , TrigFlow stays under 4, on CIFAR-10 models.
Three architectural fixes (§4.1). (1) : EDM's gives . (2) Positional time embeddings: the derivative of scales with ; positional means — iCT's scale, explained. (3) Adaptive double normalization, : raw AdaGN made CMs diverge; pixel-normalizing scale and shift keeps its expressivity.
Tangent normalization (§4.2, Fig. 5a). Most gradient variance rides on , so replace it by , , or clip it to : on ImageNet 512 either pulls 1-step FID well below the raw tangent's, and the two land together — applied before the weighting below.
Adaptive weighting (§4.2, Eq. 8, App. D). The identity turns Eq. 2 into an MSE, so EDM2's learned weight applies: , the prior weight turning into ; at the optimum every time's weighted loss is 1. Times come from , with : near clean data, where the real signal enters.
Diffusion init and tangent warmup (§4.2, App. G). Init is the teacher's EMA; the term is scaled by , optional, against gradient spikes. Distillation costs ~2× a diffusion step and reaches the teacher's 2-step quality within ~20k iterations, under 20% of its compute.
Discrete never catches up (§4.2, App. E, Fig. 5c). Every fix ports to discrete time through , one DDIM step away, which tends to as (Eq. 37) and replaces the JVP in Eq. 8 unchanged; on EDM-spaced levels (), FID improves with up to 1024, worsens past it from numerical precision, and on ImageNet 512 the continuous model sits below every .
JVP rearrangement (§5.1). The tangent overflows in FP16 near and . The loss needs only , so the JVP is fed the tangent at — the scale folded in upstream.
Flash-attention JVP (§5.1, App. F). For the output tangent is ; the two new terms need only a running vector and scalar , merged block by block like Flash Attention's own — rescaled by , summed the same way — and read out as , so attention and its JVP come out of one pass with no attention matrix stored.
Sampling and guidance (§5.2, App. G). One step from , two steps re-noising to . On ImageNet 512 CFG is distilled in: the student takes the guidance scale as an input embedded like , the teacher at that scale; sCT, teacher-free, gets none.
Experiments (§5.2, Tab. 1–2). CIFAR-10, ImageNet 64 and 512, FID at 1 / 2 steps for sCT and sCD: two steps already read 2.06 / 1.48 / 1.88 against teachers 2.01 / 1.33 / 1.73; 1-step sCD-XXL 2.28 beats StyleGAN-XL's 2.41 and VAR's 2.63 at under 10% of their compute.
sCD scales like its teacher; sCT does not in latent space (Fig. 6, Tab. 2). The sCD/teacher FID ratio holds at ~1.3 (one step) and ~1.09 (two) from S to XXL, so the gap shrinks; sCT wins at 64px but reads 10.13 against sCD's 3.07 at 512-S, variance blamed on the VAE latent.
VSD buys precision with recall; sCD keeps both (Fig. 7, Tab. 7). From guidance 1 to 2 VSD's recall collapses as under heavy guidance, as 2-step sCD tracks the teacher; VSD on top of sCD moves 1-step FID only 2.75 → 2.67 but FD-DINOv2 83.78 → 54.81: the metrics disagree.
Improved Techniques for Training Consistency Models
OpenAI
International Conference on Learning Representations (ICLR), 2024
Oct 22, 2023 Improved Consistency Models (476)
Consistency training grown up — drop the teacher-side EMA, swap LPIPS for Pseudo-Huber, grow the discretization, and beat distillation.
Why leave CD and LPIPS (§1). Distillation caps a student at its teacher; LPIPS leaks ImageNet features into FID, whose Inception judge saw the same data. iCT drops both and wins anyway: one-step FID 2.51 on CIFAR-10 and 3.25 on ImageNet-64, past CD at one and two steps.
No EMA on the teacher network (§3.2). Of the two arguments tying CT to consistency matching, the gradient one holds only when ; with an EMA teacher the limit is not even a valid objective — a Dirac toy example breaks it. So , on the teacher side only.
Pseudo-Huber replaces LPIPS (§3.3). with sits between and : it beats outright and catches LPIPS once grows large — no feature network left to backpropagate through, and the heuristic scales with data dimensionality.
Schedules and small knobs (§3.1, §3.4–3.5). doubles from 10 up to 1280 across training; noise levels draw from a discretized lognormal (, ); weighting ; plus a smaller Fourier scale (0.02) and genuinely large dropout (0.3 on CIFAR-10).
Experiments (§4, Tab. 2–3). CIFAR-10 and ImageNet-64 by FID, IS, precision and recall, GANs with pretrained discriminators excluded: iCT reads 2.83 / 2.46 at 1 / 2 steps on CIFAR-10 and 4.02 / 3.20 on ImageNet, iCT-deep 2.51 / 2.24 and 3.25 / 2.77 — past CD and TRACT.
Recall, and thin margins (§4). ImageNet-64 recall rises to 0.63 from CT's 0.47 and BigGAN-deep's 0.48; one-step iCT edges StyleGAN-ADA on CIFAR-10 (2.83 vs 2.92) and BigGAN-deep on ImageNet (4.02 vs 4.06); two-step iCT-deep's 2.24 ties Score SDE's 2.20 at 2000 steps.
Latent Consistency Models: Synthesizing High-Resolution Images with Few-Step Inference
Tsinghua University
arXiv, 2023
Oct 06, 2023 LCM (931) code (4.6K)
Consistency distillation moves into Stable Diffusion's latent space, swallows classifier-free guidance in one stage, and lands 768px in 2–4 steps.
Latent consistency distillation (§4.1). The consistency function moves to SD's latent space, , parameterized on the teacher's own noise prediction and initialized from it; the ODE solver — DDIM or DPM-Solver — appears only in training, never at inference.
Guidance folded in, one stage (§4.2). The augmented ODE runs on the guided noise — its solver estimate is two solver calls combined — with the student conditioned on . Guided-Distill took two stages and 45 A100-days; LCM, 32 A100-hours.
Skipping-step (§4.3). Adjacent times on SD's 1000-step schedule sit so close that the consistency loss nearly vanishes and convergence crawls; aligning with at cuts the effective schedule from a thousand points to dozens; convergence lands in 2,000 iterations.
Latent consistency fine-tuning (§4.4). A trained LCM adapts to custom image datasets without giving up its few-step inference.
Experiments (§5). LAION-Aesthetics-6+ (12M, 512px) and 6.5+ (650K, 768px) from SD2.1, FID and CLIP on 30K images at : 768px LCM reads 34.22 / 16.32 / 13.53 FID at 1 / 2 / 4 steps against Guided-Distill's 120.28 / 30.70 / 16.70 and DPM++'s 188.91 / 67.14 / 20.08.
Guided-Distill was reproduced small (§5). Its numbers are a re-implementation at batch 72, 100K iterations, not the paper's batch 512 on 32 A100s — an admitted handicap: the claim is faster convergence at equal compute, no ceiling; suits DPM/DPM++, breaks DDIM.
Consistency Models
OpenAI
International Conference on Machine Learning (ICML), 2023
Mar 02, 2023 Consistency Models (2,160) code (6.5K)
It opened the consistency route to one-step generation — self-consistency as the training signal, teacher optional — seeding a large family of few-step models.
One evaluation maps noise straight to data — learn the map from any ODE point to its origin, distilled from a teacher or trained from scratch.
The consistency function (§3, Fig. 1). sends every point of the probability-flow ODE to its origin, so sampling is a single network evaluation at ; self-consistency — every point of one trajectory shares an output — is the property both training modes below enforce.
The boundary condition (§3, Eq. 5). must be the identity, or solves everything; it comes almost for free from the skip form with , — the EDM-style shape that lets existing diffusion architectures drop in unchanged.
Consistency distillation (§4, Alg. 2). Noise an image to , take one teacher step back, and pull the two outputs together — the target side from an EMA copy, stopgradded. With LPIPS and : CIFAR-10 3.55, ImageNet-64 6.20 one-step, past PD everywhere but one point.
Consistency training (§5, Alg. 3). Swap the teacher's score for the unbiased estimate : the pair becomes and with one shared , no diffusion model anywhere — a standalone family that still matches PD's one step, with and grown on schedules.
Multistep sampling (Alg. 1). Alternate the model with re-noising to a lower level, time points picked greedily by ternary search; extra compute buys quality back, and mapping any to gives zero-shot inpainting, colorization, super-resolution and stroke-guided editing.
Experiments (§6). CIFAR-10, ImageNet-64, LSUN Bedroom / Cat by FID, IS, precision, recall, from EDM teachers: CD beats PD at 1–2 steps everywhere but one point and the synthetic-data distillers; CT, teacher-free, gets 8.70 / 5.83 on CIFAR-10, past every VAE and flow.
The metric is half the margin (§6.2). PD retrained with LPIPS improves uniformly on its (Fig. 4), so part of CD's lead is the metric, not the objective; Heun and come from EDM unchanged, and CT samples share structure with EDM's from one noise — no mode collapse.
Both trainers in one routine, straight from the repo, cut to the lines that carry the idea:
# The parameterization (karras_diffusion.py, denoise): f(x, s_min) = x by construction.
c_skip = sd**2 / ((sigma - s_min)**2 + sd**2) # EDM's scalings with sigma -> sigma - s_min
c_out = (sigma - s_min) * sd / (sigma**2 + sd**2)**0.5 # at s_min: c_skip = 1, c_out = 0
f = c_skip * x_t + c_out * unet(c_in * x_t, 250 * log(sigma)) # nothing left to learn there
# One routine serves both modes (consistency_losses): adjacent Karras levels t > t2.
x_t = x + t * z # noise a real image
pred = f(x_t, t, theta) # the trainable side; dropout RNG state saved here
with no_grad(): # one solver step t -> t2 builds the trajectory pair
denoiser = teacher_denoise(x_t, t) if distill else x # CT: the raw image is the score
d = (x_t - denoiser) / t # CD upgrades this to Heun with a second evaluation at t2
x_t2 = x_t + (t2 - t) * d
target = f(x_t2, t2, theta_ema).detach() # EMA copy, rerun under the student's dropout mask
loss = lpips(pred, target) # or plain l2; LPIPS inputs are resized up to 224px first
# Sampling is f(s_max * z, s_max); Alg. 1 re-noises lower and applies f again for quality.Last updated on September 17, 2026 · Citations from Semantic Scholar & Google Scholar; stars from GitHub, September 2026