BitsFusion: 1.99 bits Weight Quantization of Diffusion Model

Diffusion-based image generation models have achieved great success in recent years by showing the capability of synthesizing high-quality content. However, these models contain a huge number of parameters, resulting in a significantly large model size. Saving and transferring them is a major bottleneck for various applications, especially those running on resource-constrained devices. In this work, we develop a novel weight quantization method that quantizes the UNet from Stable Diffusion v1.5 to 1.99 bits, achieving a model with 7.9X smaller size while exhibiting even better generation quality than the original one. Our approach includes several novel techniques, such as assigning optimal bits to each layer, initializing the quantized model for better performance, and improving the training strategy to dramatically reduce quantization error. Furthermore, we extensively evaluate our quantized model across various benchmark datasets and through human evaluation to demonstrate its superior generation quality.

Paper

References (89)

Scroll for more · 38 remaining

Similar papers

Peer review

Reviewer Fq1C6/10 · confidence 4/52024-06-29

Summary

This paper proposes a weight quantization method to quantize the UNet of SDv1.5 to 1.99 bits while maintaining model performance comparable to the floating-point model. The approach includes a series of techniques such as bit-width allocation for mixed-precision quantization, low-bit diffusion model initialization, and a two-stage training pipeline. Extensive experiments demonstrate the effectiveness of the proposed method. Results show that the quantized diffusion model can even outperform the floating-point SDv1.5.

Strengths

1. The paper is well-written and easy to follow. 2. The per-layer sensitivity analysis is comprehensive, considering both quality and contextual information, which is helpful for future research. 3. The effectiveness of the proposed approach is validated across multiple datasets and evaluation metrics. 4. The generated results look impressive.

Weaknesses

1. It is well-known that QAT-based approaches can achieve superior performance at the expense of additional training effort. While this work involves training the weights via QAT, it does not include comparisons with other QAT-based methods such as Q-DM and TDQ. 2. It is unclear how the sensitivity threshold in Section 3 is determined and whether this hyperparameter generalizes to other models.

Questions

1. The setting of activation is not mentioned in the paper. Are the activations kept in floating point? 2. What is the dataset used for stage-II training? Suppose the training set of the corresponding dataset is used. In that case, claiming the model outperformed the floating-point SDv1.5 model may be inappropriate since the SDv1.5 model is evaluated under a zero-shot setting. 3. The average bits uses $\log(2^n + 1)$ bits for calculation. Is it necessary to incorporate an optimal encoding method such as Huffman encoding to reach this average bit-width?

Rating

6

Confidence

4

Soundness

3

Presentation

3

Contribution

2

Limitations

See weaknesses and questions.

Reviewer W2xs6/10 · confidence 5/52024-07-06

Summary

The paper presents BitsFusion, a novel method for weight quantization of diffusion models, specifically applied to the UNet architecture in Stable Diffusion v1.5. The approach quantizes weights to 1.99 bits, achieving a model size reduction of 7.9 times while enhancing or maintaining image generation quality. The experiment evaluates the quantized model across various benchmarks, including MS-COCO, TIFA, GenEval, and human evaluations, and demonstrates superior performance of the quantized model compared to full-precision Stable Diffusion v1.5.

Strengths

1.The paper is well-organized and presents its content in an accessible manner. The organization of the paper is clear. 2.This paper mainly focuses on quantizing large-scale models like Stable Diffusion v1.5 with fewer bits than 4, which has significant implications for the industry and has achieved satisfactory results. 3.The paper methodologically addresses the challenges associated with low-bits quantization in SD and provides a robust solution through the BitsFusion framework. The experiments demonstrate the effectiveness of BitsFusion in achieving superior performance compared to existing methods on various large-scale datasets.

Weaknesses

1.The motivation of the paper seems to be heuristic and lacks necessary theoretical analysis, but the impact of this method in the industry is worth looking forward to.

Questions

What's the total resource consumption for this entire process? For instance, how many GPUs with what memory capacity were utilized, and for how many hours was the training conducted? How does this compare to the resources required for a baseline that trains the original SD v1.5?

Rating

6

Confidence

5

Soundness

3

Presentation

3

Contribution

3

Limitations

See weakness.

Reviewer tjXw5/10 · confidence 5/52024-07-13

Summary

This paper demonstrates a quantized diffusion model called BitFusion, which successfully quantize the Stable Diffusion (SD) v1.5 to 1.99 bits with 7.9x smaller size. They first analyse the SD model in a layer perspective and assign the optimal bit based on the analysis. Then they propose a training pipeline to perform quantization-aware training (QAT) based on the analysis result. The experiment result shows that the quantized diffusion model BitFusion outperforms the full-precision SD v1.5 model.

Strengths

1. The result is significant. BitFusion successfully compressed the SD model while maintaining its performance. 2. The authors successfully combine novel quantization techniques and existing quantization techniques, showing an effective way to quantize SD model to extreme low bit. 3. The paper provides valuable observations about different layers' behaviour under quantization.

Weaknesses

1. The analysis and experiment according to scaling factor initialization is not comprehensive. The authors propose alternating optimization for scaling factor initialization which is based on the MSE between quantized weight and full-precision weight. However, quantized weight initialization is well-studied and there are existing weight initialization technique that optimize the same objective. Nevertheless, there are some advanced initialization technique like adaround [1]. Those techniques are adapted by other Diffusion Model quantization research [2]. An experiment to compare the alternating Opt. and those initialization techniques is necessary. 2. Stable Diffusion 1.5 is no longer the SOTA in Diffusion text-to-image model. Diffusion transformer (DiT) is the new trend in diffusion model research. The conclusion on UNet-based diffusion model like SD 1.5 might not be precise for the DiT diffusion model. 3. FID is widely adapted by most of the diffusion model quantization research. Although the authors provide human evaluation and justify that FID is not accurate compared with human evaluation, the FID comparison between BitFusion and other baseline models should be included in the main body of the paper. 4. In this paper [3], the authors propose a 1.58-bit LLM quantization approach comparable to Bit Fusion at model size reduction. However, they can perform activation quantization to 8-bit while Bit Fusion doesn't. [1] Nagel, Markus, et al. "Up or down? adaptive rounding for post-training quantization." International Conference on Machine Learning. PMLR, 2020. [2] Li, Xiuyu, et al. "Q-diffusion: Quantizing diffusion models." Proceedings of the IEEE/CVF International Conference on Computer Vision. 2023. [3] Ma, Shuming, et al. "The era of 1-bit llms: All large language models are in 1.58 bits." arXiv preprint arXiv:2402.17764 (2024).

Questions

NA

Rating

5

Confidence

5

Soundness

2

Presentation

3

Contribution

2

Limitations

The authors honestly point out their limitation: not quantizing VAE and text encoder and not quantizing activation. For the first limitation, it is quite common that diffusion model quantization research doesn't quantize VAE and text encoder according to the literature. But for the second limitation, the authors leave it for future work and doesn't address it. Activation quantization is recommended, as the fact that activation usually has higher quantization difficulty.

Reviewer tjXw2024-08-13

Additional Comment ny authors

Dear authors, Thanks for your valuable information. It is worth noting that the findings in prior diffusion model quantization research are mostly based on the U-Net structure, like shortcut splitting quantization in Q-Diffusion [1] and temporal information aware reconstruction in TFMQ-DM [2]. However, the findings in BitFusion, like how to decide the optimal precision, are not limited to the U-Net diffusion model. So I still suggest BitFusion's effectiveness be further verified with DiT as most of the SOTA diffusion models are DiT-based. Best, Reviewer tjXw [1] Li, Xiuyu, et al. "Q-diffusion: Quantizing diffusion models." Proceedings of the IEEE/CVF International Conference on Computer Vision. 2023. [2] Huang, Yushi, et al. "Tfmq-dm: Temporal feature maintenance quantization for diffusion models." Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. 2024.

Authorsrebuttal2024-08-14

Response to additional comments

Dear Reviewer tjXw, Thank you for your additional response. We appreciate the time and effort you have invested in this paper. Please allow us to summarize our agreements and disagreements regarding the DiT quantization. **Agreements**: - The proposed quantization methods in BitsFusion are very generic and can be applied to other architectures, like DiT. **Disagreements**: - The reviewer believes DiT is the SOTA diffusion model. - The reviewer mentioned that, since DiT is the SOTA diffusion model, lacking experiments of DiT is a limitation or concern for this work. Here, we would like to kindly present some **facts** that support us to humbly disagree with the reviewer. **First**, as we mentioned in the previous response, **we did not see any paper clearly showing that DiT is better than UNet**. On the contrary, the recent work [A] shows that under the same training dataset, schedule, hardware, and training time, the **UNet is better than DiT** (as seen in Fig. 6 in [A]). **Second**, we understand some recent DiT-based works like SD3 [B] show promising text-to-image generation. However, the architecture in SD3 is more complicated than the original DiT. Additionally, the training recipe and noise scheduling are different from those used to train the UNet-based models. Even if we take the training dataset, recipe, and noise scheduling aside and only focus on the comparison of the final generated images, the open-sourced Kolors (as mentioned in the previous response), which is built upon SDXL, achieves the SOTA results for text-to-image generation. The Kolors demonstrates that the **UNet is better than SD3 (DiT-based model)**. **Third**, taking a step back, we are still interested in applying our approach to DiT. However, it is non-trivial to achieve comparable results since DiT has a different architecture than the UNet-based model. Moreover, there might be some other new observations and problems in DiT-based models that we need to solve when doing quantization for them. Therefore, exploring the DiT-based model belongs to another research direction and we believe such experiments are beyond the scope of this paper. We humbly hope the above arguments can make sense to the reviewer. Best, Authors --- References: [A] Li, Hao, et al. “On the Scalability of Diffusion-based Text-to-Image Generation”. CVPR, 2024. [B] Esser, Patrick, et al. “Scaling Rectified Flow Transformers for High-Resolution Image Synthesis”. ICML, 2024.

Reviewer WzcG6/10 · confidence 4/52024-07-13

Summary

This paper proposes a novel weight quantization method called "BitsFusion" for compressing the Stable Diffusion v1.5 model. The primary goal is to address the issue of large model sizes, which hinder the deployment of diffusion models on resource-constrained devices. The BitsFusion framework quantizes the UNet component of Stable Diffusion v1.5 to 1.99 bits, achieving a 7.9× reduction in model size while improving image generation quality. The approach involves mixed-precision quantization, novel initialization techniques, and an improved two-stage training pipeline. Extensive experiments on various benchmark datasets demonstrate that the quantized model outperforms the original full-precision model in terms of generation quality and text-image alignment. My detailed comments are as follows.

Strengths

1. The BitsFusion framework is an innovative approach to compressing the UNet component of Stable Diffusion v1.5 to 1.99 bits, achieving a significant reduction in model size while enhancing image quality by using mixed-precision quantization, novel initialization techniques, and an improved two-stage training pipeline. 2. The paper provides a thorough analysis of quantization errors and develops a mixed-precision strategy based on this analysis, which contributes to the theoretical understanding of low-bit quantization for large-scale diffusion models. 3. The results demonstrate the effectiveness of the proposed framework. The quantized model consistently outperforms the original full-precision model across various metrics, including CLIP score, TIFA score, and GenEval score. The model's ability to achieve a 7.9× reduction in size while maintaining or improving performance highlights its practical potential for deployment on resource-constrained devices. 4. The manuscript is well-written and easy to understand, with clear explanations of the methodology and experimental procedures. Sufficient experimental details are provided, ensuring that the results can be reproduced by other researchers, which enhances the paper's credibility and utility.

Weaknesses

1. The two-stage training pipeline, while effective, may introduce additional computational complexity and training time, which could be a drawback for some applications. However, the paper does not explicitly discuss the additional computational complexity and training time it introduces. To provide a more comprehensive evaluation of this method, it is recommended that the authors discuss the potential additional computational overhead introduced by the two-stage training pipeline and its impact on training time. 2. The study demonstrates that there is a high correlation between certain metrics, such as MSE and PSNR, and uses these correlations to validate the effectiveness of their quantization methods. However, correlation does not imply causation. The study does not delve into why these metrics are correlated or explain the intrinsic mechanisms that cause certain layers to be more sensitive to quantization (e.g., why quantization affects some layers more than others, and what intrinsic properties of these layers make them more prone to quantization-induced errors). Understanding these mechanisms is crucial for improving the quantization process, as knowing why certain layers are sensitive can lead to more targeted and effective quantization strategies. 3. The claim that the 1.99-bit quantized model outperforms the full-precision model in all evaluated metrics is a significant overgeneralization. This assertion, based on specific experimental settings and datasets, may not fully represent the diversity encountered in real-world applications. Primarily, the evaluation on the MS-COCO 2014 validation set, though extensive, does not cover a wide variety of prompts, limiting the assessment of the model's ability to handle different types of inputs (e.g., complex scenes, abstract concepts, specific artistic styles). Additionally, the tests do not include various real-world conditions such as different lighting, backgrounds, or object complexities. Therefore, the claim that the 1.99-bit quantized model outperforms the full-precision model in all evaluated metrics is premature. A more robust evaluation including varied datasets, prompts, and real-world conditions, such as [A-E], is necessary to substantiate such a broad claim. 4. The discussion regarding model compression techniques is insufficient. It would be better for the authors to present more model quantization methods [F-J]. [A] Visual Genome: Connecting Language and Vision Using Crowdsourced Dense Image Annotations. International Journal of Computer Vision. IJCV. 2017. [B] Flickr30k Entities: Collecting Region-to-Phrase Correspondences for Richer Image-to-Sentence Models. ICCV. 2015. [C] The Open Images Dataset V4: Unified Image Classification, Object Detection, and Visual Relationship Detection at Scale. IJCV. 2020. [D] Conceptual 12M: Pushing Web-Scale Image-Text Pre-Training To Recognize Long-Tail Visual Concepts. CVPR. 2021. [E] Scene Parsing through ADE20K Dataset. CVPR. 2017. [F] Binary quantized network training with sharpness-aware minimization. Scientific Computing 2023. [G] Network Quantization with Element-Wise Gradient Scaling. CVPR 2021. [H] Single-path bit sharing for automatic loss-aware model compression. TPAMI 2023. [I] Generative Data Free Model Quantization with Knowledge Matching for Classification. TCSVT 2023.

Questions

Please check the weakness section.

Rating

6

Confidence

4

Soundness

3

Presentation

4

Contribution

3

Limitations

N/A

Reviewer W2xs2024-08-08

Thank you for addressing my concerns regarding the training computation. I will keep my scores as wa.

Authorsrebuttal2024-08-08

Thank you for the response

Thank you for your quick response and positive rating! We're pleased to hear that your concerns have been addressed. We will incorporate the relevant discussion in the paper.

Authorsrebuttal2024-08-10

Dear Reviewer WzcG, Thank you very much for your insightful feedback and the positive rating. We have included explanations to further clarify the questions. As the deadline for the discussion period is fast approaching, we are eager to see if our explanations meet your expectations and address all your concerns thoroughly. Thank you again for your time and insight. Best regards, The Authors

Reviewer WzcG2024-08-13

Thank you for your detailed response and additional experiments. Your clarifications on training complexity, metric correlation, and dataset evaluation are appreciated. I recommend emphasizing the practical implications for resource-constrained scenarios and exploring why certain layers are more sensitive to quantization. Including the suggested related works will further enhance the paper. I will maintain my current score.

Authorsrebuttal2024-08-14

Thank you for your response and positive rating! We're pleased to hear that your concerns have been addressed. We will incorporate the discussions and related works in the paper.

Authorsrebuttal2024-08-10

Dear Reviewer tjXw, Thank you very much for your insightful comments. In response to your comments, we have provided detailed explanations to clarify the points discussed and address the concerns you highlighted. As the deadline for the discussion period is quickly approaching, we are keen to know if our responses meet your expectations and have addressed all your concerns effectively. Thank you again for your valuable time and expertise. Best regards, The Authors

Authorsrebuttal2024-08-10

Dear Reviewer Fq1C, Thank you very much for your valuable feedback and the positive evaluation of our work. We have included detailed explanations in response to your questions. As the deadline for the discussion period approaches, we would appreciate your review of these explanations to confirm that they fully meet your expectations and resolve any remaining concerns. Thank you once again for your insightful contributions. Best regards, The Authors

Reviewer Fq1C2024-08-11

I thank the authors for their response, which addresses most of my concerns, and I would like to maintain my positive rating. However, I still have one question regarding the calculation of average bits. The balanced integer should require an additional bit to avoid overflow, which would mean the average bit calculation should be $log(2^n)+1$ instead of $log(2^n+1)$. The term $log(2^n+1)$ implicitly suggests the minimum bit required for representing the amount of information, which would typically require an optimal encoding approach to achieve this average bit. I am still unclear about how this can be achieved without additional encoding.

Authorsrebuttal2024-08-12

Dear Reviewer Fq1C, Thank you for your comments. The “averaged 1.99 bits” refers to the theoretical average for linear and convolutional layers according to previous quantization works [A, B]. In practical deployment, we use group encoding to encode multiple values simultaneously, closely achieving the theoretical bits. Here we provide more details with a simple example of three symbols {-1, 0, 1}, where the theoretical bit-width is log(3) = 1.58 bits. To approach this in practice, we encode blocks of 8 values—each set of three ternary values representing $3^8 = 6561$ unique combinations. We encode these 6561 combinations using $\lceil log_2(6561) \rceil = 13$ bits, resulting in an average of 13/8 = 1.625 bits per value, closely aligning with the theoretical 1.58 bits. This group encoding technique is used throughout our quantized text-to-image diffusion model, leading to a total model size of 219 MB as indicated in line 39 of our main paper, which is 7.9$\times$ reduction compared with the fp16 model, aligning with the theoretical size saving. We believe Huffman encoding is another valuable tool, which is orthogonal to our approach, for closely achieving the theoretical bits and reducing storage size. Thank you for suggesting this useful approach and for your positive response! Best, Authors --- References: [A] Ma, Shuming, et al. “The era of 1-bit llms: All large language models are in 1.58 bits.” arXiv preprint arXiv:2402.17764 (2024). [B] Li, Xiuyu, et al. “Q-diffusion: Quantizing diffusion models.” CVPR, 2023.

Reviewer Fq1C2024-08-13

Thank you for providing more details regarding the calculation of average bits, which addresses my question well. I suggest that the authors incorporate this discussion into the paper.

Authorsrebuttal2024-08-14

Thank you for your response and positive rating! We're glad to hear that your concerns have been addressed. We will incorporate the related discussion into the paper.

Authorsrebuttal2024-08-12

Dear Reviewer tjXw, Thank you for raising your score. We are glad to know that our response addresses most of your concerns. We would like to use this opportunity to kindly clarify that the further exploration of DiT quantization using our approach is not a limitation or weakness of this paper. Exploring the DiT quantization is beyond the scope of this work. As we mentioned in the answer of Q2, UNet is more suitable for the resource-constrained hardware, which is the hardware that quantization is deployed the most. Additionally, with all due respect, we would like to kindly argue that, DiT is not necessarily better than UNet. For example, in the recent work [A], people show that under the same training dataset, schedule, hardware, and training time, the UNet still achieves better performance than DiT (as can be seen in Fig. 6). Therefore, we would like to kindly mention that the value of this work should not be underplayed due to the reason of missing DiT quantization. Best, Authors --- References: [A] Li, Hao, et al. “On the Scalability of Diffusion-based Text-to-Image Generation”. CVPR, 2024.

Program Chairsdecision2024-09-25

Decision

Accept (poster)

© 2026 NYSGPT2525 LLC