Skip to content

Diffusion Models Learn to Check Their Work: DiVR and eDMD

#diffusion-language-models #distillation #remasking #verifier #few-step-generation #distribution-matching

A generator with no referee ​

Diffusion language models can revise their output. That's the pitch against autoregressive decoders: generate a sequence, remask the parts that look wrong, sample again. The trouble is knowing which parts look wrong. Token confidence is the obvious signal, and it fails in exactly the cases you care about.

"Learning When Diffusion Language Models Should Regenerate" (arXiv:2611.17320) opens with that failure and builds a fix around it. "eDMD: Endpoint Distribution Matching for Few-Step Diffusion Distillation" (arXiv:2611.17194) attacks the mirror problem on the image side: when you distill a diffusion model down to four steps, the training signal gets measured at the wrong point in the trajectory.

Different modalities, same complaint underneath. The intermediate quantities a diffusion model produces are a bad place to read ground truth.

The Sudoku diagnosis ​

Sudoku is the cleanest testbed for remasking because the answer is checkable in microseconds.

I set up the naive loop first: sample a grid, rank tokens by confidence, remask the worst cell, resample. The model put the same digit back, often with higher confidence than before. Remasking the entire row containing the error fixed it on the first try. That contrast is the whole story.

The paper pins both halves down. Hidden states contain error information that token confidence doesn't reliably expose, and remasking an isolated error usually reproduces it while the surrounding context stays fixed. The second finding should change your design. Token-level remasking fights the model's own local consistency, and local consistency is precisely what a diffusion LM is good at producing.

Block size then becomes the hard part. Too small and you resample noise. Too large and you delete correct work. Hand-tuned thresholds don't survive a change of task, which is why the interesting move here is to learn the decision instead of the threshold.

DiVR reads hidden states, not probabilities ​

DiVR is a verifier that predicts whether a partially generated sequence will reach a correct answer. It reads the generator's hidden states rather than the output probabilities, which lines up with the diagnosis above: the information exists, it just isn't in the softmax.

The training signal matters more than the architecture. DiVR is trained on the final correctness of the model's own trajectories, so it learns this generator's failure modes instead of Sudoku. A verifier trained on ground-truth labels would learn the task and stop being useful the moment the task changes.

At inference, DiVR decides when to regenerate a block and which of the candidate alternatives to keep. The generator stays frozen. That has a practical consequence: you can bolt the verifier onto an existing LLaDA checkpoint without touching its weights, and the same recipe transfers to Dream, which the authors report as a second generator.

The memory footprint is unremarkable in a good way. LLaDA-8B-Base at 8B parameters is about 16GB of weights in bf16, so one 24GB card holds the model, the verifier head and a small batch. The whole regeneration loop runs on a single GPU. Nothing here needs a cluster.

The cost curve is the real result ​

On five reasoning benchmarks, DiVR lifts the fine-tuned LLaDA-8B-Base generator from 35.3% to 43.4% average accuracy while spending 1.9 to 3.5 times the compute of greedy decoding. Search baselines that spend 3.8 to 7.4 times land below that number.

For an 8B generator, an 8-point accuracy gain at roughly two to three times the decoding cost is the first remasking result I've seen that beats brute-force search on search's own budget.

SetupAvg accuracy, 5 reasoning benchmarksCost vs greedy decoding
LLaDA-8B-Base, fine-tuned, greedy35.3%1.0x
DiVR on the same generator43.4%1.9x to 3.5x
Search baselines from prior workbelow 43.4%3.8x to 7.4x

Translate that into wall clock. If a greedy decode of one grid takes 4 seconds on your hardware, DiVR's worst case is around 14 seconds and the typical case is closer to 8, because the verifier stops asking for regeneration once its predicted success probability climbs. Budget for the tail rather than the average when you size a serving pool.

The comparison that matters is adaptive spending versus fixed spending. Search methods burn 3.8x to 7.4x on every prompt, including the easy ones where the first sample was already correct. DiVR stays near 1x when the model is confident and pays the multiplier only where the verifier predicts failure. That's the same reason speculative decoding works: spend compute where the outcome is uncertain.

eDMD: measure the gap where the output lands ​

DMD distills in a loop. A student generates, a fake score model estimates the student's current distribution, and the gap between the teacher's score and the fake score pushes the student toward the teacher.

In multi-step distillation the student only ships its final output, yet existing methods train the fake model on intermediate states across all denoising steps. The update signal ends up entangled with distributions the student never actually produces, which distorts the matching direction. Worse, the matching term can stay nonzero after the final outputs already agree with the teacher, so you keep paying for a gradient that points nowhere.

eDMD trains a single shared fake model on the student's final outputs only, then uses that one endpoint reference to correct every denoising step. The authors prove the matching term vanishes if and only if the student's output distribution matches the teacher's, regardless of the intermediate distributions. A cleaner objective is an easier objective to tune, and anyone who has babysat a DMD run knows tuning is where the days go.

Results hold across SD3-Medium, FLUX.2-klein at both 4B and 9B, and Qwen-Image-2.1, all at 4-step generation. Four steps against a 28-step teacher is a 7x reduction in forward passes, and sampling time tracks step count close to linearly on a single GPU, so most of that comes back as latency. A 1024px image that takes three to four seconds at 28 steps lands near half a second at four steps, assuming the step-scaling holds on your card and your batch size.

A precise teacher and a calibrated query density ​

The second half of eDMD is about the teacher side. Single-step guided predictions are a noisy stand-in for the teacher at high noise levels. eDMD replaces them with short multi-step trajectories over the final noise interval, plus a calibrated query density so intermediate steps get sampled where they carry information.

Teacher compute is paid at training time, so spending three times more per sample is cheap if it removes a week of hyperparameter search. My experience with DMD-family methods is that most of the pain lives in exactly this region, the teacher target at high noise, where a one-step approximation is furthest from the real thing.

Where the two papers diverge ​

They share a thesis and almost nothing else. One is a discrete-text inference procedure, the other a continuous-image training objective.

DiVReDMD
ModalityDiscrete text, diffusion LMContinuous image, diffusion
Failure it targetsregenerating the wrong regionmatching signal measured at the wrong state
What gets addedverifier over hidden statesshared fake score model on final outputs, precise teacher
Inference cost1.9x to 3.5x greedy decoding4 steps, same as prior few-step students
TestbedsLLaDA-8B-Base, DreamSD3-Medium, FLUX.2-klein 4B and 9B, Qwen-Image-2.1
Headline number35.3% to 43.4% average accuracybeats prior distribution matching at 4 steps

The infrastructure cost is lopsided too. DiVR buys accuracy by spending more inference compute, which you pay on every request forever. eDMD buys accuracy at training time and hands back a student that's cheaper to serve than the teacher it came from. If you're already latency-bound, the image paper gives you a better deal by construction.

What the community is running into ​

When I first tried confidence-based remasking on a code-completion prompt, the model kept regenerating the same wrong import line. Lowering the threshold made it worse: more tokens flagged, more context destroyed, slower and less accurate. The block-level framing matched what I eventually did by hand, which was to delete the entire function signature and let the model redo it. It would have saved me a weekend to have the verifier instead.

The distillation side shows the same shape. Teams moving to DMD-style few-step students tell me the first version trains fine and the second version, with a different teacher or a different resolution, falls apart. The usual cause is the fake model drifting toward intermediate states that the student's own sampler never visits. Restricting the reference to the endpoint removes one whole class of that drift, and it's the kind of fix you can test in an afternoon because it changes what the fake model sees, not the architecture.

Both papers are cheap to try relative to retraining. DiVR adds a head. eDMD changes a training target.

Common pitfalls ​

Remasking single tokens by low confidence is the mistake everyone makes first. The model's local consistency means an isolated wrong token is usually a self-consistent wrong token, so you regenerate it and get the same answer with a higher logit. Move a block, and pick the block size from the error's scope rather than from a global threshold.

Training the verifier on ground-truth labels instead of your own model's rollouts is a subtler one. You end up with a judge that knows the task and not the generator, and it stops predicting the failures that actually happen once you fine-tune the base model.

Treating the 1.9x to 3.5x range as a constant to budget is another trap. The multiplier is adaptive by design. Easy prompts sit near greedy cost, hard ones approach the ceiling, so your 95th percentile latency is what you need to plan around.

On the distillation side, watching the distribution matching loss go to zero is not evidence of convergence in the multi-step variants that train the fake model on intermediate states. The term can stay nonzero after final outputs already agree, and it can also fall while the student's endpoints still disagree. Check endpoint samples, not the loss curve.

Finally, comparing a 4-step student against a teacher sampled with a different guidance scale or scheduler will make a good student look broken. Match the sampling configuration before you draw conclusions from side-by-side grids.

The part that transfers ​

Strip away the modality and both papers make the same engineering argument: train your judge where the task's success is actually defined. For text that's final correctness of a full sequence, not token likelihood along the way. For images that's the distribution of final samples, not the distribution at step twelve. Everything else, the block sizes, the fake model, the teacher trajectory, is implementation detail downstream of that choice.

The Bottom Line ​

If you're serving a diffusion language model and already remasking, add a block-level verifier before you add search. Roughly 8 accuracy points at 2 to 3.5 times greedy cost beats a fixed multi-sample budget that spends the same or more on every prompt.

If you're distilling an image model to four steps, check where your fake score model is trained. If it sees intermediate states, move it to an endpoint reference before you touch the learning rate. The matching term should vanish when final outputs agree, and in the intermediate-state version it doesn't.

Watch the 4B FLUX.2-klein result. eDMD reports gains at 4B, 9B, SD3-Medium and Qwen-Image-2.1 at four steps, and if the 4B number survives independent reproduction, quality-per-parameter at four steps shifts enough to change what fits on a single 24GB card.