1-Bit LLM Explained: How Ternary Weight Models Work

How a 1-bit LLM like BitNet b1.58 works: BitLinear, absmean ternary weights, native training versus quantisation, CPU speedups and the accuracy cost.

1-Bit LLM Explained: How Ternary Weight Models Work
Written by TechnoLynx Published on 11 Jul 2026

A 1-bit LLM in the BitNet sense is a Transformer that swaps the standard nn.Linear layers for BitLinear layers. BitLinear rounds each weight to one of three values, {-1, 0, +1}, using an absmean scale, and quantises activations to 8-bit integers with a per-token absmax scale. The model is trained this way from scratch, not compressed after training. That is why it is usually called a 1.58-bit LLM: three possible values carry about 1.58 bits of information per weight. In the BitNet papers the accuracy cost shrinks as models grow, and the b1.58 authors report matching a full-precision LLaMA from about 3B parameters. The efficiency gain depends on dedicated kernels: the standard transformers library gives none, while bitnet.cpp speeds up CPU inference.

How BitLinear Replaces a Standard Linear Layer in a BitNet LLM

The original BitNet paper (Wang et al., 2023) introduced BitLinear as a drop-in replacement for nn.Linear, so that 1-bit weights could be trained from scratch. In that first version, each weight matrix was centred to zero mean, then binarised to +1 or -1 with the sign function, and a scaling factor was applied afterwards to cut the l2 error against the real-valued weights. Activations went through absmax quantisation: each value is multiplied by Qb (2^(b-1), so 128 at 8 bits), divided by the absolute maximum of the input, and clipped to [-Qb, Qb].

BitNet b1.58 (Ma et al., 2024) added a zero to the codebook, which is where the extra 0.58 bits come from. Its weight quantiser is short enough to write out in full:

gamma = mean(|W|)                      # average absolute value of the matrix
W_q   = RoundClip(W / (gamma + eps), -1, 1)
RoundClip(x, a, b) = max(a, min(b, round(x)))

The BNN-for-LLM survey (2025) relays the b1.58 authors’ argument that allowing zero weights gives the model explicit feature filtering, which they credit with significantly boosting the performance of 1-bit LLMs. Activations in b1.58 are scaled symmetrically to [-Qb, Qb] for each token, which avoids a zero-point.

Worked Example: Absmean on One Small Weight Row

The mean absolute value is (0.9 + 0.05 + 0.6 + 0.2) / 4 = 0.4375. Dividing gives roughly [2.06, -0.11, -1.37, 0.46], and rounding then clipping to [-1, 1] gives [+1, 0, -1, 0]. Two of the four weights become zero, the large positive one saturates at +1, and the scale 0.4375 is kept to restore magnitude after the matrix multiply.

What Happens During Training

Rounding has no useful gradient, so BitLinear uses a straight-through estimator: the backward pass treats round() as the identity, which lets gradients flow through the quantiser. The optimiser keeps a high-precision latent copy of every weight to accumulate updates, gradients and optimiser states stay in high precision, and the latent weights are quantised on the fly in the forward pass and never used at inference. Hugging Face’s 1.58-bit fine-tuning write-up describes the same split: during training the ternary weights are rescaled so the matrix multiplication stays in fp16, bf16 or fp32, while at inference the weights stay ternary, activations go to 8 bits, an efficient kernel does the multiply, and the result is divided by both scales.

Not every parameter becomes ternary. The BNN survey notes that binarised LLMs keep embedding and layer-norm parameters in full precision, because binarising them damages the token representation and the scaling of activations. Microsoft’s released 2B model is described as a Transformer with BitLinear layers, rotary position embeddings and squared ReLU in the feed-forward blocks.

Why “1.58 bits” Is Not How the Weights Are Actually Stored

The 1.58 figure is information content, log2(3) ≈ 1.585, not a storage format. Ternary values do not fit standard data types efficiently, so each runtime picks a packing scheme with its own real bits-per-weight.

Packing scheme Effective bits per weight Where it is used
Four ternary values per int8 2.0 (8 / 4) The custom CUDA kernel in the BitNet b1.58 2B4T report
Three weights in 5 bits (1-bit sign plus 4-bit table index) About 1.67 (5 / 3) bitnet.cpp TL kernels, split so memory access stays aligned
Five ternary values per int8 About 1.6 (8 / 5) TWLA’s packed format for post-training ternary models
llama.cpp TQ1_0 and TQ2_0 1.69 and 2.06 Element-wise ternary kernels in llama.cpp

The arithmetic behind the rows is simple: 3^4 = 81 and 3^5 = 243 both fit inside the 256 values of a byte, so four or five ternary weights can share one. The bitnet.cpp authors point out that storing three weights as a contiguous 5-bit field would cause serious misaligned memory access, which is costly because lookup-table matrix multiplication is memory-bound; their signed-unsigned split keeps 5 bits for three weights without that penalty. Packing is not free on a GPU either: the 2B4T kernel loads packed int8 weights from HBM into shared memory and unpacks them immediately before the multiply.

Is a Natively Trained 1-Bit LLM Different from Quantising an Existing Model to 1 Bit?

Yes, the two are distinct approaches. A native 1-bit LLM learns its weights inside the ternary constraint from the first step; a quantised model learned in floating point and is pushed into a format it was never optimised for.

The standard vocabulary helps here. In post-training quantisation (PTQ), a trained model is calibrated on a small dataset to set clipping ranges and scales, then quantised with no retraining, which is fast but usually less accurate than quantisation-aware training (QAT), especially at low precision. QAT fine-tunes the quantised model on training data to recover the loss, at the cost of retraining. The BNN survey treats BitNet as a third thing: quantisation from the very start of training, distinct from both. The quantisation survey by Gholami et al. (2021) adds that naive binarisation and ternarisation generally cause severe accuracy loss, which is why so much work exists on fixing them.

Results from Microsoft and from an independent group both favour native training:

  • The BitNet b1.58 2B4T report (Microsoft Research, 2025) found its native model needs less memory than INT4-quantised Qwen2.5-1.5B and still scores higher overall, while standard PTQ visibly degraded the original model.
  • The same report says 2B4T beat both smaller native 1-bit models and much larger models that were post-training quantised to 1 bit.
  • Spectra (Kaushal et al., 2024), from outside Microsoft, found that above one billion parameters, pretrained ternary models outperform both quantised and floating-point models of the same size in bits, and that their 3.9B ternary model matched the 3.9B float model across benchmarks.

Converting an existing checkpoint is possible, but not by switching layers abruptly. Hugging Face reported that switching Llama 3 to BitLinear layers abruptly produced a starting loss about the same as random weights, meaning the model lost what it had learned; their answer was to introduce quantisation gradually with a lambda warm-up. With that approach their fine-tuned model reached 12.2 WikiText perplexity after 10 billion tokens.

Pure post-training ternary quantisation has also improved. TWLA (2026) is a retraining-free PTQ method that reaches 1.58-bit weights with low-bit activations. With 16-bit activations it retains 86.9% of FP16 average accuracy on LLaMA3-8B, 94.5% on Qwen3-14B, and comes within 4.05% of FP16 on LLaMA2-70B. Two details matter when comparing it with BitNet. TWLA uses asymmetric ternary levels with a per-row shift, not BitNet’s symmetric {-1, 0, +1} times one scale. Its authors also note that earlier weight-only ternary methods kept activations in full precision and dequantised weights at inference, which limits real speedups.

Our reading of this evidence: if you can choose a model that was trained ternary, the published comparisons favour it over a ternary conversion of a float model. Ternary PTQ makes sense when the model you need only exists in floating point and retraining is out of reach, provided you validate it on your own tasks rather than trusting averaged benchmark retention. Native training costs more. The BNN survey observed BitNet b1.58 training running 60% slower than the baseline.

Why Ternary-Weight Models Run Well on a CPU

With weights limited to -1, 0 and +1, a matrix-vector product needs no weight multiplications: each output sums the activations paired with +1, subtracts those paired with -1, skips the zeros, and applies the two scales once at the end. Gholami et al. note that ternarisation removes costly matrix multiplications, and cite INT8 addition as 30 times more energy-efficient than FP32 addition. Hugging Face describes BitNet’s matrix multiply as INT8 additions instead of FP16 multiply-adds. The b1.58 paper uses an energy model to estimate a 71.4-fold saving in matrix-multiplication arithmetic energy on 7nm chips; treat that as a modelled estimate, not a measurement.

Memory traffic is the other half of the story. The bitnet.cpp authors show the bandwidth ceiling for their lookup-table kernel: it reaches peak throughput at four threads because memory bandwidth saturates.

The measured results come from bitnet.cpp, Microsoft’s reference C++ runtime for 1-bit LLMs:

  • Speed: 2.37x to 6.17x faster than llama.cpp on x86 CPUs, and 1.37x to 5.07x on ARM, across model sizes (Microsoft, 2024).
  • Energy: 71.9% to 82.2% lower on an Intel i7-13700H for models up to 7B, and 55.4% to 70.0% lower on an Apple M2, where the 70B model saved the most.
  • Footprint: the 2B4T model card lists 0.4GB of non-embedding memory and 29ms CPU decoding latency per token, against 1.4GB to 4.8GB and 41ms to 124ms for the comparable full-precision models in its table. Those latencies were measured on a 13th Gen Intel Core i7-13800H with 8 threads, bitnet.cpp for BitNet and llama.cpp for the others.

Correctness depends on the kernel, not only the format. In Microsoft’s test with a 700M BitNet b1.58 model against an FP32 reference on 1,000 prompts, bitnet.cpp’s I2_S, TL1 and TL2 kernels matched the full-precision output on 100% of samples, while llama.cpp’s TQ1_0 and TQ2_0 matched on 1.4%. The reason given is that llama.cpp quantises activations in blocks of 256, which is inconsistent with the per-tensor int8 activations BitNet was trained with. I2_S was designed to follow the training-time quantisation exactly, and that is why it is lossless.

The same lesson appears in the model card, which warns that running 2B4T through the standard transformers library brings no speed, latency or energy gain, and may be slower than a full-precision model on CPU and GPU.

Where the GPU Story Stands

GPUs can run ternary models, but commodity GPU architectures are not optimally designed for them. The 2B4T authors wrote a custom CUDA kernel for W1.58A8 because standard libraries lack optimised kernels for that mixed format, and they state plainly that current commodity GPU architectures are not designed well for 1-bit models. Gholami et al. made the wider point years earlier: INT8 deployment is well supported by tools such as TensorRT, while software for lower precision is patchy or missing. We would not pick a ternary model to get a GPU deployment cheaper. For how bandwidth and accuracy trade off across the more common formats, see our piece on LLM quantization, memory bandwidth and where accuracy breaks.

How Much Accuracy Does a 1-Bit LLM Lose Compared with Full Precision?

The gap narrows with model size, and published native models report near parity from about 3B parameters. The original BitNet paper found its loss follows a power law like an FP16 Transformer, with the gap shrinking as model size grows. The b1.58 paper reports that BitNet b1.58 starts to match full-precision LLaMA in perplexity at 3B parameters, while being 2.71 times faster and using 3.55 times less GPU memory. The BNN survey reads the same table as the gap narrowing with size, with comparable perplexity and downstream accuracy at 7B. Spectra’s 3.9B ternary model matching its float twin points the same way, and the 2B4T report describes performance on par with leading full-precision open models of similar size.

We would treat “parity from about 3B” as the authors’ result, not a rule for evaluating 1-bit LLMs for procurement. The b1.58 comparisons are against full-precision baselines with matched size and training tokens. For converted rather than native models, the TWLA retention figures in the previous section are the better guide, and they leave a larger gap on LLaMA3-8B than on LLaMA2-70B.

What Still Runs at Higher Precision

Several parts of these “1-bit” models stay at higher precision. In W1.58A8 the activations flowing through the linear projections are still 8-bit, gradients and optimiser state are kept in high precision during training, and embeddings and layer norms are not binarised. Research on pushing activations lower exists; TWLA’s authors note that BitNet v2 pairs ternary weights with 4-bit activations, but depends on expensive quantisation-aware training.

That shapes where we think ternary models belong in a serving stack for production inference platforms. They are a strong fit where memory and energy dominate and the hardware is a CPU: edge devices, laptops and ordinary servers without accelerators, the devices the 2B4T authors name as bitnet.cpp’s target. The b1.58 authors also argue that the smaller memory and energy footprint makes CPU-heavy edge and mobile deployment practical. Getting there takes an engineering decision on three fronts: pick a natively trained model where one exists, run it on a kernel that preserves the training-time quantisation, and confirm accuracy on your own prompts before anything ships. The open question that remains is hardware: the 2B4T authors say accelerators need dedicated logic for low-bit arithmetic to realise the format’s full potential.