Diagnosing and Improving Diffusion Models by Estimating the Optimal Loss Value

Yixian Xu, Shengjie Luo, Liwei Wang, Di He, Chang Liu

TL;DR

In diffusion models, the training loss doesn't drop to zero even for a "perfect" model. This makes it difficult to tell if a model is underperforming or if the task is simply inherently difficult at a given noise level. This paper derives a way to estimate this "optimal loss" floor and shows that by focusing on the loss gap (actual loss minus optimal loss), researchers can design better training schedules and more accurately predict how models will perform as they scale up.

The Problem: Ambiguity in Diffusion Loss

When training a standard classifier, a loss of zero usually means a perfect fit. In diffusion models, however, the "optimal" loss is typically a positive, unknown value. This happens because at high noise levels, multiple clean images could have realistically resulted in the same noisy image—the "ground truth" is fundamentally ambiguous.

This creates three major headaches for researchers:

  1. Diagnosis: If your loss is high, is it because your model lacks capacity (underfitting), or because the noise level makes the task impossible even for an oracle?
  2. Schedules: Without knowing the "floor" for each noise level, it’s hard to decide which parts of the diffusion process need more training focus.
  3. Scaling Laws: We usually expect model performance to follow a "power law" (bigger models = predictably better results). However, raw diffusion loss doesn't fit this curve well because the constant "optimal loss" floor masks the true improvements in model capacity.

Methods: Estimating the "Optimal Loss" Floor

The authors provide a unified mathematical framework that covers various diffusion flavors (like EDM, Flow Matching, and DDPM). Their primary contribution is the corrected Diffusion Optimal Loss (cDOL) estimator.

Estimating the optimal loss is computationally brutal because it involves "nested expectations"—essentially comparing every image in a dataset against every other image to see how much they overlap when blurred by noise. To make this feasible for massive datasets like ImageNet, the authors developed a scalable stochastic estimator.

The cDOL uses a technique called Self-Normalized Importance Sampling (SNIS) but adds a clever "correction parameter" ($C$). This parameter fixes a bias that occurs when the estimator accidentally correlates a noisy sample too closely with its own original clean version, which would otherwise lead to an over-optimistic (too low) estimate of the optimal loss.

Optimal loss estimated by cDOL across different datasets compared to the full-dataset reference.

The researchers validated their approach across a wide range of standard benchmarks, including CIFAR-10 (for initial proof-of-concept against exact calculations), FFHQ-64, and ImageNet (to demonstrate scalability to large-scale, diverse data).

Key Insights and Ideas

  • The "Critical Point" ($\sigma^*$): The authors found that optimal loss stays near zero until a specific noise threshold. Below this point, noisy images are distinct enough that they don't "overlap." Beyond this point, the task becomes intrinsically ambiguous, and the optimal loss floor starts to rise.
  • The FID Paradox: Surprisingly, they discovered that in certain noise regions, a higher loss gap actually correlates with better final image quality (FID). This suggests that trying to perfectly minimize loss at every single step isn't always the best strategy for generating visually appealing pictures.
  • Linearizing the Power Law: By subtracting the estimated optimal loss from the training loss, the "scaling law" curves (plotting error vs. compute) become much straighter. This proves that the "loss gap" is a more principled metric for the field than raw loss.

Key Results

  • Performance Boost: By using a training schedule informed by the optimal loss, the authors improved the Frechet Inception Distance (FID)—a standard measure of image quality—by 2% to 14% on CIFAR-10 and 7% to 25% on ImageNet-64.
Training schedules informed by the optimal loss yield better FID scores compared to standard baselines.
  • State-of-the-Art Refinement: They applied their schedule to LightningDiT, a high-performance transformer-based diffusion model, and achieved a 9% FID improvement on ImageNet-256.
  • Scaling Accuracy: In their scaling law experiments, the correlation coefficient ($\rho$) for the power-law fit improved from 0.82 to 0.94 at large noise scales when using the loss gap instead of raw loss. For total loss across all steps, the correlation reached a near-perfect 0.99.

Limitations and Future Work

While the cDOL estimator is much faster than previous methods, it still requires a significant one-time computational cost to "profile" a dataset (about one day on 2400 CPU cores for ImageNet).

The authors also note that while the "loss gap" is a superior metric for data-fitting, it doesn't perfectly capture "sampling quality" (how good the final images look to humans). Future work could involve investigating if there are other "optimal" values for different metrics that could further bridge the gap between training math and visual aesthetics.

Summary updated

BibTeX
@inproceedings{xu2026diagnosing,
  author = {Yixian Xu and Shengjie Luo and Liwei Wang and Di He and Chang Liu},
  title = {{Diagnosing and Improving Diffusion Models by Estimating the Optimal Loss Value}},
  booktitle = {International Conference on Learning Representations},
  year = {2026},
  url = {https://openreview.net/forum?id=X7JfjLKKLQ},
}
Figure