Error Diffusion Replaces Latent Weights: Training Binary-Weight Language Models on a Few Bits of Dithered State
Organizations: Independent Researcher
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.
Figures & tables
| ED buffer | dithered Bop EMA | |||
|---|---|---|---|---|
| bits | naive | rule | absmax grid | aligned grid |
| 8 | ||||
| 4 | ||||
| 2 | ||||
| 2k steps | 50k steps | |||
|---|---|---|---|---|
| method | ||||
| FP32+Adam (96 b/wt) | 1.591 | |||
| latent reference (97 b/wt) | ||||
| ED-int8 (9 b/wt) | 1.583 (1.586) | |||
| ED-int4 (5 b/wt) | 1.681 | |||
Appendix figures & tables10 assets
Supplementary material from the paper’s appendix.
Appendix
| cell | layers/heads/ | binary / FP params | data, block, batch, steps (eval every) | binact | flip-lr | seeds |
|---|---|---|---|---|---|---|
| Table 3 , 2k | 4/4/128, 256, 512 | 0.79M/52k, 3.1M/103k, 12.6M/207k | Shakespeare char, 256, 64, 2k (250) | no | 100, 60, 80 (100, 60, 80) | 0, 1, 2 |
| Table 3 , 50k | 4/4/256 | 3.1M/103k | Shakespeare char, 256, 64, 50k (1000) | yes | 60 (45) | 0 |
| enwik8 ladder | 2/4/128, 4/4/256, 6/8/512 | 0.39M/100k, 3.1M/201k, 18.9M/407k | enwik8 bytes, 256, 64, 15k (1000) | yes | 25, 60, 180 (12, 30, 45) | 0, 1, 2 (+3, 4 at 512) |
| wikitext-103 ladder | same three | 0.39M/12.9M, 3.1M/25.8M, 18.9M/51.5M | GPT-2 BPE, 128, 64, 15k (30k at 512) (1000) | yes | 40, 90, 225 | 0 |
| deploy-then-adapt | 4/4/256 | 3.1M/201k | Shakespeare bytes, 256, 64, 5k (250) | yes | 60 (30) | 0, 1, 2 |
| 1-bit gradients | 4/4/256 | 3.1M/103k | Shakespeare char, 256, 64, 2k (250) | yes | adaptive drive 0.03 | 0, 1, 2 |
| prediction or criterion | record | outcome |
|---|---|---|
| Transformer pass criterion: ED-int8 within of the latent reference after a flip-lr sweep, else report the negative | docs/ADR.md (ADR-010), 2026-07-14 | passed, at 128/256/512 (3 seeds) |
| flip-lr optimum at 80–90 (drive ), bracket , pass if the interior candidate wins | docs/scaling-plan.md , 2026-07-14 | passed, 80 wins (1.782) with 160 tying (1.783) |
| Ladder gate: ED loss runs parallel to the latent reference across sizes, and the two controls (binary activations in both arms, re-probed flip-lrs) were named before running | docs/scaling-plan.md , docs/RESULTS_s2.md (S2.6), 2026-07-14/15 | passed after the controls, |
| Threshold-aligned regrid rescues dithered Bop’s 4-bit collapse | docs/RESULTS_s2.md (S2.11), 2026-07-14 to 16 | passed, 46.5 57.0 at 5 b/wt |
| Velocity-scaled drive predicts that heavy-ball momentum cells at flip-lr 1.0 destabilize | docs/RESULTS_s2.md (S2.4), 2026-07-15 | failed, they did not destabilize (rule does not extend through momentum) |
| Second-order buffer: if 2+2 bits beats a 4-bit buffer the exchange curve improves, else it is dropped | docs/ADR.md (ADR-013), 2026-07-15 | negative, dropped |
| 64 | 96 | 128 | 192 | 256 | 384 | |
|---|---|---|---|---|---|---|
| latent reference (97 b/wt) | ||||||
| FP32+Adam (96 b/wt) | ||||||
| ED-int8 (9 b/wt) | ||||||
| dithered Bop int8 (9 b/wt) | ||||||
| ED-int4 (5 b/wt) |
| method | 9 b/wt | 5 b/wt | 3 b/wt |
|---|---|---|---|
| ED buffer ( ) | 56.3 | 56.4 | 52.3 |
| saturating integer latent weight, SR updates, sign readout | 56.2 | 56.1 | 52.1 |
| magnitude-free sign counter [ Colombo et al., 2024 ] | 52.4 | 10.1 | |
| buffer plus SR-quantized momentum (budget split) | 56.3 | 48.9 | |
| second-order cascade | 29.1 | 22.5 | – |
| ECO-style decayed carrier, | 45.4 / 55.3 / 56.3 at 8 buffer bits | ||
| buffer bits | FP gradients | 1-bit gradients | cost (points) |
|---|---|---|---|
| 8 | |||
| 4 | |||
| 2 |
| step | val loss | flips/step | buffer | act. scale, blocks 0 / 1 / 2 | grad, binary proxies | grad, FP remnant | LN gain mean / max | head norm |
|---|---|---|---|---|---|---|---|---|
| 1800 | 2.107 | 36.7k | 0.449 | 1.26 / 0.87 / 0.73 | 0.0106 | 0.81 | 1.012 / 1.16 | 19.4 |
| 1900 | 2.053 | 38.4k | 0.455 | 1.28 / 0.89 / 0.74 | 0.0097 | 0.72 | 1.013 / 1.16 | 19.6 |
| 2000 | 3.488 | 79.2k | 0.535 | 3.39 / 2.58 / 1.29 | 0.0018 | 0.45 | 1.014 / 1.17 | 19.7 |
| 2100 | 3.078 | 4.0k | 0.530 | 3.22 / 2.59 / 1.31 | 0.0041 | 0.55 | 1.014 / 1.18 | 19.6 |
| 2500 | 2.685 | 18.3k | 0.520 | 2.71 / 2.38 / 1.31 | 0.0063 | 0.57 | 1.013 / 1.18 | 20.4 |
| 3000 | 2.490 | 23.4k | 0.516 | 2.50 / 2.02 / 1.22 | 0.0073 | 0.69 | 1.012 / 1.17 | 21.0 |
| Artifact | Script(s) | Log(s) |
|---|---|---|
| Fig. 2 | tools/plot_halftone_concept_sim.py | self-contained, fixed seed |
| MLP headline, Fig. 1 | headline.sh , widthsweep.sh , widthsweep_int4c1.sh , r4_fixes.sh | headline_5seed , widthsweep_5seed , widthsweep_int4c1 , r4_widthsweep_int8c1 |
| Table 1 (ED) | p2clamp.sh , p2boundary.sh | p2clamp , p2boundary_5seed |
| Table 1 (Bop) | s2bopalign.sh , s2bopalign2.sh | s2bopalign , s2bopalign2 |
| Integer latent, counter, ECO-style carrier | s2intlat.sh , s2baselines.sh | s2intlat , s2baselines |
| Second-order buffer | s2sigma.sh | s2sigma |
Binary Neural Networks
Binary neural networks use one-bit weights or activations to reduce model storage and computation for efficient learning and inference.
See all 29 papers