arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2412.05926cs.CV
收藏

BiDM:推动扩散模型量化的极限

BiDM: Pushing the Limit of Quantization for Diffusion Models

Beihang University(北京航空航天大学);Shanghai Jiao Tong University(上海交通大学);Zhongguancun Laboratory(中关村实验室);ETH Zürich(苏黎世联邦理工学院)

Xingyu Zheng, Xianglong Liu, Yichen Bian, Xudong Ma, Yulun Zhang, Jiakai Wang, Jinyang Guo, Haotong Qin

AI总结:

针对扩散模型1位全二值化后生成性能严重下降的问题,本文提出BiDM方法,通过时间步友好二值结构与空间补丁蒸馏分别解决时间相关激活与空间特征匹配难题,首次实现扩散模型全二值化,大幅提升生成质量与压缩效率。

摘要:

扩散模型(DMs)凭借出色的生成质量已取得显著发展,并广泛应用于各类场景。然而,扩散模型高昂的计算成本与海量参数阻碍了其在资源受限场景下的实际应用。作为有效的压缩方法之一,量化可通过降低位宽实现存储节省与推理加速,同时维持生成性能。但作为最极端的量化形式,1位二值化会导致扩散模型的生成性能严重下降甚至崩溃。本文提出一种名为BiDM的新方法,可对扩散模型的权重与激活进行全二值化,将量化推向1位极限。从时间维度,我们引入了时间步友好二值结构(TBS),采用可学习激活二值化器与跨时间步特征连接,以解决扩散模型激活特征与时间步高度相关的问题。从空间维度,我们提出空间补丁蒸馏(SPD),聚焦图像生成任务与噪声估计网络的空间局部性,以解决蒸馏过程中二值特征匹配困难的问题。作为首个实现扩散模型全二值化的工作,在LDM-4模型上针对LSUN-Bedrooms 256×256数据集的W1A1 BiDM取得了22.74的优异FID值,显著优于当前最优通用二值化方法(其FID为59.44且生成样本无效),同时实现了高达28.0倍的存储节省与52.7倍的运算量节省。代码可在https://github.com/Xingyu-Zheng/BiDM获取。

英文摘要:

Diffusion models (DMs) have been significantly developed and widely used in various applications due to their excellent generative qualities. However, the expensive computation and massive parameters of DMs hinder their practical use in resource-constrained scenarios. As one of the effective compression approaches, quantization allows DMs to achieve storage saving and inference acceleration by reducing bit-width while maintaining generation performance. However, as the most extreme quantization form, 1-bit binarization causes the generation performance of DMs to face severe degradation or even collapse. This paper proposes a novel method, namely BiDM, for fully binarizing weights and activations of DMs, pushing quantization to the 1-bit limit. From a temporal perspective, we introduce the Timestep-friendly Binary Structure (TBS), which uses learnable activation binarizers and cross-timestep feature connections to address the highly timestep-correlated activation features of DMs. From a spatial perspective, we propose Space Patched Distillation (SPD) to address the difficulty of matching binary features during distillation, focusing on the spatial locality of image generation tasks and noise estimation networks. As the first work to fully binarize DMs, the W1A1 BiDM on the LDM-4 model for LSUN-Bedrooms 256$\times$256 achieves a remarkable FID of 22.74, significantly outperforming the current state-of-the-art general binarization methods with an FID of 59.44 and invalid generative samples, and achieves up to excellent 28.0 times storage and 52.7 times OPs savings. The code is available at https://github.com/Xingyu-Zheng/BiDM .

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑