Quantizing the weights of large language models (LLMs) from 16-bit to lower bitwidth is the de facto approach to deploy massive transformers onto more affordable accelerators. While GPTQ emerged as one of the standard methods for one-shot post-training quantization at LLM scale, its inner workings are described as a sequence of algebraic updates that obscure geometric meaning or worst-case guarantees. In this work, we show that, when executed back-to-front (from the last to first dimension) for a linear layer, GPTQ is mathematically identical to Babai's nearest plane algorithm for the classical closest vector problem (CVP) on a lattice defined by the Hessian matrix of the layer's inputs. This equivalence is based on a sophisticated mathematical argument, and has two analytical consequences: first, the GPTQ error propagation step gains an intuitive geometric interpretation; second, GPTQ inherits the error upper bound of Babai's algorithm under the assumption that no weights are clipped. Leveraging this bound, we design post-training quantization methods that avoid clipping, and outperform the original GPTQ. In addition, we provide efficient GPU inference kernels for the resulting representation. Taken together, these results place GPTQ on a firm theoretical footing and open the door to importing decades of progress in lattice algorithms towards the design of future quantization algorithms for billion-parameter models. Source code is available at https://github.com/IST-DASLab/GPTQ-Babai.


翻译:将大语言模型的权重从16比特量化至更低比特宽度,是在更经济的加速器上部署大规模Transformer的事实标准方法。尽管GPTQ已成为大语言模型规模下一次性训练后量化的主流方法之一,但其内部机制被描述为一系列代数更新过程,掩盖了几何意义或最差情况保证。在本工作中,我们证明:当对线性层从后向前(即从最后一个维度到第一个维度)执行时,GPTQ在数学上与Babai最近平面算法完全等价,该算法用于解决由该层输入的海森矩阵所定义格上的经典最短向量问题。这一等价性基于严格的数学论证,并推导出两项分析结论:首先,GPTQ的误差传播步骤获得了直观的几何解释;其次,在假设无权重被截断的条件下,GPTQ继承了Babai算法的误差上界。利用这一上界,我们设计了避免截断的训练后量化方法,其性能超越原始GPTQ。此外,我们为所得表示提供了高效的GPU推理内核。综合这些结果,本研究将GPTQ置于坚实的理论基础上,并开辟了将格算法领域数十年的进展引入十亿参数模型未来量化算法设计的道路。源代码见https://github.com/IST-DASLab/GPTQ-Babai。

0
下载
关闭预览

相关内容

在数学和计算机科学之中,算法(Algorithm)为一个计算的具体步骤,常用于计算、数据处理和自动推理。精确而言,算法是一个表示为有限长列表的有效方法。算法应包含清晰定义的指令用于计算函数。 来自维基百科: 算法
大语言模型算法演进综述
专知会员服务
81+阅读 · 2024年5月30日
大语言模型的前世、今生与未来
专知会员服务
111+阅读 · 2023年9月8日
绝对干货!NLP预训练模型:从transformer到albert
新智元
13+阅读 · 2019年11月10日
超全总结:神经网络加速之量化模型 | 附带代码
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
8+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
3+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
4+阅读 · 2014年12月31日
VIP会员
最新内容
学习数据的几何:形状空间分析数学综述
专知会员服务
7+阅读 · 6月17日
定向能反无人机系统最新发展动态
专知会员服务
7+阅读 · 6月17日
从燃煤战舰到算法战争:水面指挥的永恒要求
专知会员服务
5+阅读 · 6月17日
相关VIP内容
大语言模型算法演进综述
专知会员服务
81+阅读 · 2024年5月30日
大语言模型的前世、今生与未来
专知会员服务
111+阅读 · 2023年9月8日
相关基金
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
8+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
3+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
4+阅读 · 2014年12月31日
Top
微信扫码咨询专知VIP会员