BitNet is a scalable 1-bit Transformer architecture for reducing language-model memory, computation, and energy costs. It replaces traditional linear layers with BitLinear components that train 1-bit weights from scratch, while retaining higher precision for optimizer states, gradients, embeddings, and probabilities. Its layout remains Transformer-like, but attention uses binarized weights. section 9.3 section 9.5
BitNet’s main operational tradeoffs are:
- Reduces memory and energy use compared with 8-bit quantization and FP16 benchmarks while maintaining competitive language-modeling performance. section 9.3
- Narrows the quality gap as model size increases; smaller models favor FP16 more strongly, while the reported loss difference becomes small near larger scales. section 9.3
- Supports efficient CPU inference through optimized C++ kernels; the original framework lacks GPU support, while a separate PyTorch port supports CUDA. section 9.4
Running and constructing BitNet models
Install the Python package with pip install bitnet, then construct a BitNetTransformer by specifying vocabulary size, embedding dimension, depth, attention heads, and feed-forward multiplier. For hosted models, Python bindings accept a model identifier, prompt, chat-mode flag, temperature, token limit, thread count, and context size. Hugging Face or PyTorch models can also have their linear layers replaced with BitLinear components. section 9.4
Figure 9.4 The BitLinear component (left) and the BitNet architecture (right)
Shows how BitLinear replaces matrix multiplication in attention while the surrounding architecture retains the standard Transformer layout. section 9.3
