Skip to main content
QUICK REVIEW

[论文解读] The Era of 1-bit LLMs: All Large Language Models are in 1.58 Bits

Shuming Ma, Hongyu Wang|arXiv (Cornell University)|Feb 27, 2024
Natural Language Processing Techniques被引用 37
一句话总结

本论文介绍 BitNet b1.58,一种 1.58 位 LLM,其每个参数均为三值 {-1, 0, 1}。在相近的尺寸下,它的性能与 FP16/LLaMA 相当,同时在速度、内存和能耗方面实现显著提升,推动新的放缩规律以及对 1 位 LLM 的潜在硬件优化。

ABSTRACT

Recent research, such as BitNet, is paving the way for a new era of 1-bit Large Language Models (LLMs). In this work, we introduce a 1-bit LLM variant, namely BitNet b1.58, in which every single parameter (or weight) of the LLM is ternary {-1, 0, 1}. It matches the full-precision (i.e., FP16 or BF16) Transformer LLM with the same model size and training tokens in terms of both perplexity and end-task performance, while being significantly more cost-effective in terms of latency, memory, throughput, and energy consumption. More profoundly, the 1.58-bit LLM defines a new scaling law and recipe for training new generations of LLMs that are both high-performance and cost-effective. Furthermore, it enables a new computation paradigm and opens the door for designing specific hardware optimized for 1-bit LLMs.

研究动机与目标

  • 在不牺牲性能的前提下,推动降低 LLM 的推理成本和能耗。
  • 提出一种包含零态的 1.58 位权重量化方案,以提升建模能力。
  • 证明 BitNet b1.58 从 3B 尺度开始在困惑度和端任务指标上可达到全精度基线的水平。
  • 展示硬件与能耗影响,并讨论对更大模型及边缘设备的可扩展性。

提出的方法

  • 引入 BitNet b1.58,一种 Transformer,其中线性层被 BitLinear 替换,权重量化为 {-1, 0, 1}。
  • 采用 absmean 量化来约束权重,gamma 定义为权重绝对值的平均值。
  • 采用类似 LLaMA 的架构组件(RMSNorm、SwiGLU、旋转嵌入),不使用偏置。
  • 在 RedPajama 数据上,使用 1.58 位权重和 8 位激活从头开始训练。
  • 在模型规模 (700M–3.9B) 范围内,对比 FP16 LLaMA 基线,评估困惑度和零-shot 端任务性能。
  • 使用 FasterTransformer 及 2 位/ Ladder 内核测量内存、延迟、吞吐量和估计能耗;分析可扩展性与能耗节省。

实验结果

研究问题

  • RQ1在相同模型尺寸与训练设置下,1.58 位 LLM 是否能在困惑度和端任务上达到全精度 LLM 的性能?
  • RQ2随着模型规模增加,1.58 位 LLM 在内存、延迟和能耗方面的影响是什么?
  • RQ3在不同尺寸上,1.58 位 LLM 是否在成本和精度上相对于 FP16 基线呈现帕累托改进?
  • RQ4用 2T tokens 训练能否使 BitNet b1.58 实现或改进在标准基准上的泛化能力?

主要发现

模型大小内存 (GB)延迟 (ms)PPL模型(端任务)均值ARC-EARC-CHSBQOQPQWGe均值
LLaMA LLM700M2.081.1812.3345.554.723.037.060.020.268.954.845.5
BitNet b1.58700M0.800.9612.8744.351.821.435.158.220.068.155.244.3
LLaMA LLM1.3B3.341.6211.2546.256.923.538.559.121.670.053.946.2
BitNet b1.581.3B1.140.9711.2945.454.924.237.756.719.668.855.845.4
LLaMA LLM3B7.895.0710.0449.762.125.643.361.824.672.158.249.7
BitNet b1.583B2.221.879.9150.261.428.342.961.526.671.559.350.2
BitNet b1.583.9B2.382.119.6251.264.228.744.263.524.273.260.551.2
  • BitNet b1.58 在相同配置下,从 3B 尺度开始在困惑度上达到 FP16 LLaMA 基线。
  • BitNet b1.58 在 3B 时相比 FP16 LLaMA 提升 2.71x 速度,GPU 内存减少 3.55x。
  • 在 3.9B 时,BitNet b1.58 提升 2.4x 速度、内存效率高 3.32x,同时在端任务上优于 LLaMA 3B。
  • 在不同尺寸上,BitNet b1.58 缩小了与 FP16 基线的性能差距,从 3B 起达到可比的端任务结果。
  • BitNet b1.58 70B 相对于 LLaMA 70B 最多实现 4.1x 的加速,在两块 A100 GPU 上吞吐量最高提升 11x,且内存降低。
  • 能耗分析表明,与 FP16 基线相比,在 7nm 芯片上矩阵乘法的算术能量节省约 71.4 倍,且对更大模型优势日益明显。

更好的研究,从现在开始

从论文设计到论文写作,大幅缩短您的研究时间。

无需绑定信用卡

本解读由 AI 生成,并经人工编辑审核。