{"about":{"site":"https://codewithpapers.app","non_affiliation":"Code with Papers and Syntology are not affiliated with, endorsed by, or sponsored by Papers with Code, Meta, or the pwc-archive mirror.","licence":"CC BY-SA 4.0","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","attribution":"https://codewithpapers.app/attribution","modified":"archive material modified by Syntology; see the attribution page"},"url":"/paper/ptqd-accurate-post-training-quantization-for-1","title":"PTQD: Accurate Post-Training Quantization for Diffusion Models","arxiv_id":"2305.10657","date":"2023-05-18","proceeding":"NeurIPS 2023 11","authors":["Yefei He","Luping Liu","Jing Liu","Weijia Wu","Hong Zhou","Bohan Zhuang"],"abstract":"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.","url_abs":"https://arxiv.org/abs/2305.10657v4","url_pdf":"https://arxiv.org/pdf/2305.10657v4.pdf","source":{"archive":"pwc-archive (Hugging Face), CC BY-SA 4.0","snapshot":"2025-07-28","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","row_kind":"abstracts"},"code_links":[{"paper_slug":"ptqd-accurate-post-training-quantization-for-1","repo_url":"https://github.com/ziplab/ptqd","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":0,"framework":"pytorch","reach":null}],"tasks":[{"task_slug":"denoising","task_name":"Denoising"},{"task_slug":"image-generation","task_name":"Image Generation"},{"task_slug":"quantization","task_name":"Quantization"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"syntology_url":"https://syntology.ai/paper/2305.10657","atlas_url":"https://app.syntology.ai/?focus=2305.10657","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2305.10657"}},"developers":"https://syntology.ai/developers","read_at":"2026-09-25T09:33:49+00:00","read_at_is":"when the build read Syntology's graph, not when any sample ran","claim":"Per-sample execution status on synthesized fixtures; not a correctness claim about the paper. Samples come from repositories linked to the paper, official or community; repo_kind says which.","repos":[{"provenance":"deterministic:regex_extraction","url":"https://github.com/ziplab/PTQD","reach":null},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/ziplab/ptqd","reach":null}],"summary":{"ran":1,"ran_draft_wrong":1,"unverified":1},"by_repo_kind":{"official":{"samples":3,"ran":2,"repositories":1}},"repo_kind_vocabulary":{"official":"The archive marks this repository official for the paper","named_in_paper":"The archive records that the paper mentions this repository; it is not marked official","listed":"In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper","found_in_text":"Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted","community":"Not in the archive's code links for this paper; a community repository Syntology harvested"},"n_pointer_only_for_licence":3,"samples":[{"code_sha256_prefix":"05184feec76de7f5","entry":"UniformAffineQuantizer","repo":"ziplab/ptqd","repo_kind":"official","path":"quant_scripts/brecq_adaptive_rounding.py","file_url":"https://github.com/ziplab/ptqd/blob/HEAD/quant_scripts/brecq_adaptive_rounding.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"05184feec76de7f5"}},{"code_sha256_prefix":"8dc011d26607845d","entry":"get_train_samples","repo":"ziplab/PTQD","repo_kind":"official","path":"quant_scripts/quantize_ldm_brecq.py","file_url":"https://github.com/ziplab/PTQD/blob/HEAD/quant_scripts/quantize_ldm_brecq.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"8dc011d26607845d"}},{"code_sha256_prefix":"1af0188a0d201eaf","entry":"AdaRoundQuantizer","repo":"ziplab/ptqd","repo_kind":"official","path":"quant_scripts/brecq_adaptive_rounding.py","file_url":"https://github.com/ziplab/ptqd/blob/HEAD/quant_scripts/brecq_adaptive_rounding.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"1af0188a0d201eaf"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}