Post-training quantization (PTQ) is the go-to compression technique for large generative models, such as stable diffusion or large language models. PTQ methods commonly keep the softmax activation in higher precision as it has been shown to be very sensitive to quantization noise. However, this can lead to a significant runtime and power overhead during inference on resource-constraint edge devices. In this work, we investigate the source of the softmax sensitivity to quantization and show that the quantization operation leads to a large bias in the softmax output, causing accuracy degradation. To overcome this issue, we propose an offline bias correction technique that improves the quantizability of softmax without additional compute during deployment, as it can be readily absorbed into the quantization parameters. We demonstrate the effectiveness of our method on stable diffusion v1.5 and 125M-size OPT language model, achieving significant accuracy improvement for 8-bit quantized softmax.
Full-Stack FP4: Stable LLM Pretraining with Quantized Projections, Optimizers, and Attention
Institute of Automation, Chinese Academy of Sciences(中国科学院自动化研究所);Sichuan University(四川大学);Beijing Zhongguancun Academy(北京中关村科学院);Zhejiang University(浙江大学);Beijing Key Laboratory of Brain-Inspired General Intelligence Large Model(北京脑科学与类脑研究中心通用人工智能大模型北京市重点实验室);Key Laboratory of Brain Cognition and Brain-inspired Intelligence Technology(脑认知与脑机智能技术重点实验室)
The Curse and Blessing of Mean Bias in FP4-Quantized LLM Training
Fudan University(复旦大学);University of Bath(巴斯大学);Shanghai Innovation Institute(上海创新研究院);University of Oxford(牛津大学);Oxford Suzhou Centre for Advanced Research(牛津苏浙研究中心);University of Colorado Boulder(科罗拉多大学波德格分校);University of Michigan(密歇根大学);Shenzhen Loop Area Institute(深圳河套学院)
The Implicit Bias of Depth: From Neural Collapse to Softmax Codes
Mathematical Institute, University of Oxford(牛津大学数学研究所);Department of Electrical and Computer Engineering, University of British Columbia(不列颠哥伦比亚大学电气与计算机工程系)
Semi-Relaxed Quantization with DropBits: Training Low-Bit Neural Networks via Bit-wise Regularization
网络量化旨在减少网络权重和激活的位长度,已经成为减少神经网络的大小以将其部署到资源有限的设备的关键成分之一。为了克服将连续激活和权重转换为离散激活和权重的性质,最近一项名为松弛量化(RQ)的研究[Louizos et al. 2019]成功地采用了流行的Gumbel-Softmax,该算法允许通过基于梯度的有效优化进行这种转换。然而,RQ与此Gumbel-Softmax松弛仍然遭受偏差方差权衡取决于Gumbel-Softmax的温度参数。为了解决这个问题,我们提出了一种新的方法,半松弛量化(SRQ),它使用多类直通估计器来有效地减少偏差和方差,以及一种新的正则化技术,DropBits,它取代了dropout正则化来随机丢弃比特而不是神经元,以进一步减少SRQ中多类直通估计器的偏差。作为DropBits的自然扩展,我们进一步介绍了学习异构量化级别的方法,以使用DropBits为每一层找到合适的比特长度。我们在各种基准数据集和网络架构上通过实验验证了我们的方法,并且还支持量化彩票假设:从头开始学习异构量化级别优于使用相同但固定的量化级别的情况。
Disentanglement with Factor Quantized Variational Autoencoders
Department of Mathematics and Computer Science, University of Southern Denmark(数学与计算机科学系,丹麦南部大学);Department of Computer Engineering, Istanbul Technical University(计算机工程系,伊斯坦布尔技术大学);Department of AI and Data Engineering, Istanbul Technical University(人工智能与数据工程系,伊斯坦布尔技术大学)