BitNet: Scaling 1-bit Transformers for Large Language Models

Hongyu Wang, Shuming Ma, Li Dong, Shaohan Huang, Huaijie Wang, Lingxiao Ma, Fan Yang, Ruiping Wang, Yi Wu, Furu WeiarXiv 2023

Abstract

The increasing size of large language models has posed challenges for deployment and raised concerns about environmental impact due to high energy consumption. In this work, we introduce BitNet, a scalable and stable 1-bit Transformer architecture designed for large language models. Specifically, we introduce BitLinear as a drop-in replacement of the nn.Linear layer in order to train 1-bit weights from scratch. Experimental results on language modeling show that BitNet achieves competitive performance while substantially reducing memory footprint and energy consumption, compared to state-of-the-art 8-bit quantization methods and FP16 Transformer baselines. Furthermore, BitNet exhibits a scaling law akin to full-precision Transformers, suggesting its potential for effective scaling to even larger language models while maintaining efficiency and performance benefits.

Introduction

As Large Language Models (LLMs) scale to hundreds of billions of parameters, they encounter two primary bottlenecks: memory bandwidth and energy consumption. Standard Transformers rely on high-precision formats like FP16 or BF16, which create data transfer bottlenecks and require energy-intensive floating-point multiplications. While Post-Training Quantization (PTQ) can reduce model size after training, it often results in a significant accuracy loss, or "quantization tax," particularly at extreme low-bit widths. BitNet addresses these issues by introducing a 1-bit architecture designed for efficiency from the ground up, trained from scratch using quantization-aware techniques.

The BitLinear Architecture

The core innovation of BitNet is BitLinear, a drop-in replacement for the standard nn.Linear layer. BitLinear enables the training of 1-bit weights ({-1, 1}) while maintaining model expressivity through several key mechanisms:

  • Binarized Weights: Weights are centralized to a zero mean and converted to binary values using a signum function. A scaling factor ($\beta$) is applied to minimize the approximation error.
  • 8-bit Activations: To preserve performance, activations are quantized to 8-bit precision using absmax quantization.
  • Quantization-Aware Training (QAT): Since the signum function is non-differentiable, BitNet employs a Straight-Through Estimator (STE) during the backward pass to allow gradient flow.
  • Mixed-Precision Strategy: High-precision "latent" weights are maintained to accumulate small gradient updates, which are then binarized on-the-fly during the forward pass.
The BitLinear architecture diagram showing the flow from input through LayerNorm, Absmax Quantization, 1-bit weight multiplication, and Dequantization.

To facilitate model parallelism, BitNet utilizes group quantization and normalization. By dividing tensors into independent groups, the model avoids the need for expensive cross-device synchronization during quantization steps.

Scaling Laws and Efficiency

A pivotal finding of this work is that 1-bit Transformers exhibit a scaling law similar to full-precision models. As model size increases, the performance gap between BitNet and FP16 Transformers narrows significantly, suggesting that weight precision becomes less critical as the total number of parameters grows.

Scaling law comparison between BitNet and FP16 Transformer, showing Loss vs. Model Size. The gap narrows as the model scales.

Beyond scaling, BitNet offers structural energy savings. In a 1-bit system, matrix multiplications are essentially replaced by additions, which are orders of magnitude cheaper in hardware. BitNet achieves a 70x to 100x reduction in energy consumption for matrix multiplications compared to FP16 baselines at 7nm and 45nm process nodes.

Experimental Results

BitNet was trained on a massive English-language corpus, including The Pile and Common Crawl, and evaluated on standard benchmarks like Hellaswag and Winogrande.

  • Competitive Accuracy: At a 6.7B parameter scale, BitNet (W1A8) achieves an average zero-shot accuracy of 55.9%, closely approaching the 57.8% of a full FP16 Transformer.
  • Superiority over PTQ: BitNet outperforms state-of-the-art 1-bit and 2-bit post-training quantization methods such as GPTQ and QuIP, matching the performance of 8-bit quantized models at a fraction of the computational cost.
  • Training Stability: BitNet demonstrates remarkable stability at scale, allowing for higher learning rates than traditional FP16 models without diverging.

Conclusion and Future Work

BitNet provides a scalable, energy-efficient alternative to high-precision Transformers for LLMs. By training 1-bit weights from scratch, it bypasses the performance degradation typical of post-training methods while following predictable scaling laws. Future research will explore reducing activation precision further (e.g., to 4-bit or 1-bit) and applying BitNet principles to other emerging architectures like RetNet.

Summary updated

BibTeX
@misc{wang2023bitnet,
  author = {Hongyu Wang and Shuming Ma and Li Dong and Shaohan Huang and Huaijie Wang and Lingxiao Ma and Fan Yang and Ruiping Wang and Yi Wu and Furu Wei},
  title = {{BitNet: Scaling 1-bit Transformers for Large Language Models}},
  year = {2023},
  eprint = {2310.11453},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2310.11453},
}
Figure