PTQD: Accurate Post-Training Quantization for Diffusion Models

Diffusion models have recently dominated image synthesis tasks. However, the iterative denoising process is expensive in computations at inference time, making diffusion models less practical for low-latency and scalable real-world applications. Post-training quantization (PTQ) of diffusion models can significantly reduce the model size and accelerate the sampling process without re-training. Nonetheless, applying existing PTQ methods directly to low-bit diffusion models can significantly impair the quality of generated samples. Specifically, for each denoising step, quantization noise leads to deviations in the estimated mean and mismatches with the predetermined variance schedule. As the sampling process proceeds, the quantization noise may accumulate, resulting in a low signal-to-noise ratio (SNR) during the later denoising steps. To address these challenges, we propose a unified formulation for the quantization noise and diffusion perturbed noise in the quantized denoising process. Specifically, we first disentangle the quantization noise into its correlated and residual uncorrelated parts regarding its full-precision counterpart. The correlated part can be easily corrected by estimating the correlation coefficient. For the uncorrelated part, we subtract the bias from the quantized results to correct the mean deviation and calibrate the denoising variance schedule to absorb the excess variance resulting from quantization. Moreover, we introduce a mixed-precision scheme for selecting the optimal bitwidth for each denoising step. Extensive experiments demonstrate that our method outperforms previous post-training quantized diffusion models, with only a 0.06 increase in FID score compared to full-precision LDM-4 on ImageNet 256x256, while saving 19.9x bit operations. Code is available at https://github.com/ziplab/PTQD.

Paper

References (70)

Scroll for more · 38 remaining

Similar papers

Peer review

Reviewer 5dgo5/10 · confidence 4/52023-06-20

Summary

The paper introduces PTQD, a Post-Training Quantization framework for Diffusion models. PTQD analyzes the influence of quantization noise on diffusion noise. The method suggests separating the quantization noise into noise correlated and uncorrelated with the full-precision reverse diffusion. The correlated part is easily fixed by estimating the correlation coefficient. The residual noise is corrected by modifying the stochastic variance of DM in reverse diffusion. Finally, a mixed precision which is time-step aware is proposed based on gathered statistics.

Strengths

The paper is clearly written.\ The analysis of DM quantization challenges is interesting, well-described, and well-mathematically defined and analyzed.\ The framework while being very simple (mainly based on gathered statistics) still can outperform previous work.

Weaknesses

The main weaknesses are as follows: 1) The practical ability of the method to deal with the residual noise. (see question 1)) 2) The weak comparisons. (see questions 3-4))

Questions

1) As far as I know most DDPMs make no use of the stochastic reverse diffusion ($\sigma_t = 0$). In that case, the contribution and impact are certainly reduced. 2) A visualization of the generated images should be provided in order to ass the impact on both the generation and reconstruction quality. 3) Comparison with regular PTQ should be performed at different bit ranges (not only naive TensorRT's uniform quantization but others such as MMSE etc.) 4) Ablations: The ablation is good but should also be performed at a constant precision (not MP) in order to assess the real impact of each suggestion, independently of the mixed precision correction.

Rating

5: Borderline accept: Technically solid paper where reasons to accept outweigh reasons to reject, e.g., limited evaluation. Please use sparingly.

Confidence

4: You are confident in your assessment, but not absolutely certain. It is unlikely, but not impossible, that you did not understand some parts of the submission or that you are unfamiliar with some pieces of related work.

Soundness

3 good

Presentation

3 good

Contribution

3 good

Limitations

Limitations are ok.

Reviewer MVe55/10 · confidence 4/52023-06-30

Summary

The paper suggests a method for post-training quantization of diffusion models. The method consists of a factorization of the quantization noise into a correlated and an uncorrelated part, and then addressing each component separately, either by linearly regressing for the correlation coefficient, or incorporating the quantization noise into the diffusion noise level. The authors conduct extensive experiments on multiple datasets, and obtain generation quality comparable to that of the full-precision model in most cases.

Strengths

- The characterization of the quantization noise, and incorporating its uncorrelated part into the diffusion noise is a nice idea. - The obtained results are impressive.

Weaknesses

- Related work lacks a specific description of methodical/result-based differences between this work and Q-Diffusion. "Analyze the quantization effect" and "unified framework" are very broad terms that give little to no context. - Lines 170-171: When does this linear regression happen? At training time or test time? What data do you use for this? Details lacking. Edit: Data is provided at the end of page 7, just please mention that details will be presented later from lines 170-171. - What is $SNR^F$? What is the motivation behind it? Why is it defined this way? What is its purpose? These details should not be delegated to a citation. - The reason not to compare with PTQ4DM sounds unreasonable. We can still compare results even if they do not specify the PTQ method used. Moreover, it seems like PTQ4DM has a public git repo with their code. The PTQ method can be inferred from that. Moreover, Q-Diffusion seems to have a curious failure mode for multi-precision. When considering a single precision level, it seems like the new method is not very different from Q-Diffusion in terms of results. - No wall clock time comparison is given, even though slow runtime of diffusion models is touted as one of the main drawbacks of these models.

Questions

- What does Figure 2 plot? Axis titles represent vectors. If the numbers plotted are entries in these vectors, it should be noted in the figure caption or in the text. - Equation 12 and its following text gloss over the case "otherwise". Mathematically, $\sigma_t^2 = 0$ is *not* a solution for Eq. 11 in this case, and should not be presented as such. When quantization noise becomes larger than $\sigma_t^2$, especially in the mentioned deterministic case, the proposed method cannot deal with the noise. If it does, a thorough explanation is needed here.

Rating

5: Borderline accept: Technically solid paper where reasons to accept outweigh reasons to reject, e.g., limited evaluation. Please use sparingly.

Confidence

4: You are confident in your assessment, but not absolutely certain. It is unlikely, but not impossible, that you did not understand some parts of the submission or that you are unfamiliar with some pieces of related work.

Soundness

2 fair

Presentation

1 poor

Contribution

2 fair

Limitations

Potential negative impact: Yes. Limitations: No.

Reviewer oS4i6/10 · confidence 2/52023-07-04

Summary

The authors propose a new post-training quantization method for diffusion models titled PTQD that disentangles the quantization noise into correlated and uncorrelated parts regarding its full-precision counterpart, and demonstrate that PTQD generates as much high-quality samples as its full-precision counterpart.

Strengths

(1) The idea of disentangling the quantization noise into correlated and uncorrelated parts regarding its full precision counterpart seems to be novel. (2) PTQD shows better performance than previous methods in both class-conditional image generation and unconditional image generation.

Weaknesses

(1) Although PTQD reduces BOPs greatly, it is doubtful whether the speed of PTQD generating samples is really faster than that of its full-precision counterpart in real time.

Questions

N/A

Rating

6: Weak Accept: Technically solid, moderate-to-high impact paper, with no major concerns with respect to evaluation, resources, reproducibility, ethical considerations.

Confidence

2: You are willing to defend your assessment, but it is quite likely that you did not understand the central parts of the submission or that you are unfamiliar with some pieces of related work. Math/other details were not carefully checked.

Soundness

3 good

Presentation

3 good

Contribution

3 good

Limitations

N/A

Reviewer LoUy5/10 · confidence 5/52023-07-06

Summary

The paper proposed the quantization scheme for Diffusion models, where they disentangled the quantization noise into the correlated and uncorrelated parts; Then, they incorporated the correlated part into diffusion-perturbed noise and calibrated the denoising variance schedule to absorb additional variance into diffusion noise. They also suggested a mixed-precision quantization scheme for handling the difference in activations variance for each time step.

Strengths

It is a novel point of view in incorporating quantization noise into diffusion noise. It also sounds good to me to utilize the bias correction proposed in DFQ to handle the uncorrelated part.

Weaknesses

It does not seem to show noticeable improvement compared to existing works, Q-diffusion. It seems to require more experiments to show their performance. The ablation study was performed only when quantizing with mixed precision. The mixed-precision scheme has any special things; the effect seems to be insignificant according to table 2.

Questions

1. It would be helpful if you the match the technique the author proposed with the description of the method sections. The terms of CNC, VSC and BC was suddenly advent in the result section. 2. It would make it easy to follow your work if you provide your algorithm in the manuscript. 3. could you provide how many bit-width is allocated for each step for a specific model. 4. could you provide the result when setting k as arbitrarily? 5. Why did you do the ablation study with mixed precision? 6. In your result, the mixed-precision scheme seems not well worked out for Q-diffusion. could you provide the reasons? 7. In Section 4.1, did you want to explain that quantization noise is divided into the correlated part and unrelated part due to normalization layers? Or is it just an example? 8. In line 180, what are the bias and additional variance? Please notate them with symbols for clarity

Rating

5: Borderline accept: Technically solid paper where reasons to accept outweigh reasons to reject, e.g., limited evaluation. Please use sparingly.

Confidence

5: You are absolutely certain about your assessment. You are very familiar with the related work and checked the math/other details carefully.

Soundness

3 good

Presentation

2 fair

Contribution

2 fair

Limitations

There seems to have still room for improving the readability and clarity in the manuscript.

Authorsrebuttal2023-08-14

Follow-Up on Rebuttal

Dear Reviewer LoUy, We greatly appreciate the time and effort in reviewing our work. We have carefully considered your comments and suggestions and have made significant revisions to address the concerns you raised. We are eager to ensure that our paper meets the high standards of our respected reviewers. Please don’t hesitate to let us know if there is any additional feedback you might have at this stage. Best regards, Authors of #2641.

Reviewer LoUy2023-08-15

dpm++

Thank you for your effort to address my concern. I have an additional suggestion. As in Q-Diffusion, could you provide the results of applying latest solver such as dpm++ into your quantized models ?

Authorsrebuttal2023-08-17

Response to dpm++

Dear Reviewer LoUy, Thanks for your kind suggestion. As referred to Table 4 in the rebuttal PDF and our response to Reviewer i5nq, we have conducted experiments over recent solver PLMS[i], demonstrating the strong performance of PTQD under this solver. Additionally, we present the results of our PTQD over latest DPM++[ii] solver on LSUN-Churches dataset, as shown below. Notably, our PTQD with W3A8 bitwidth achieves a sFID result comparable to that of W4A8 Q-Diffusion. | Model | Method | Bitwidth (W/A) | FID | sFID | |-------------|-------------|----------------|--------|--------| | LDM-8 (steps=50, eta=0.0) | FP | 32/32 | 5.97 | 21.50 | | | Q-Diffusion | 4/8 | 7.80 | 23.24 | | | Ours | 4/8 | **7.45** | **22.74** | | | Q-Diffusion | 3/8 | 11.44 | 24.67 | | | Ours | 3/8 | **10.72** | **23.36** | Once again, thank you for your time and commitment in reviewing our work. Best regards, Authors of #2641. [i] Liu, Luping, et al. "Pseudo numerical methods for diffusion models on manifolds." ICLR 2022. [ii] Lu, Cheng, et al. "Dpm-solver++: Fast solver for guided sampling of diffusion probabilistic models." arXiv 2022.

Reviewer LoUy2023-08-18

Thank you for your response.

Most of my concerns are addressed. So I'm willing to raise the score.

Authorsrebuttal2023-08-21

Kindly Inquiry to Reviewer LoUy

Dear Reviewer LoUy, We want to express our gratitude for your valuable feedback, and we are genuinely pleased to learn that most of your concerns have been addressed, and you are considering a score adjustment. We understand your busy schedule, but if you've determined the new score, we would be extremely grateful to know the outcome. If there are any additional concerns you have, please feel free to let us know. Thank you once again for your time, guidance, and consideration. Best regards, Authors of #2641.

Reviewer i5nq6/10 · confidence 2/52023-07-27

Summary

This paper introduces PTQD, a novel method designed to tackle issues arising when applying existing post-training quantization techniques directly to low-bit diffusion models. The proposed approach disentangles quantization noise into its correlated and residual uncorrelated components regarding its full-precision counterpart, enabling separate correction for each part . Moreover, the authors present Step-aware Mixed Precision, a scheme that dynamically selects optimal bitwidths for individual denoising steps. Extensive experiments on three image datasets demonstrate significant improvements in image quality compared to the baseline.

Strengths

1. PTQD presents a unique method that disentangles quantization noise and addresses it separately, while Step-aware Mixed Precision dynamically optimizes bitwidths for synonymous steps, demonstrating a comprehensive approach to quantization in diffusion models. 2. The experimental results provide strong evidence of PTQD's effectiveness in enhancing image quality, validating its practical value. 3. The paper is well-organized and clearly presented, with the supplementary file extending PTQD to DDIM and including a statistical analysis of residual quantization noise, which bolsters the credibility of their work.

Weaknesses

1. To further validate PTQD's performance, it would be beneficial to include comparisons with more competitive methods, such as recent DDPM variants, in the experiments. 2. Evaluating PTQD with other post-training quantization methods on diverse image datasets would enhance its applicability and demonstrate its effectiveness across various tasks, making the findings more robust.

Questions

See weakness.

Rating

6: Weak Accept: Technically solid, moderate-to-high impact paper, with no major concerns with respect to evaluation, resources, reproducibility, ethical considerations.

Confidence

2: You are willing to defend your assessment, but it is quite likely that you did not understand the central parts of the submission or that you are unfamiliar with some pieces of related work. Math/other details were not carefully checked.

Soundness

3 good

Presentation

3 good

Contribution

3 good

Limitations

None.

Reviewer MVe52023-08-12

Thank you for your response. The added results and explanations following my fellow reviewers' and my suggestions indeed enrich the paper. Therefore, I change my recommendation to acceptance.

Authorsrebuttal2023-08-12

Dear Reviewer MVe5, Thank you for your feedback. We truly appreciate your careful consideration of our responses to your and the other reviewers' suggestions. Best regards, Authors of #2641.

Program Chairsdecision2023-09-21

Decision

Accept (poster)

© 2026 NYSGPT2525 LLC