前缀化注意力汇点可缓解大语言模型量化中的激活离群值
Prefixing Attention Sinks can Mitigate Activation Outliers for Large Language Model Quantization
AI总结:
针对大语言模型激活量化中的离群值问题,提出名为 CushionCache 的前缀键值缓存方法,通过贪心搜索与微调抑制后续词元激活离群值,显著提升逐张量 W8A8 量化性能并可与现有方法无缝集成。
摘要:
尽管大语言模型(LLM)量化近期取得了进展,但由于激活离群值的存在,激活量化仍然具有挑战性。传统的补救措施(例如对不同通道混合精度)会引入额外开销并降低加速效果。在本工作中,我们提出了一种简单而有效的策略,通过阻止问题性词元的生成来促进逐张量激活量化。具体而言,我们提出了一种寻找一组键值缓存的方法,命名为 CushionCache,当将其作为前缀插入时,可以缓解后续词元中的离群值。CushionCache 分两步工作:首先,我们贪心地搜索一个提示词元序列,以最小化后续词元中的最大激活值。然后,我们进一步微调该词元缓存,使后续词元的激活更加规整、更利于量化。所提出的方法成功解决了大语言模型的激活离群值问题,为逐张量激活量化方法带来了显著的性能提升。我们在广泛的模型和基准上对该方法进行了全面评估,发现它显著超越了逐张量 W8A8 量化的既有基线,并且可以与最近的激活量化方法无缝集成。
英文摘要:
Despite recent advances in LLM quantization, activation quantization remains to be challenging due to the activation outliers. Conventional remedies, e.g., mixing precisions for different channels, introduce extra overhead and reduce the speedup. In this work, we develop a simple yet effective strategy to facilitate per-tensor activation quantization by preventing the generation of problematic tokens. Precisely, we propose a method to find a set of key-value cache, coined CushionCache, which mitigates outliers in subsequent tokens when inserted as a prefix. CushionCache works in two steps: First, we greedily search for a prompt token sequence that minimizes the maximum activation values in subsequent tokens. Then, we further tune the token cache to regularize the activations of subsequent tokens to be more quantization-friendly. The proposed method successfully addresses activation outliers of LLMs, providing a substantial performance boost for per-tensor activation quantization methods. We thoroughly evaluate our method over a wide range of models and benchmarks and find that it significantly surpasses the established baseline of per-tensor W8A8 quantization and can be seamlessly integrated with the recent activation quantization method.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。