· 6 min read ·

Training Through Discontinuity: The Mechanics Behind BitNet's Quality Claims

Source: hackernews

The BitNet GitHub repository leads with inference benchmarks, and those benchmarks are credible: 40-60 tokens per second on an Apple M2 CPU for a 3B model, 0.8 GB of memory instead of 1.9 GB for a comparable Q4_K_M GGUF, roughly 71% less energy at 7B scale than full FP16. Those numbers come from a specific training regime that most discussions of BitNet skip past, which is worth examining because it explains the quality results and sets the floor for who can realistically produce competitive BitNet models.

The Gradient Problem

Standard backpropagation works because every operation in the forward pass is differentiable. Gradients flow backward through the computation graph, and each parameter receives an update proportional to its contribution to the loss. The absmean quantization step at the heart of BitNet b1.58 breaks this:

W_q = RoundClip(W / (mean(|W|) + ε), -1, 1)

The RoundClip function is piecewise constant. Its derivative is zero almost everywhere and undefined at the rounding boundaries. If you try to train through this naively, gradients vanish immediately and the network never learns. Every gradient update touches the rounding step, finds zero derivative, and produces a null update.

BitNet solves this with the straight-through estimator (STE), introduced in a 2013 paper by Yoshua Bengio and applied to binarized networks in the Courbariaux et al. work from 2015. The STE treats the quantization step as an identity function during the backward pass. The gradient of the quantized weight is approximated as the gradient of the underlying full-precision weight, as though quantization did not happen. The optimizer maintains a full-precision “latent” copy of the weights. At each training step, the latent weights are quantized for the forward pass, the loss is computed, and gradients flow backward through the STE approximation to update the full-precision copy. At inference, the latent weights are discarded; only the ternary values remain.

The STE is a deliberate mathematical approximation, not an exact solution. The gradient updates do not minimize the true quantized loss; they minimize a smoothed proxy for it. This makes training with the STE less stable than standard full-precision training. Sensitivity to learning rate schedules, warmup duration, and weight initialization is higher, and the training recipes that produce the published BitNet results reflect careful tuning around these instabilities. This is one reason the BitNet training tooling has not yet been absorbed into mainstream frameworks like axolotl or unsloth: the STE training loop requires modifications to the backward pass that interact poorly with assumptions in standard autograd engines.

Why Zero Is Load-Bearing

The ternary set {-1, 0, +1} is specific, not arbitrary. The original BitNet paper from October 2023 and earlier work including XNOR-Net explored pure binary {-1, +1} networks at scale, and they hit a quality ceiling that made them impractical for language modeling. The b1.58 addition of zero is what closes most of the gap to full precision.

In a matrix multiplication, a zero weight means: this input dimension contributes nothing to this output. In a transformer feed-forward layer, zero weights let the network effectively ignore activations it finds irrelevant. Pure binary {-1, +1} networks must use every input with equal magnitude; the network has no way to route information selectively without that third value. The result is that binary networks are forced into representations that must work around an overconstrained weight space.

In practice, trained BitNet b1.58 models show meaningful fractions of zero weights, typically above 40% in published analyses. That effective sparsity is not hand-crafted; it emerges from training under the ternary constraint. The network learns to zero out connections that reduce loss, which is qualitatively similar to what L1 regularization encourages in full-precision models, but enforced at the weight value rather than through a penalty term. This is why the quality comparison between BitNet b1.58 and post-training quantization of a full-precision model is not symmetric: GGUF Q4 rounds an existing weight distribution, preserving whatever structure the original training produced. BitNet trains into the ternary constraint, and the learned structure reflects that from the first parameter update.

The Scaling Relationship

The b1.58 paper reports that perplexity for BitNet at 7B parameters slightly outperforms full-precision LLaMA at the same scale (9.17 vs. 9.34 on WikiText-2). At smaller scales, the gap between ternary and full precision is larger. This scaling behavior has a mechanistic explanation.

Large models are overparameterized relative to the information content of their training data. In full-precision models above a certain scale, weight distributions show substantial redundancy: many weights cluster near zero, and many weight relationships can be approximated discretely without large quality loss. The ternary constraint is less damaging in this regime because the network has enough total capacity to compensate for any individual weight’s imprecision. A 7B ternary model has 7 billion degrees of freedom to work with, even if each degree is constrained to three values; a 700M ternary model has ten times fewer levers to adjust.

Training token count interacts with this. The BitNet-b1.58-2B-4T technical report documents a 2B model trained on 4 trillion tokens performing competitively with LLaMA 3.2 and Gemma 3 at the same parameter count. Four trillion tokens is a compute budget comparable to what produced LLaMA 3’s base models. The ternary constraint appears to require more training signal to reach the same quality ceiling as full precision at smaller scales, and the 2B-4T result is the most compelling published demonstration because it combines both scale factors: enough parameters and enough data for the constraint to work with rather than against.

The headline claim in the repository, that a 100B BitNet model can run on a CPU, scales this logic upward. A 100B ternary model at 2 bits per weight requires roughly 25 GB of storage, well within reach of systems that cannot hold a 4-bit quantized 100B GGUF model at about 50 GB. The quality argument suggests a 100B ternary model, trained on sufficient data, should be competitive with full-precision models substantially larger than 100B. The inference argument is that 25 GB fits on consumer hardware a 4-bit quantized 100B model cannot.

The Practical Training Stack

The training infrastructure for BitNet exists but has not reached the maturity of full-precision pipelines. The core requirements are: a BitLinear layer replacing nn.Linear, the STE pass wired into the backward graph, a training recipe that accounts for the additional instability from quantized-forward and full-precision-backward passes, and enough compute to benefit from the scaling properties described above.

The BitNet repository provides inference infrastructure built on llama.cpp, not a training framework. Microsoft’s published training results come from custom implementations built on PyTorch with modifications that have not yet been contributed to mainstream training frameworks. Someone wanting to train a domain-specific BitNet model today is starting from research-grade code, adapting it to their data and hardware, and working without the support infrastructure that exists for fine-tuning GGUF models.

Fine-tuning a trained BitNet model also does not map onto standard LoRA workflows. Standard LoRA adds low-rank adapter matrices on top of frozen full-precision weights; adapting that to a ternary weight regime requires either maintaining full-precision adapters on top of ternary base weights (which works but loses some inference efficiency) or ternary-aware adapter training (which requires the same STE machinery as full training). The tooling gap is real, and it closes through engineering investment rather than through the inference optimizations the repository demonstrates.

Who the Investment Favors

The inference economics of BitNet improve with deployment scale and constrained hardware. In a datacenter with GPU clusters, a 71% energy reduction is meaningful but not transformative; the difference between a H100 inference cluster and a slightly smaller one is a procurement decision. For edge deployments, the math is different. A model that runs on a Raspberry Pi 5 with usable latency, requiring no GPU, reaching competitive quality at 2B parameters, enables deployment contexts that GGUF quantization at any bit width cannot reach because GGUF still requires hardware capable of efficient INT4 matmul.

The 4 trillion token training compute investment for the 2B-4T model is not accessible to most teams. But the scaling relationship means larger organizations with real training budgets produce models whose inference runs on hardware available to everyone. The architectural case for ternary-from-training is solid, the published benchmarks are credible, and the hardware trajectory for edge computing favors low-energy, low-memory inference over time. The training infrastructure needs to mature, the fine-tuning tooling needs to develop, and the compute investment needs to follow. The quality results give a clear reason to expect that investment will come.

Was this interesting?