Spectra: Surprising Effectiveness of Pretraining Ternary Language Models at Scale
作者: Ayush Kaushal, Tejas Vaidhya, Arnab Kumar Mondal, Tejas Pandey, Aaryan Bhagat, Irina Rish
分类: cs.LG, cs.AI, cs.CL
发布日期: 2024-07-17 (更新: 2024-10-11)
备注: 42 pages, 21 figures, and 13 tables
🔗 代码/项目: GITHUB
💡 一句话要点
Spectra:大规模三元语言模型预训练效果显著,性能超越同等规模浮点模型。
🎯 匹配领域: 支柱九:具身大模型 (Embodied Foundation Models)
关键词: 三元语言模型 低比特量化 预训练 大型语言模型 模型压缩
📋 核心要点
- 现有LLM推理受限于内存容量和带宽,后训练量化在低比特精度下性能显著下降。
- 论文提出预训练三元语言模型(TriLM)作为替代方案,旨在提升低比特宽度模型的性能。
- 实验结果表明,大规模TriLM在性能上超越了同等规模的量化和浮点模型,展现出优越的扩展性。
📝 摘要(中文)
GPU算力的快速发展超过了内存容量和带宽的增长,导致大型语言模型(LLM)推理出现瓶颈。后训练量化是解决LLM推理中内存相关瓶颈的主要方法,但低于4比特精度时性能会显著下降。本文通过研究低比特宽度模型(特别是三元语言模型(TriLM))的预训练,作为传统浮点模型(FloatLM)及其后训练量化版本(QuantLM)的替代方案,从而应对这些挑战。我们提出了Spectra LLM套件,这是第一个开放的LLM套件,涵盖多种比特宽度,包括FloatLM、QuantLM和TriLM,范围从99M到3.9B参数,并在300B tokens上进行训练。全面的评估表明,TriLM在模型大小(以比特为单位)方面具有卓越的扩展行为。令人惊讶的是,在超过10亿参数的规模下,对于给定的比特大小,TriLM在各种基准测试中始终优于其QuantLM和FloatLM对应模型。值得注意的是,3.9B参数的TriLM在所有基准测试中都与FloatLM 3.9B的性能相匹配,尽管其比特数少于FloatLM 830M。总的来说,这项研究为低比特宽度语言模型的可行性和可扩展性提供了宝贵的见解,为开发更高效的LLM铺平了道路。
🔬 方法详解
问题定义:论文旨在解决大型语言模型(LLM)推理过程中由于内存容量和带宽限制而导致的性能瓶颈问题。现有的后训练量化方法在低于4比特精度时会遭受显著的性能下降,限制了模型压缩和加速的潜力。
核心思路:论文的核心思路是直接预训练低比特宽度的三元语言模型(TriLM),而不是先训练浮点模型再进行量化。这种方法旨在从一开始就优化模型的参数表示,从而避免后训练量化带来的信息损失和性能下降。
技术框架:Spectra LLM套件包含多种比特宽度的语言模型,包括浮点模型(FloatLM)、量化模型(QuantLM)和三元模型(TriLM),参数规模从99M到3.9B不等。所有模型都在300B tokens的数据集上进行训练。研究团队发布了500多个中间检查点,以促进低比特宽度模型的研究。
关键创新:最重要的技术创新点在于证明了大规模预训练三元语言模型的可行性和有效性。与传统的后训练量化方法相比,直接预训练TriLM能够更好地利用低比特宽度的优势,实现更高的性能。
关键设计:论文中没有详细描述具体的网络结构或损失函数等技术细节,但强调了模型规模和训练数据的重要性。关键在于使用三元权重(-1, 0, 1)进行预训练,并探索不同规模TriLM的性能表现。
🖼️ 关键图片
📊 实验亮点
实验结果表明,在超过10亿参数的规模下,TriLM在各种基准测试中始终优于其QuantLM和FloatLM对应模型。3.9B参数的TriLM在所有基准测试中都与FloatLM 3.9B的性能相匹配,尽管其比特数少于FloatLM 830M。这表明TriLM在模型大小和性能之间取得了更好的平衡。
🎯 应用场景
该研究成果可应用于资源受限的设备上部署大型语言模型,例如移动设备、嵌入式系统等。通过使用三元语言模型,可以在保证性能的同时显著降低模型大小和计算复杂度,从而实现更高效的LLM推理。此外,该研究也为未来低比特宽度模型的研究和开发提供了新的方向。
📄 摘要(原文)
Rapid advancements in GPU computational power has outpaced memory capacity and bandwidth growth, creating bottlenecks in Large Language Model (LLM) inference. Post-training quantization is the leading method for addressing memory-related bottlenecks in LLM inference, but it suffers from significant performance degradation below 4-bit precision. This paper addresses these challenges by investigating the pretraining of low-bitwidth models specifically Ternary Language Models (TriLMs) as an alternative to traditional floating-point models (FloatLMs) and their post-training quantized versions (QuantLMs). We present Spectra LLM suite, the first open suite of LLMs spanning multiple bit-widths, including FloatLMs, QuantLMs, and TriLMs, ranging from 99M to 3.9B parameters trained on 300B tokens. Our comprehensive evaluation demonstrates that TriLMs offer superior scaling behavior in terms of model size (in bits). Surprisingly, at scales exceeding one billion parameters, TriLMs consistently outperform their QuantLM and FloatLM counterparts for a given bit size across various benchmarks. Notably, the 3.9B parameter TriLM matches the performance of the FloatLM 3.9B across all benchmarks, despite having fewer bits than FloatLM 830M. Overall, this research provides valuable insights into the feasibility and scalability of low-bitwidth language models, paving the way for the development of more efficient LLMs. To enhance understanding of low-bitwidth models, we are releasing 500+ intermediate checkpoints of the Spectra suite at https://github.com/NolanoOrg/SpectraSuite.