NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Sampling-Aware Quantization for Diffusion Models

Qian Zeng, Jie Song, Yuanyu Wan, Huiqiong Wang, Mingli Song

TL;DR

Quantization and fast sampling are two popular ways to speed up diffusion models, but combining them usually degrades image quality because quantization noise derails high-order numerical samplers. This paper introduces a "sampling-aware" quantization framework that aligns the trajectories of quantized and full-precision models, enabling massive hardware acceleration (up to 46x fewer bit operations) without sacrificing generation fidelity—even down to 4-bit precision.

What Problem Does This Paper Address?

Diffusion models generate incredible imagery, but they are notoriously slow and computationally heavy due to their iterative denoising process. To make them practical for real-time or edge-device deployment, researchers typically use two independent strategies:

  1. High-order samplers (like DPM-Solver), which drastically reduce the number of denoising steps needed.
  2. Model quantization, which compresses the network by converting 32-bit floating-point (FP32) weights and activations into low-bit fixed-point integers (like INT8 or INT4).

The catch? When you try to use both strategies at the same time, performance tanks.

The authors discover that quantization introduces subtle noise that shifts the model's directional estimation at each step. High-order samplers rely on calculating multiple intermediate steps to chart an accurate mathematical trajectory. When quantization noise corrupts these intermediate steps, the errors accumulate rapidly. This causes the sampling path to drift, effectively transforming a stable, deterministic probability flow into a chaotic, variance-exploding trajectory that destroys image quality.

Figure 2. Direction estimation in reverse diffusion sampling. (a) The first-order sampler performs a single direction estimation at the beginning of the sampling interval. (b) The second-order sampler refines the direction estimation by evaluating additional intermediate steps within the interval. (c) Quantization errors lead to deviations in direction estimation, causing the intermediate steps in high-order samplers to drift over time, ultimately impacting the final direction estimation. (d) Our proposed Mixed-Order Trajectory Alignment achieves a more linearized probability flow.

Methods

To fix this trajectory drift, the authors propose Sampling-Aware Quantization, driven by a core strategy called Mixed-Order Trajectory Alignment (MOTA). Instead of just minimizing the layer-by-layer error of the network on static data, MOTA forces the quantized model's lower-order (first-order) sampling direction to align with the full-precision model's higher-order sampling direction. This effectively linearizes the probability flow and constrains error accumulation.

The framework introduces two distinct variants depending on the target bit-width:

  • SA-PTQ (Sampling-Aware Post-Training Quantization): Tailored for 8-bit quantization (W8A8). It uses a dual-order trajectory sampling method to collect calibration data from both first- and second-order samplers, optimizing the network modules independently without full retraining.
  • SA-QLoRA (Sampling-Aware Quantized Low-Rank Adaptation): Designed for aggressive low-bit settings, such as 4-bit weights and activations (W4A4). It fine-tunes low-rank adaptation (LoRA) parameters alongside quantization scales and zero-points using a specialized directional cosine similarity loss ($L_{COS}$) and the MOTA trajectory constraint ($L_{MOTA}$).
Figure 3. Sampling-aware quantization workflow. (a) Module-level reconstruction process employed in SA-PTQ, where ˆfi(·) denotes the module undergoing quantization and reconstruction. (b) Basic fine-tuning workflow in SA-QLoRA, where LoRA weights WLoRA and quantization parameters s, z are iteratively updated after each sampling step.

Datasets

The authors validated their approach across several standard generative benchmarks:

  • ImageNet (256×256): Used for class-conditional image generation.
  • LSUN-Churches & LSUN-Bedroom (256×256): Used for unconditional image generation.
  • MS-COCO (512×512): Used for text-to-image generation via Stable Diffusion (SD-v1.4).

Key Insights and Ideas

  • The Coupling Effect: Quantization and sampling cannot be treated as separate, isolated blocks. Quantization noise directly violates the mathematical smoothness assumptions that high-order numerical solvers rely on.
  • Trajectory over Layer Outputs: Traditional post-training quantization focuses on minimizing the mean squared error (MSE) of individual layer outputs. This paper demonstrates that for iterative models like diffusion, optimizing for the global direction of the sampling trajectory is far more critical.
  • Linearizing the Flow: By forcing mixed-order alignments, the method acts as a regularizer that straightens out the probability flow, preventing the catastrophic divergence that usually plagues low-bit diffusion models.

Key Results

  • Breakthrough in 4-Bit Quantization: In ultra-low bit-width settings (W4A4), previous state-of-the-art quantization methods completely fail, producing distorted images or failing to converge. SA-QLoRA successfully generates high-quality images, achieving a Fréchet Inception Distance (FID) of 13.73 on ImageNet.
  • Outperforming Full Precision: Remarkably, under the W4A8 configuration on ImageNet, SA-QLoRA achieved an FID of 8.55, actually outperforming the full-precision FP32 baseline (FID 9.45), likely due to the regularizing effect of the trajectory-guided fine-tuning.
  • Massive Hardware Savings: The W4A4 configuration delivers a 46.67x reduction in Bit Operations (BOPs) and shrinks the model size by 7.95x, making these models highly viable for resource-constrained edge devices.
Figure 1. Visual comparison on ImageNet 256×256. While other low-bit methods diverge or degrade, SA-QLoRA preserves sharp, accurate image structures.

Limitations and Future Work

The limitations are not explicitly detailed in the paper. However, a natural trade-off of the ultra-low bit variant (SA-QLoRA) is that it requires an iterative fine-tuning phase, which introduces more computational overhead during the calibration process compared to pure, training-free post-training quantization (PTQ). Additionally, while the authors outline adaptation principles for generalized samplers like PLMS and DDIM, the primary mathematical formulations in the text focus heavily on DPM-Solver.

Summary updated

BibTeX
@inproceedings{zeng2026sampling,
  author = {Qian Zeng and Jie Song and Yuanyu Wan and Huiqiong Wang and Mingli Song},
  title = {{Sampling-Aware Quantization for Diffusion Models}},
  booktitle = {IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  year = {2026},
  url = {https://openreview.net/forum?id=JGRQPX2NPQ},
}
Figure