Abstract
Diffusion models generate high-quality images by reversing a noise process, but the computational cost of many sampling steps remains a significant bottleneck. While substantial progress has been made in developing advanced solvers, the selection of stepsize schedules has remained largely heuristic. This paper introduces Optimal Stepsize Distillation (OSS), a dynamic programming framework that mathematically determines the optimal timesteps for sampling. By minimizing global discretization error relative to a high-step teacher model, OSS achieves a 10x speedup in generation while maintaining over 99% of the original model's performance across various architectures.
Introduction
The efficiency of diffusion models, such as Stable Diffusion or Flux, is determined by two primary factors: the solver (the direction of each step) and the schedule (the size of each step). While solvers like DPM-Solver++ have matured, stepsize schedules often rely on uniform steps or hand-crafted curves. These ad-hoc schedules become suboptimal in low-step regimes (e.g., under 10 steps), leading to significant drops in image fidelity and structural detail due to accumulated discretization error.
Methodology
The authors propose Optimal Stepsize Distillation (OSS) to move beyond heuristic schedules. The method is built on several key technical pillars:
1. Teacher-Student Framework
OSS utilizes a "teacher" model (running 100–200 steps) to define a reference trajectory. A "student" model then seeks the best $M$ steps (where $M$ is small, like 5 or 10) to match the teacher's final output as closely as possible.
2. Dynamic Programming for Global Error Minimization
The core innovation is the recognition that stepsize optimization possesses an "optimal substructure." The best $M$-step schedule inherently contains the best $(M-1)$-step sub-schedule. By formulating this as a recursive error minimization problem, the authors use dynamic programming (DP) to efficiently search for theoretically optimal timesteps. Unlike previous methods that minimize local step-by-step error, OSS minimizes the global discretization error, ensuring the final image remains faithful to the "perfect" trajectory.
3. Amplitude Calibration and Unified Reparameterization
In low-step regimes, the "amplitude" (contrast and color distribution) of generated tensors often deviates from the teacher. OSS introduces a per-step affine transformation to realign these characteristics, significantly improving visual realism. Additionally, to ensure cross-architecture compatibility (U-Net vs. Transformer), models are reparameterized into a unified "velocity prediction" space (Flow Matching).
Evaluation and Results
The framework was evaluated on standard benchmarks including ImageNet-64, LSUN-Bedrooms-256, FFHQ-64, MSCOCO-512, and GenEval.
Key Performance Metrics
- 10x Acceleration: On the state-of-the-art Flux.1-dev model, OSS reduced sampling from 100 steps to 10 while preserving 99.4% of the performance on the GenEval benchmark.
- Quantitative Gains: On ImageNet-64, OSS improved PSNR by an average of 2.65 dB over naive uniform step reduction.
- Generalization (OSS-ave): The authors found that optimal schedules for different images overlap significantly. By averaging schedules from a small subset (e.g., 512 samples), they created a "universal" optimal schedule that works for any input, eliminating the need for per-image optimization.
Discussion and Conclusion
OSS demonstrates that optimizing where you step is as critical as how you step. The method is orthogonal to solver choice, providing performance gains regardless of whether a simple first-order Euler solver or a complex higher-order solver is used. While currently focused on ODE solvers and requiring a teacher trajectory for the initial distillation, OSS sets a new standard for efficient diffusion sampling. Future work may combine OSS with progressive distillation to achieve high-quality generation in as few as 1–2 steps.
Summary updated