Error Diffusion Replaces Latent Weights: Training Binary-Weight Language Models on a Few Bits of Dithered State

Pierre-Olivier BoninarXiv 2026

TL;DR

This paper introduces a way to train binary-weight language models using up to 19x less memory than standard methods by replacing full-precision "latent" weights with tiny 2–8 bit residual buffers. By borrowing the "error diffusion" technique from image halftoning, the authors demonstrate that you can adapt a 19M-parameter model on a standard CPU within a 275 MB memory budget—something previously impossible for binary models that usually require gigabytes of training state.

What Problem Does This Paper Address?

Binary-weight neural networks are the holy grail for edge computing: they store weights as single bits, enabling massive memory compression and fast, multiplication-free inference. However, there is a "training tax." To update these 1-bit weights, standard recipes (like BinaryConnect or BitNet) maintain a hidden, full-precision "latent" copy of every weight, plus optimizer states like Adam moments.

While a 100M-parameter binary model might only take 12.5 MB to run, it requires roughly 1.2 GB of memory to train or adapt. This massive overhead prevents "on-device" learning, where a model might need to personalize to a user's data on a phone or embedded controller. The authors aim to bridge this gap by creating a "latent-free" optimizer that keeps the training state almost as small as the inference state.

Methods

The authors propose Error Diffusion (ED), an optimizer that treats weight updates like image halftoning (the process of turning a grayscale image into black-and-white dots).

Instead of a 32-bit latent weight, each binary weight ($w \in \{-1, +1\}$) is paired with a small residual buffer ($e$) of only 2 to 8 bits. The process works as follows:

  1. Accumulate: The buffer collects "demanded movements" (gradients scaled by a learning rate).
  2. Fire: When the accumulated value in the buffer crosses a threshold, the binary weight flips its sign.
  3. Diffuse: The "realized" movement (the flip) is subtracted from the buffer, and the remaining "unrealized" update (the error) is carried forward to the next step.
  4. Quantize: The buffer itself is quantized using Stochastic Rounding (SR) to keep its footprint small.
The ED update algorithm.

A critical technical contribution is the threshold-alignment rule: for the optimizer to work at very low bit-widths (like 2 or 4 bits), the quantization grid of the buffer must have a level exactly at the flip threshold. Without this alignment, training often collapses.

Datasets

The researchers evaluated ED across several scales:

  • Teacher-Student MLP: A synthetic benchmark to isolate feature learning capabilities.
  • Tiny Shakespeare: A character-level language modeling task (1.1 MB) used for 2,000-step and 50,000-step runs.
  • enwik8: A byte-level ladder (up to 19M parameters) based on the first $10^8$ bytes of English Wikipedia.
  • wikitext-103: A larger tokenized ladder (up to 70M parameters including embeddings) using GPT-2 byte-pair encoding.

Key Insights and Ideas

  • The Geometry of Quantization: The authors discovered that the perceived "accuracy floor" for low-bit optimizers wasn't due to a lack of information, but rather poor grid geometry. By ensuring the quantization grid aligns with the flip threshold ($C=1.0$), 4-bit buffers can match the performance of 8-bit buffers.
  • Flip Avalanches: Large updates can trigger a chain reaction where too many weights flip at once, causing the model's internal activations to explode and training to stall. The authors solved this "launch instability" by implementing a simple per-step cap on the buffer update.
  • Halftoning as Optimization: The insight that training a binary weight is fundamentally the same mathematical problem as dithering a grayscale image allows for a very efficient, first-order $\Delta\Sigma$ modulator approach to deep learning.

Key Results

  • Memory Efficiency: ED with a 4-bit buffer uses 19x less training state per weight than the standard latent-weight reference.
  • Accuracy Parity: On the MLP benchmark, ED matches the accuracy of full-precision latent weight training. In transformers, ED trains within 1.7% of the latent-weight reference at convergence.
  • On-Device Adaptation: The authors successfully adapted a deployed binary model on a CPU. Using a fused kernel, they stayed within a 275 MB memory budget, whereas standard latent-weight training failed by exceeding the memory limit.
Figure 1: MLP-benchmark test accuracy against the training state of the two binary layers (2W 2× b/wt), widths 64–384, 5 seeds, C=1.0. At the accuracy of the latent reference, the 8-bit buffer needs 11× less training state and the 4-bit buffer 19× less.

Limitations and Future Work

  • The "FP Remnant": While the binary layers are now memory-efficient to train, the model still contains full-precision components (embeddings, LayerNorms, and the output head). As models scale, these "remnants" become the new memory bottleneck.
  • Scale: The experiments were capped at 19M parameters (70M with embeddings). Testing ED on billion-parameter models is a necessary next step.
  • Wall-clock Efficiency: While memory-efficient, the cost of generating stochastic rounding bits was not the primary focus and could be an area for hardware-level optimization.
  • Downstream Tasks: The evaluation focused on validation loss and synthetic accuracy; performance on specific downstream NLP tasks (like reasoning or summarization) remains to be seen.

Summary updated

Abstract

Binary-weight language models store one bit per weight, but training them keeps a full-precision latent copy of each weight plus Adam state, about 96 extra bits per weight, so a deployed binary model cannot be adapted on the device that runs it. We replace the latent weight with a 2-8-bit residual buffer quantized by stochastic rounding, which cuts the training state per weight from 97 bits to 3-9, up to 19x less. The resulting error-diffusion (ED) optimizer moves the residual-carrying loop of image halftoning onto the weight-update path. Each buffer accumulates the unrealized part of every update and flips the weight when the accumulated value crosses a threshold, and it works only when its quantization grid has a level exactly at that threshold. Under this threshold-alignment rule, 4-bit buffers match 8-bit buffers on a binary multilayer perceptron benchmark, and the same rule lifts a different latent-free optimizer, Bop, from a 10-point deficit at 4 bits to full-precision accuracy. On character-level transformers with 97% of parameters binary, ED trains within 5-11% of the latent-weight reference at a 2,000-step budget and within 1.7% at convergence. On scaling ladders over enwik8 and wikitext-103, up to 19M parameters on enwik8 (70M with the wikitext-103 embeddings), the latent-free loss stays within -2.3% to +2.9% of the reference at all six sizes once a per-step cap on the buffer update removes a launch instability; without the cap it trails by 10% at the largest tokenized size. A deployed binary model continues training under ED at one tenth of the latent training state, matching latent-weight continuation, and a fused CPU kernel completes the adaptation within a 275 MB training-memory budget, which latent-weight training cannot. A 250-step probe sets the flip learning rate at any new scale.
BibTeX
@misc{bonin2026error,
  author = {Pierre-Olivier Bonin},
  title = {{Error Diffusion Replaces Latent Weights: Training Binary-Weight Language Models on a Few Bits of Dithered State}},
  year = {2026},
  eprint = {2610.34566},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2610.34566},
}
Figure