TL;DR
Diffusion models, while powerful, are computationally expensive. Quantization can reduce this cost but often degrades image quality due to residual errors. This paper introduces a "Deformable Noise Scheduler" (DNS) that absorbs these quantization errors by reinterpreting them as a timestep shift, preserving the diffusion model's output quality across various sampling methods without architectural changes or significant overhead.
What Problem Does This Paper Address?
Diffusion models have revolutionized image generation, but their large size and computational demands make them impractical for many real-world applications. Post-training quantization (PTQ) is a common technique to shrink these models and speed up inference by using lower-precision numbers (e.g., integers instead of floating-point). However, this process introduces errors. In diffusion models, these errors accumulate across the many denoising steps, distorting the underlying data distribution and leading to a noticeable drop in image quality. Existing methods to mitigate this either focus on weight adjustments (which don't fully address distribution drift) or inject noise (which often only works for stochastic samplers and assumes a Gaussian distribution for errors, which isn't always true). The core problem is how to quantize diffusion models effectively without sacrificing generation quality, especially for deterministic samplers and flow-matching models.
Methods
The paper proposes a two-pronged approach:
- Distribution-Calibrated Noise Compensation (DCNC): This component addresses the non-Gaussian nature of quantization noise. It analyzes the "tailedness" (kurtosis) of the residual quantization error and adds a calibrated uniform noise component to make it more closely resemble a Gaussian distribution. This is crucial because many diffusion model assumptions rely on Gaussian noise.
- Deformable Noise Scheduler (DNS): This is the core innovation. DNS reinterprets the effect of quantization errors not as adding noise, but as a "timestep shift." Essentially, it maps the distribution of the quantized model's prediction back to what it would have been at a slightly different, full-precision timestep. This effectively absorbs the quantization error into the generative process by adjusting the noise schedule, ensuring the output distribution remains consistent with the original, unquantized model. This approach is designed to be plug-and-play, meaning it can be integrated with existing PTQ methods without modifying the model's architecture or adding significant computational overhead.
Datasets
The paper uses standard datasets for evaluation:
- COCO Captions 2014: Used for calibration of quantization parameters.
- ImageNet: Used for class-conditional generation.
- MJHQ-30K: Used for text-to-image generation.
The paper does not introduce new datasets.
Key Insights and Ideas
- Quantization as a Timestep Shift: The most significant insight is reframing quantization error not as additive noise, but as a subtle shift in the diffusion process's timeline. This perspective allows for a more principled way to absorb errors.
- Non-Gaussian Nature of Quantization Noise: The authors empirically show that quantization errors are often "heavy-tailed" (excess kurtosis) and don't strictly follow a Gaussian distribution, which is a limitation of prior noise-injection methods. DCNC directly addresses this.
- Universality of the Approach: DNS is shown to work across different diffusion model architectures (UNets, Transformers), sampling methods (stochastic, deterministic), and even flow-matching models, highlighting its broad applicability.
- Plug-and-Play Simplicity: The method integrates seamlessly with existing PTQ techniques, making it easy for practitioners to adopt.
Key Results
- Improved FID Scores: The method consistently reduces Fréchet Inception Distance (FID), a key metric for generation quality, across various models and PTQ baselines. For example, on DiT-XL, it reduced FID from 9.83 to 8.51.
- Mitigating Extreme Quantization: When quantizing the FP16 LoRA branch of SVDQuant to fully integer inference, DNS effectively reduced FID from 27.16 to 26.22, demonstrating its ability to handle aggressive quantization.
- Preservation of Semantics: While FID improves, metrics like CLIPScore remain largely unchanged, indicating that the semantic meaning of the generated images is preserved.
- Minimal Overhead: DNS adds negligible computational overhead and memory usage, making it practical for deployment.
Limitations and Future Work
- PSNR Decrease: The paper notes a slight decrease in Peak Signal-to-Noise Ratio (PSNR) in some cases. While this is attributed to exploring different high-quality sampling paths rather than quality loss, it's a trade-off to consider.
- Uniform Distribution Choice: While the uniform distribution is chosen for DCNC due to its simplicity and efficiency, the paper notes that a triangular distribution achieved slightly better overall performance in some experiments. Future work could explore other low-kurtosis distributions.
- Further Optimization: The paper suggests that while DNS improves under strong baselines, there's still room for further optimization, especially in scenarios with very aggressive quantization.
Summary updated