BitNet a4.8: 4-bit Activations for 1-bit LLMs
BitNet a4.8通过混合量化和稀疏化策略,实现了1位LLMs的4位激活,在保持性能的同时显著提高了推理效率。
更新于 2024-11-09。作者:Hongyu Wang、Shuming Ma、Furu Wei。
中文摘要
最近对1位大型语言模型(LLMs)的研究,如BitNet b1.58,为降低LLMs推理成本的同时保持其性能提供了一个有前景的方向。在本工作中,我们引入了BitNet a4.8,它使1位LLMs能够使用4位激活。BitNet a4.8采用混合量化和稀疏化策略来减轻由异常通道引入的量化误差。具体来说,我们对注意力和前馈网络层的输入使用4位激活,而对中间状态进行稀疏化处理,随后采用8位量化。大量实验表明,BitNet a4.8在训练成本相当的情况下,其性能与BitNet b1.58相当,同时在推理速度上更快,因为它启用了4位(INT4/FP4)内核。此外,BitNet a4.8仅激活了55%的参数,并支持3位KV缓存,进一步提高了大规模LLMs部署和推理的效率。
英文摘要
Recent research on the 1-bit Large Language Models (LLMs), such as BitNet b1.58, presents a promising direction for reducing the inference cost of LLMs while maintaining their performance. In this work, we introduce BitNet a4.8, enabling 4-bit activations for 1-bit LLMs. BitNet a4.8 employs a hybrid quantization and sparsification strategy to mitigate the quantization errors introduced by the outlier channels. Specifically, we utilize 4-bit activations for inputs to the attention and feed-forward network layers, while sparsifying intermediate states followed with 8-bit quantization. Extensive experiments demonstrate that BitNet a4.8 achieves performance comparable to BitNet b1.58 with equivalent training costs, while being faster in inference with enabling 4-bit (INT4/FP4) kernels. Additionally, BitNet a4.8 activates only 55% of parameters and supports 3-bit KV cache, further enhancing the efficiency of large-scale LLM deployment and inference.
解读
一句话总结
BitNet a4.8通过混合量化和稀疏化策略,实现了1位LLMs的4位激活,在保持性能的同时显著提高了推理效率。
问题1:这篇论文想要解决什么具体问题?
• 问题背景:1位LLMs在推理时虽然成本低,但计算成本高,且激活量化和稀疏化方法难以处理激活中的异常维度。 • 现有方案不足:现有的1位LLMs激活量化方法在处理异常维度时,存在显著的量化误差和性能下降。 • 研究目标:设计一种混合量化和稀疏化策略,使1位LLMs能够使用4位激活,同时保持性能并提高推理效率。
问题2:论文的核心创新点是什么?
• 技术创新:提出了一种混合量化和稀疏化策略,针对不同层级的激活分布特点进行选择性应用。 • 方法改进:利用4位激活对注意力网络和前馈网络层的输入进行量化,同时对中间状态进行稀疏化和8位量化。 • 优势:与现有方法相比,BitNet a4.8在保持性能的同时,推理速度更快,参数激活率更低,且支持3位KV缓存。
问题3:实验结果如何验证了方法的有效性?
• 关键实验:BitNet a4.8与BitNet b1.58在相同训练成本下进行了比较。 • 性能提升:BitNet a4.8在保持与BitNet b1.58相当性能的同时,推理速度更快。 • 对比结果:BitNet a4.8的平均准确率几乎没有损失。
问题4:这个研究的实际应用价值是什么?
• 应用场景:适用于大规模LLMs的部署和推理。 • 实施建议:采用BitNet a4.8可以显著提高LLMs的推理效率,降低成本。 • 局限与展望:目前BitNet a4.8主要针对1位LLMs,未来可以探索其在其他低精度LLMs中的应用。