BitNet b1.58: Ternary Weights for 1.58-bit LLMs
Unlike post-training INT4 methods such as AWQ, BitNet b1.58 is trained from scratch with BitLinear layers so inference never stores FP16 weights — a new compute recipe, not a calibration trick.
Modern Transformers store most of their parameters as FP16/BF16 floats. Inference cost is then two coupled taxes: floating multiply–adds inside every nn.Linear, and DRAM → SRAM weight traffic every time you decode a token. Post-training quantization (GPTQ, AWQ, …) squeezes weights after the fact. BitNet b1.58 asks a sharper question: what if the model is born with only three weight values?
The answer in this tech report is a LLaMA-alike Transformer where every weight is ternary — about bits in the binary alphabet (). Activations stay 8-bit. The replacement block is BitLinear. On the authors’ RedPajama 100B-token runs, that recipe matches their FP16 LLaMA baseline in perplexity and zero-shot accuracy starting at the 3B scale, while cutting measured memory and latency.
What this paper explains
BitNet b1.58 is a from-scratch training recipe for Transformer LLMs:
- Ternary weights. Each parameter is constrained to with an absmean quantizer (Eqs. 1–3 in the paper). The extra versus pure BitNet is explicit feature filtering — and the reason the bit-width is quoted as .
- BitLinear. Swap
nn.Linearfor a layer whose forward pass uses those ternary weights (and 8-bit activations), so matrix multiplies are dominated by integer addition / subtraction, not FP16 multiply–add. - LLaMA-alike stack. RMSNorm, SwiGLU, RoPE, no biases — so the architecture plugs into open-source serving stacks with minimal glue.
- Pareto claim (authors’ runs). Same model size and token budget versus a reproduced FP16 LLaMA: competitive quality from 3B upward, with substantially lower memory / latency / energy estimates (Tables 1–3, Figures 2–3).
This is not another post-training INT4 recipe. AWQ (already in Daily) calibrates salience scales then quantizes a finished FP16 checkpoint. BitNet b1.58 never keeps an FP16 weight matrix at inference — the ternary grid is the trained object.
Prior limits
- FP16/BF16 Transformers are expensive to serve. Weight traffic and FP multiply–adds dominate decoding energy and DRAM bandwidth.
- Post-training quantization is widely deployed but sub-optimal in the authors’ framing: you compress a model that was never asked to live on a low-bit grid.
- Prior 1-bit BitNet (WMD+23 in the paper’s citation) already showed integer-add matmuls with weights, but modeling capacity without an explicit was weaker.
- Industry drift toward 4-bit PTQ still leaves floating multiplies (or dequant GEMMs) in the hot path and keeps the “train full precision, squash later” recipe.
The mechanism
Absmean weight quantization. For a weight matrix , define the mean absolute scale
Then
Every entry of lands in . Divide-by- sets the typical magnitude near ; round + clip does the rest.
Activations. Follow BitNet’s 8-bit path, with one reported change: scale each token’s activations to (symmetric, no zero-point) rather than forcing a range before nonlinearities. The paper calls the quality impact negligible in their runs.
Why matters. Pure weights cannot zero a feature. Ternary weights can — the authors call this feature filtering, and treat it as the modeling upgrade over original BitNet.
BitLinear + LLaMA parts. Architecturally you still have attention and MLP blocks; the linear maps inside are BitLinear. RMSNorm / SwiGLU / RoPE / bias-free design match the open LLaMA lineage so Hugging Face / vLLM / llama.cpp integration stays thin.
A one-line mental model for a single output coordinate: if weights are ternary, a floating MAC collapses toward signed accumulation of activations
i.e. add , subtract , or skip — plus the activation quantization the runtime actually uses. Treat that as pedagogy for the compute story; kernels still need careful packing (the paper measures with a 2-bit Ladder kernel inside FasterTransformer).
Algorithm / figure walkthrough
- Start from a LLaMA-alike Transformer skeleton (RMSNorm, SwiGLU, RoPE, no biases).
- Replace every
nn.Linearwith BitLinear. - During training, keep latent full-precision weights for optimization, but quantize with absmean RoundClip so the forward (and the inference artifact) sees only .
- Quantize activations to 8-bit per token on the symmetric grid.
- At inference, store ternary (packed) weights; matmuls are integer-add heavy; embeddings may remain higher precision (the paper notes embedding memory share shrinks as models grow).
The opening visual is the same arc in three beats: ENTER with dense FP16 weights and floating MACs; RUN absmean + RoundClip into the ternary grid; LEAVE with packed weights whose matmul is mostly add/sub.
What to notice when reading
- Train-from-scratch vs PTQ. If you mentally substitute “run AWQ on a finished LLaMA,” you will misread every table. These models are trained under the ternary constraint.
- Fairness protocol. Comparisons are against the authors’ reproduced FP16 LLaMA on RedPajama for 100B tokens, not against every public LLaMA checkpoint.
- Match point at 3B. Table 1 / Table 2 are where they claim perplexity and zero-shot averages meet or beat the FP16 baseline; smaller sizes still trail slightly.
- Kernel caveat. Latency / memory curves in Figure 2 use a 2-bit kernel — so reported speedups are not yet a perfect ternary ISA.
- Energy numbers are modeled. Figure 3 cites arithmetic-energy models ([Hor14], [ZZL22] in the paper), not a wall-meter on a shipping accelerator.
- “New scaling law” language is the authors’ framing of Pareto tradeoffs (e.g. “13B BitNet more efficient than 3B FP16” as reference equivalences) — read it as cost/quality recipe talk, not a Chinchilla refit.
Results and evidence
All numbers below are from the paper’s Tables 1–4 and Figures 2–3 — not re-measured here.
Perplexity + cost (Table 1). On the authors’ setup, BitNet b1.58 tracks FP16 LLaMA closely by 1.3B–3B:
| Size | FP16 mem / lat / PPL | b1.58 mem / lat / PPL |
|---|---|---|
| 700M | 2.08 GB · 1.18 ms · 12.33 | 0.80 GB (2.60×) · 0.96 ms (1.23×) · 12.87 |
| 1.3B | 3.34 GB · 1.62 ms · 11.25 | 1.14 GB (2.93×) · 0.97 ms (1.67×) · 11.29 |
| 3B | 7.89 GB · 5.07 ms · 10.04 | 2.22 GB (3.55×) · 1.87 ms (2.71×) · 9.91 |
| 3.9B b1.58 | — | 2.38 GB · 2.11 ms · 9.62 (beats FP16 3B) |
Zero-shot averages (Table 2). Tasks: ARC-E/C, HellaSwag, BoolQ, OpenBookQA, PIQA, WinoGrande. Gap narrows with scale; 3B BitNet avg 50.2 vs FP16 49.7; 3.9B BitNet avg 51.2 while still cheaper than FP16 3B.
Scaled cost (Figure 2). Latency speedups vs FP16 grow with size (paper annotates 4.10× at 70B); memory reduction similarly climbs (7.16× at 70B) as the full-precision embedding becomes a smaller fraction.
Throughput (Table 3). On two 80GB A100s with pipeline parallelism, sequence length 512: FP16 70B max batch 16 / 333 tok/s vs BitNet 70B max batch 176 (11.0×) / 2977 tok/s (8.9×).
Energy (Figure 3). Modeled 7nm arithmetic energy: matrix-multiply path dominated by INT8 adds for BitNet vs FP16 add+mul for LLaMA; paper quotes 71.4× arithmetic-ops energy savings for that matmul slice, and end-to-end energy ratios rising with size (annotates up to 41.2× at 70B on their plot).
2T-token run (Table 4). BitNet b1.58 3B trained for 2T tokens under a StableLM-3B data recipe reports higher zero-shot averages than StableLM-3B at 2T on the authors’ Winogrande / PIQA / SciQ / LAMBADA / ARC-Easy mix (74.34 vs 73.22 avg).
Limitations
- Short tech report. Architecture ablations beyond “add zero / LLaMA-alike parts” are thin; lots of systems detail lives in citations (BitNet, Ladder, FasterTransformer).
- Author-reproduced baselines. Results are not a bake-off against every public FP16 checkpoint or every PTQ method at matched bits.
- Kernel / hardware gap. Measured latency uses a 2-bit kernel; the “new hardware for 1-bit LLMs” call-to-action is aspirational relative to shipping silicon.
- Energy is modeled, not a full datacenter PUE study.
- Training recipe cost. You still pay to train under quantization — this is not a free lunch on an existing FP16 checkpoint (contrast AWQ/GPTQ).
- Work-in-progress banner. The arXiv comment flags the note as WIP; treat numbers as the authors’ reported snapshot.
How to read the paper
- Figure 1 — the Pareto cartoon: FP16 MAC vs ternary add/sub.
- §2 Quantization Function — Eqs. (1)–(3); this is the whole mechanism.
- Table 1 + Table 2 — where quality meets cost at 3B.
- Figure 2 + Table 3 — latency, memory, throughput scaling.
- Figure 3 — energy model; read assumptions before quoting the 71.4× figure.
- Table 4 — longer 2T training sanity check vs StableLM-3B.
- §4 Discussion — MoE / long-context / native 1-bit hardware speculation (future work, not results).
Knowledge check
What does BitNet b1.58 store for each weight at inference?
How are ternary weights produced in the paper’s recipe?
How does this differ from AWQ?
On the authors’ 100B-token RedPajama runs, where do they report BitNet matching FP16 LLaMA quality?
Keep reading / Sources
- Paper: The Era of 1-bit LLMs: All Large Language Models are in 1.58 Bits (arXiv:2402.17764)
- Prior BitNet: BitNet: Scaling 1-bit Transformers for Large Language Models
- Contrast in Daily: AWQ: Activation-aware Weight Quantization
- Serving context: Sarathi-Serve, FlexGen
- Open-source lineage named in-paper: LLaMA, RMSNorm, SwiGLU, RoPE, vLLM, llama.cpp, FasterTransformer, Ladder