Jialin Li

AAAI 2027 / Research project

Optimality Diagnostics

Optimality Diagnostics for Corrected Diffusion and Flow Models

Jialin Li, Zhuo Zhang, Guipeng Lan, Yue Cao, Shuai Xiao, Jiachen Yang

School of Electrical and Information Engineering, Tianjin University, Tianjin, China

Could a sampler reach the same distribution at a lower cost?

Three drift schedules share a Gaussian endpoint density. Their mean paths bend in different directions, and their excess cost increases quadratically with the schedule parameter.
Figure 1. One destination, three paths. All three controls end with mean 1 and variance 1. The middle panel shows when they move. A constant drift (λ = 0) takes the minimum-cost path. Varying the drift adds exactly λ²/6 in excess cost while leaving the final distribution identical.

01 / Overview

What can a final sample tell us?

In image inpainting, a sampler can enforce the observed pixels at every step or concentrate its corrections near the end. Checking the observed region tells us how well each sampler satisfies the constraint. It leaves open how much extra work the sampler did along the way.

We call this extra work the own endpoint defect. Take the initial and final distributions produced by a particular correction. Compare its transport cost with the least cost achievable between those same distributions, under the same reference dynamics. The difference is the defect. Each correction supplies its own endpoints, even when its final distribution is unknown in closed form.

02 / Method

How do we score a recorded trajectory?

  1. Record candidate corrections under matched conditions

    Run each schedule on paired pilot inputs. Keep its transitions or velocities and measure its final constraint error. A fixed tolerance determines which candidates qualify for selection.

  2. With noise, test what the endpoints explain

    Compare the likelihood of a path under the correction and the reference sampler. For an optimal bridge, their ratio factors into a function of the start and a function of the end, conditional on the input. A Hellinger residual measures the error in fitting this factorization. When the two path laws are equivalent, we can sum the transition log ratios and fit an additive endpoint model on separate trajectories.

  3. Without noise, compare action with a dual bound

    Recorded velocities give the control action, the integrated squared correction to the base velocity with a factor of one half. A fitted scalar potential gives a lower bound on the minimum action when it satisfies the Hamilton–Jacobi–Bellman inequality. The gap measures how much action the potential leaves unexplained. We check the inequality on held-out points.

Candidate policies share pilot inputs. Endpoint error filters out infeasible candidates, and the path score selects a policy to apply to unseen conditions.
Figure 2. From pilot paths to a frozen policy. Among candidates that meet the tolerance, the selector uses the path diagnostic to choose a schedule. The schedule is fixed before quality is evaluated on unseen inputs.
When does the score certify optimality or an ordering?

Under the paper’s assumptions, the population Hellinger residual vanishes exactly at the own endpoint bridge when the reference law dominates the corrected law. The log-ratio version additionally requires equivalence. A local residual measures departures near the optimum. For a global ranking, the paper derives bounds on the true defects and compares candidates whose intervals separate.

At zero noise, a globally feasible potential yields an upper bound on the action defect, with equality at dual attainment. The experiments enforce feasibility on a finite collocation set. The convergence theorem connects the noise-scaled entropy defect to the action defect under variational convergence and recovery assumptions.

03 / Calibration

Can the diagnostic recover a known cost?

The Gaussian example in Figure 1 has an exact answer, so we can check the estimator as dimension grows from 1 to 1,024. Increasing the number of training trajectories per endpoint parameter from 24 to 48 to 96 reduced the mean absolute relative error from 4.75% to 2.25% to 1.08%. At the true optimum, every estimated defect was below 1.14 × 10−9.

Estimate-to-truth ratios remain close to one across five dimensions, relative error falls with more training paths, and estimates at the optimum stay close to zero.
Figure 3. Calibration against the exact Gaussian defect. Each configuration uses 65,536 fresh evaluation paths per replicate. Error bars show standard errors over 20 replicates.
What happens as noise approaches zero?

On one frozen SiT-XL/2 backbone, we hold initial latents, conditions and integration settings fixed. For each schedule shown, the stochastic score approaches its independently fitted zero-noise action score. The fitted log–log slopes range from 1.87 to 1.94 for noise intensities up to ¼.

For early, uniform and full corrections, path scores approach their zero-noise values as noise decreases.
Figure 4. The SiT noise sweep. Diamonds mark the deterministic estimates. The dashed line in the bottom panel shows quadratic scaling for comparison.

04 / Experiments

Which corrections work on unseen inputs?

On ImageNet at 256 pixels, we select a feasible correction for each task and noise level on a frozen SiT model. Relative to relaxed correction, the chosen policy lowers FID from 60.6 to 34.7 for inpainting and from 60.0 to 47.0 for 4× super-resolution. Full correction achieves the smallest constraint error in both tasks.

ImageNet results from Table 2 of the paper, averaged over noise intensities 0 and 1. FID uses 10,000 outputs. Lower values are better for both metrics.
PolicyInpainting FIDInpainting error4× SR FID4× SR error
Diagnostic selection34.70.04247.00.038
Fixed full39.40.00652.10.001
Action only42.80.06150.90.044
Relaxed correction60.60.07360.00.041
DPS60.00.18958.90.172

SD3 Medium at 1,024 pixels

We tested the frozen schedules on 64 unseen COCO conditions with two seeds. All three selected schedules met the relative constraint-error tolerance of 0.3. Compared with full projection, LPIPS fell by 0.0083 for center-mask inpainting, 0.0233 for irregular masks and 0.0178 for 4× super-resolution.

Timing guidance on EDM2

On ImageNet at 512 pixels, early, uniform and late guidance at the same strength of 0.4 scored 26.0, 2,293.7 and 30,982.1 on the path diagnostic. The terminal metrics showed no statistically significant differences after Holm correction. Guidance timing was visible in the paths even where the final metrics could not resolve it.

SD3 action decompositions, held-out dual feasibility checks, and perceptual gains plotted against relative constraint error for two inpainting tasks and super-resolution.
Figure 5. Reading the SD3 trade-off. Stars mark the diagnostic selections. In the right panel, a point above zero has lower LPIPS than full projection, and a point farther left has smaller constraint error.

Scope. None of the 70 tested SiT corrections passed its optimality test. The experiments identify better choices among the feasible schedules tested. The uncorrected process illustrates why the feasibility check matters. Its defect is zero, yet it fails the task constraint.

05 / Reference

Cite this work

Accepted to AAAI 2027 · Camera-ready manuscript

@inproceedings{li2027optimality,
  title={Optimality Diagnostics for Corrected Diffusion and Flow Models},
  author={Li, Jialin and Zhang, Zhuo and Lan, Guipeng and Cao, Yue and Xiao, Shuai and Yang, Jiachen},
  booktitle={AAAI Conference on Artificial Intelligence},
  year={2027},
  note={Accepted, camera-ready version}
}

Research figure

Open original ↗