Research direction II · study design, frozen before any training · repo state 21 November 2026
If a model's MLP weights can only be −1, 0 or +1, what does the rest of the network do about it?
Ternary weights — every weight is −1, 0 or +1 — make a language model much smaller and cheaper to run, but they cost quality. Most work on them asks how to win that quality back. QUANTA asks something different: if we damage one part of a network this way and leave everything else intact, how does the rest of the network adapt? And does the answer depend on the architecture — a standard transformer, or one of the newer hybrids that mix recurrent layers with a few attention layers?
The plan is to train small language models from scratch in matched pairs that are identical except for one thing: in one model of each pair, the MLP (feed-forward) weights are ternary. We compare how much quality each architecture loses, and we measure which parts of the network the damaged model relies on more — not just its loss.
QUANTA stands for Quantized Architectures for Neural Token-flow Analysis. The project was first called BitFuse, and the code repository still uses that name.
Background
Ternary weights, and why damage only one part
A normal language model stores each weight as a 16-bit number. BitNet b1.58 (Microsoft, 2024) showed that a whole model can instead be trained with every weight restricted to \( \{-1, 0, +1\} \). Three possible values carry \( \log_2 3 \approx 1.58 \) bits of information, hence the name. Matrix multiplication then turns into additions and subtractions, and the weights take about a tenth of the memory. During training the model keeps a full-precision copy of each weight that the optimizer updates, and rounds it to −1, 0 or +1 on every forward pass; gradients flow through the rounding as if it were not there (the straight-through estimator).
At small scale this costs quality: a ternary model has a higher loss than a full-precision model of
the same size. The usual response is to improve the quantizer. QUANTA uses the quantizer as a tool
instead, in the spirit of a lesion study in neuroscience: damage one well-defined
part of a system and watch how the rest of it compensates. Here the damaged part is the
MLP weights — the three weight matrices of every feed-forward block
(gate_proj, up_proj, down_proj). Everything else stays at
full precision: attention, embeddings, normalization layers, the recurrent layers, and the
activations flowing between layers (bf16). So when a ternary model is compared with its
full-precision partner, the precision of the MLP weights is the only thing that differs. On this
page, “the lesion” always means exactly this change.
Why the MLPs? They hold most of a transformer's parameters, and they are widely thought to store much of what a model memorizes in training, in fixed weights. Attention and recurrent layers work differently: they compute from the current context, moving information between tokens as the model reads. If the MLPs' fixed weights become coarser, a natural guess is that the model leans more on the parts that work from context. That guess is the study's working hypothesis, and the design is built to test it directly — not just to check that the loss went up. One test goes straight at the "stored knowledge" part: if the MLPs hold what the context does not supply, the lesion should hurt most on tokens the context cannot predict.
Why hybrids? Several recent models replace most of their attention layers with linear recurrent layers, which compress everything read so far into a fixed-size memory, and keep a full attention layer only every few layers. That gives the network a place to keep information that a plain transformer does not have. So the second half of the question is whether such an architecture absorbs damage to the MLPs better or worse than a transformer does.
Where information can live in the network
It helps to list the places where a model can hold or pass along information, because the hypothesis is about how reliance shifts between them. The lesion touches only the first one. The same measurements are taken in every model, at the same points in training.
MLP weights — damaged
The only ternary part of the model. Because the weights are just −1, 0 and +1, we can also read them directly from any checkpoint: what fraction are zero, the balance of +1 and −1, and how often weights flip value during training.
Activations — unchanged
The numbers flowing between layers, still in bf16. We measure whether the MLPs' output becomes flatter, with fewer channels standing out from the rest.
Attention — unchanged
Reads earlier tokens directly. All 28 layers of the transformer are attention; in each hybrid, 7 of the 28 are.
Recurrent memory — hybrids only
The fixed-size memory each recurrent layer updates token by token: 92,160 numbers per layer, in 21 of the 28 layers. We test reliance on it by wiping it every 64 tokens.
Residual stream — tested later
The running sum every layer reads from and adds its output to. It is standard in the main study; a second, exploratory stage swaps in five alternative designs.
The questions
- How much quality does the lesion cost in a plain transformer, and does the model shift its reliance from the MLPs to the attention layers? (RQ1)
- Does the lesion hurt more on tokens the context cannot predict than on tokens that repeat earlier context? If so, the MLPs were holding knowledge the context does not supply. (H6)
- Does a hybrid architecture pay a smaller or a larger cost for the same lesion? (RQ2)
- Does a damaged hybrid lean harder on its recurrent memory? (RQ4)
- Exploratory, in a second stage and a separate paper: do alternative residual-stream designs help a damaged model by more than their extra parameters would explain? (RQ3)
A fifth question, RQ5, only describes: for every comparison above, which of the five places changes, and do the different measurements agree layer by layer? The research-question numbers come from the repository's documents; they are kept so you can look them up.
One principle runs through the whole design: a change in loss is only half a result. If a model loses less quality and none of the measurements of where it leans move as predicted, the study reports a real but unexplained difference — not support for the hypothesis.
What each comparison predicts
Each comparison comes with a prediction of where reliance moves.
Before any training, each comparison was written down with a prediction: which of the places above the damaged model should rely on more, which less, and which measurement would show it. The chart shows those predictions as directions only, not sizes.
The main study
Six models: three architectures, each with and without the lesion.
Every model has the shape of Qwen3-0.6B — 28 layers, hidden size 1,024, about 596 million parameters — and is trained from random initialization on 1 billion tokens of FineWeb-Edu text. At that budget every model is weak in absolute terms, and that is fine: the study compares matched models with each other, and the absolute loss is not the result.
| Label | Architecture | MLP weights | Name in the code |
|---|---|---|---|
| A | transformer: attention in all 28 layers | full precision | fp_baseline |
| B | transformer: attention in all 28 layers | ternary | ternary_mlp |
| A_C | hybrid 1: recurrent layers + Gated MLA attention | full precision | fp_kda |
| C | hybrid 1: recurrent layers + Gated MLA attention | ternary | ternary_mlp_kda |
| A_R0 | hybrid 2: recurrent layers + sparse attention | full precision | fp_qwen_hybrid |
| R0 | hybrid 2: recurrent layers + sparse attention | ternary | ternary_mlp_qwen_hybrid |
The letters are the labels the code and the pre-registration use. “A_” marks the full-precision twin of a ternary model. R0 gets its name from the second stage, where it is “route 0”, the plain baseline that the residual designs R1–R5 are added to. The “kda” in two code names is historical: those models no longer use the KDA layer. Each model is trained three times, with seeds 42, 43 and 44.
Why every ternary model has a full-precision twin
Comparing a damaged hybrid directly with the damaged transformer would mix up two things: how well the hybrid tolerates the lesion, and whether it is simply a better or worse model to begin with. So each architecture gets a pair. Within a pair the parameter count is identical and, at the same seed, the starting weights are bit-for-bit identical; the only difference is MLP precision.
The lesion's cost is then measured inside each architecture, and the costs are compared. This is a difference-in-differences (DiD): the first difference is within each pair, and the second is between architectures.
A made-up example.
- Transformer: B's loss is 0.040 nats above A's. That is the lesion's cost there.
- Hybrid 1: C's loss is 0.025 nats above A_C's.
- DiD = 0.040 − 0.025 = +0.015 nats. Positive means the lesion hurts the hybrid less.
L is the validation loss in nats, the average negative log-likelihood per token.
the lesion alone
The two transformers differ only in MLP precision, so this pair gives the clean cost of the lesion and is where the shift away from the MLPs is measured (H1, H2 below).
does the architecture change the cost?
A hybrid differs from the transformer in several ways at once: the recurrent layers, how many attention layers there are and what kind, their output gates, how they encode position. So a DiD credits the hybrid architecture as a whole, not recurrence alone. Reliance on the recurrent memory itself gets its own test (H3).
the attention layer, alone
The two hybrids share identical recurrent layers and differ only in their 7 attention layers, so comparing them isolates the kind of attention. This comparison is exploratory and gets no verdict.
A side check: output gates. The hybrids' attention layers multiply their output by a learned gate between 0 and 1; the transformer's attention has no gate. A gate alone is known to change how attention behaves (Qiu et al., 2025), so it could explain part of a DiD by itself. Two extra models, A_g and B_g, are A and B with a gate on each attention head (+458,752 parameters, 0.077%). They train at two seeds after the main runs and are reported for information only, with no verdict.
Inside the hybrids
Three recurrent layers, then one attention layer, repeated.
Both hybrids follow the same pattern: of the 28 layers, every fourth one (layers 3, 7, …, 27, counting from 0) is attention and the other 21 are recurrent. The recurrent layers are identical in the two hybrids. Only the attention layers differ.
The recurrent layer: Gated DeltaNet-2
Attention keeps every earlier token around and looks back over all of them. A linear recurrent layer instead keeps a fixed-size memory: a matrix \(S\) that it updates once per token and reads with a query. Its cost does not grow with the length of the text, but it has to decide what to forget.
Gated DeltaNet-2 (GDN-2; Hatamizadeh, Choi and Kautz, 2026, arXiv 2605.22791) updates its memory in three steps for each new token, with key \(k_t\) and value \(v_t\):
- Fade: every row of the memory decays a little, each at its own learned rate \( \alpha_t \).
- Erase: whatever the memory currently stores under the key \(k_t\) is removed, scaled by an erase gate \(b_t\).
- Write: the new value is stored under \(k_t\), scaled by a separate write gate \(w_t\).
Both gates are learned and vary per channel, in \([0, 1]\). Earlier layers of this family use one number for both: Kimi Delta Attention (KDA) ties erase and write together, and Gated DeltaNet also uses a single decay rate. Separate gates let a layer erase a lot and write little, or the reverse.
Size: five heads, key width 128, value width 144, so the memory holds 5 × 128 × 144 = 92,160 numbers per layer. The layer is implemented in the repository from the paper's equations and checked against a step-by-step reference; on the GPU it uses the fused kernel from the flash-linear-attention library.
The two attention layers
Each hybrid borrows its attention layer from a published model, scaled down to this size. Hybrid 1 (C) uses Kimi K3's Gated MLA (multi-head latent attention): keys and values are compressed into a small shared vector to save memory, every query reads every earlier token, and there is no position encoding at all — word order reaches these layers only through the recurrent layers. Hybrid 2 (R0) uses Qwen3.8's sparse attention (QSA): a small scoring network ranks blocks of earlier tokens, and each query reads only the top-ranked blocks, at full resolution.
| Hybrid 1 (C) · Gated MLA | Hybrid 2 (R0) · sparse attention | |
|---|---|---|
| Borrowed from | Kimi K3 | Qwen3.8 |
| What each query reads | every earlier token | the 256 tokens in the top-ranked blocks of 16 (Qwen3.8 itself uses blocks of 4 and 2,048 tokens) |
| Position information | none | rotary encoding on 32 of 128 dimensions per head |
| Heads | 16; keys and values compressed through a rank-224 vector | 16 query heads sharing 8 key/value heads, width 128 |
| Output gate | yes, one per channel | yes, one per element |
| Extra training signal | none | the block-scoring network learns to imitate full attention; this loss does not reach the rest of the model |
| Parameters per layer | 8,389,944 | 8,388,864 + 327,808 for the scorer |
The two attention layers are matched to within 1,080 parameters (0.013%). With its seven block scorers R0 has 0.38% more parameters in total than C. Every departure from the original designs, such as an added normalization of queries and keys in C, is declared in the repository.
Measurements
How “relies on” is measured
The main outcome is plain: validation loss, the average next-token loss in nats on 1,024 held-out sequences at the end of training. Everything else answers why a loss changed. These measurements are taken after training, on every seed's final checkpoint, on fixed held-out text.
- Reliance (for H2). Take one layer's MLP or mixer, replace its output on a sequence with its output on a different sequence, and see how much the loss goes up. A big increase means the model depended on that component. Adding this up over layers 2–25 gives the share of the model's reliance that sits in the MLPs. (The outermost two layers at each end mostly act as embedding and un-embedding, so they are left out.)
- Flatness of the MLP output (for H1). For each token, compare the average magnitude of the largest 10% of the MLP's output channels with the average of the rest. A high ratio means a few channels stand out; a ratio near 1 means a flat output. It is divided by the value random Gaussian noise would give (about 3.14).
- Memory knockout (for H3). In the hybrids, reset every recurrent layer's memory to zero every 64 tokens and measure how much the loss rises. The more the model depends on what it carried from further back, the bigger the rise.
- Knowledge vs context (for H6). Split the validation tokens into two groups. A token is context-predictable if it and the token before it already appeared together earlier in the same 2,048-token sequence, so the model could copy it; every other token is context-free. For each model, T is the log of the ratio between the average loss on the two groups. Comparing T between the ternary model and its twin asks whether the lesion raised the loss by a larger fraction on context-free tokens. A fraction is used because context-free tokens start with a higher loss, so an equal relative damage would look bigger in raw nats. The split is fixed in code before any run and needs no extra training.
- The ternary weights themselves (for H5). Fraction of zeros, how evenly −1, 0 and +1 are used, and how often weights flip value between checkpoints.
These turn the working hypothesis into tests that can fail. Each one has a stated outcome that would count as support and another that would count against it:
| Hypothesis | Supported if | Refuted if | |
|---|---|---|---|
| H1 | The lesion makes the MLP output flatter (A vs B). The quantizer alone should do this, so it mainly checks that the lesion took effect. | the output is flatter in B, with verdict effect | the output is less flat in B, with verdict effect |
| H2 | The damaged transformer relies less on its MLPs and more on its attention (A vs B). | the MLPs' share of reliance falls with verdict effect, and the attention layers' reliance clearly rises | the MLPs' share rises, with verdict effect |
| H3 | A damaged hybrid relies more on its recurrent memory than its full-precision twin does. | the knockout hurts the ternary model more than its twin, with verdict effect | the knockout barely hurts the ternary model at all (within 0.005 nats), or hurts it less than its twin |
| H6 | The lesion raises the loss by a larger fraction on context-free tokens than on context-predictable ones — in the transformer and inside each hybrid (one test per twin pair). | the difference is positive, with verdict effect | the two fractions are equivalent (within 0.01 on the log scale, about one percentage point), or the reverse holds with verdict effect |
| H4 | Exploratory, second stage. The alternative residual designs actually get used. | switching a design off raises the loss, and its learned parameters move away from their starting values | switching it off changes nothing that matters, or it collapses back to a plain residual |
| H5 | Exploratory. The ternary weights end up different when the network has other places to lean on. | the weight statistics differ from B's over at least 4 consecutive layers | they do not |
H6 was added on 21 November 2026, before any run, which is why its number comes last. Its stated limitation: the context-free group also contains tokens that grammar or the nearby words predict, so it is a proxy for “knowledge the context does not supply”, not a clean measure of it.
Ten more exploratory analyses (for example, comparing the internal representations of each twin pair, and breaking down the loss by token type) were also registered before any run. They are reported without verdicts.
Pre-registered · frozen before the first run
What counts as a result, decided in advance.
Small models trained on a fixed budget give noisy numbers: change the random seed and the loss moves a little. With many comparisons it is easy to find something that looks like an effect. So the rules for reading the results were fixed before any run, and they cannot be changed after seeing the data without the change being logged and labelled as such.
The smallest difference that matters: 0.02 nats. That is about 2% in perplexity — roughly what 15% more parameters buy a model of this size, by the Chinchilla scaling fit. A difference smaller than this is treated as too small to matter, however confident the statistics are. (For the memory-knockout test the threshold is 0.005 nats; for the token split, 0.01 on the log scale, about one percentage point.)
Three seeds per model. A seed fixes the starting weights and the order of the training data. The spread between seeds is the noise every comparison has to beat. All comparisons are paired: both models are scored on the same 1,024 sequences.
Comparisons are grouped into five families, one per question: the lesion's cost in the transformer, the two DiDs, the shift in reliance (H1, H2), the memory knockout (H3), and the knowledge-vs-context split (H6). Within a family, p-values are corrected for testing several things at once (the Holm method), so running two comparisons does not double the chance of a false positive.
Every comparison ends with one of three verdicts
effect
There is a real difference: the corrected p-value is below 0.05 and the difference points the same way on every seed. If it is smaller than 0.02 nats it is also flagged as negligible.
equivalent
There is positive evidence of no meaningful difference: the 90% confidence interval lies entirely within ±0.02 nats (a standard equivalence test, TOST).
inconclusive
Neither. This is never reported as “no effect”. A comparison is marked incomplete if a run it needs failed; its estimate is still shown.
The reliance and flatness tests (H1, H2) have no “too small to matter” threshold, so they end as effect or inconclusive.
The honest odds: the hybrid comparison may well end inconclusive
Whether a DiD can reach a clear verdict depends on how noisy the seeds turn out to be (σ), which is not known until the runs finish. The plan was sized for σ = 0.005 nats, but that is an assumption; one scaling study (Kaplan et al.) reports seed noise in loss closer to 0.02. The plan therefore states, from a simulation with its own frozen rules, how likely each verdict is at three seeds (table).
Above σ ≈ 0.005, an inconclusive DiD is the most likely outcome. No seeds were added to change that. Instead, the token-split test (H6) was added: it compares two groups of tokens inside the same runs, so seed noise that moves both groups by the same fraction cancels out.
| seed noise (nats) | real DiD of 0.02 found | zero DiD shown equivalent |
|---|---|---|
| 0.005 | 78% | 88% |
| 0.0075 | 41% | 40% |
| 0.01 | 24% | 11% |
| 0.02 | 7% | 0% |
Middle column: chance that a true DiD of 0.02 nats is called effect. Right column: chance that a true DiD of 0 is called equivalent. Seed noise only; the uncertainty from the choice of validation text lowers each figure a little further.
The abstract was written before the results
So that the framing cannot drift toward whatever the data show, the plan records an abstract for each possible outcome, with blanks only for the numbers. The paper uses the one that matches the verdicts:
A hybrid changes the cost
At least one DiD is an effect. The abstract says by how much, whether the hybrid pays less (its recurrent memory takes over some of the MLPs' work) or more (it depends on its MLPs more), and what the knockout and token split show.
Neither hybrid changes it
Both DiDs are equivalent: at this scale the cost of ternary MLPs does not depend on whether the model has a recurrent memory, so the two choices can be made independently.
Unresolved cost, clear token split
The DiDs are inconclusive; the abstract states the measured noise and what the study could have detected, then reports the token split — whether ternary MLPs lose stored knowledge rather than in-context computation.
Every abstract reports every verdict, including the ones against the predictions, and never calls an inconclusive result a trend. If every test is inconclusive, the paper is reported as exactly that, with the smallest differences the study could have detected and no claim about mechanism.
How the uncertainty is computed, and how sensitive the design is
The noise level σ is estimated from the 18 main runs (6 models × 3 seeds) by a model with one term per model and one per seed, which leaves 10 degrees of freedom; it is fixed once the main runs end. A comparison's standard error combines that seed-to-seed noise with a bootstrap over the 1,024 validation sequences (10,000 resamples).
The design was sized assuming σ = 0.005 nats — an assumption, not a published number, replaced by the measured value at an interim check. At that noise a DiD of 0.02 nats is detected about 78% of the time. In practice a DiD is called an effect above about 0.013–0.015 nats and equivalent within about 0.0095 nats of zero, with an inconclusive band in between by design.
The confidence intervals shown alongside each result follow the same Holm correction, so an interval never excludes zero for a comparison the test did not call significant.
A catch with the DiD: a better model can look more robust
If a hybrid is simply a better model in full precision — in effect, if it gets more out of the same parameters — then losing the same fraction of its capacity to the lesion costs it fewer nats, and its DiD comes out positive with no special robustness at all. The size of this artefact is about \( (L_B - L_A)(L_A - L_{A_X}) / P \), where P ≈ 0.4 nats is the part of A's loss that more parameters could remove.
So every DiD is reported next to how much better the hybrid is in full precision (\(L_A - L_{A_X}\)), and with an adjusted value:
The study claims that a hybrid absorbs the lesion better “beyond the effective-parameter explanation” only if its DiD has verdict effect, is positive and not negligible, and the adjusted DiD's 95% interval is above zero for both values of P.
Runs first · seed 42 · the full 1 billion tokens
The learning rate is chosen by a fixed rule, not by hand.
Ternary weights may train best at a different learning rate than full-precision ones. If the two models of a pair trained at the wrong rates, the comparison would measure the rates rather than the lesion. So the rates are tuned once, by a rule written in advance and applied by code with no human input. The ternary rate applies only to the ternary MLP weights; every other parameter in every model trains at the full-precision rate.
- Step 1, full precision. Model A trains at 1e-4, 3e-4, 6e-4 and 1e-3 (plus 2e-3 if 1e-3 wins).
- Step 2, ternary. Model B trains with its MLP weights at 1, 2.5 and 5 times the chosen full-precision rate (plus 10 times if 5 times wins), and everything else at that rate.
- Runs that misbehave are excluded: divergence, a non-finite loss, or a training loss that climbs more than 0.5 nats above its lowest point after the first tenth of training.
- The default wins ties. A new rate replaces the default (3e-4, or for the MLP weights the full-precision rate) only if it beats it by more than 0.02 nats.
- Safety check before adopting. The other models that will use the rate train briefly at it (763 steps, on a seed no study run uses). If any produces a non-finite loss, the rule drops to the next lower acceptable rate.
- Nothing is wasted. The tuning runs at the chosen rates become the seed-42 runs of A and B.
A check that the hybrids are not handicapped. The full-precision rate is tuned on the transformer only, so it might not suit the hybrids. As a check, A, A_C and A_R0 are each also trained at the chosen rate and at its two neighbours on the list above, for 100 million tokens (a tenth of the study) on seed 45: nine short runs, about 18 GPU-hours. An appendix reports, for each hybrid, whether the chosen rate is within 0.02 nats of its best one. Nothing is decided from it; it runs after all other training and is the first thing dropped if time runs short.
A known bias: the rate is chosen on the same validation set that scores the results, which favours the seed-42 runs of A and B slightly. So the main results are also re-computed without those runs.
Second stage · exploratory
Then: does a different residual stream help a damaged model?
In a standard network, each layer adds its output to a single running sum, the residual stream. Recent models have proposed richer designs: several parallel streams, learned mixing between them, or letting a layer look back at the outputs of earlier layers directly. A damaged model might benefit from such extra routes. This is tested in a second stage, on whichever hybrid looks more promising after the main study, and reported in a separate paper.
Because that choice is made after seeing the main results, everything in the second stage is exploratory: its tests are fixed in advance, but it reports confidence intervals without verdicts. We write down which hybrid we chose and why, and sign that record before the second stage starts. Each design changes only the residual stream; the layers themselves stay exactly as in the chosen hybrid.
| Design | In one sentence | Added parameters | |
|---|---|---|---|
| R0 | standard residual | the chosen hybrid itself: each layer adds its output to one stream | 0 |
| R1 | gated bypass (new in QUANTA) | a learned, per-channel gate lets the layer's input skip around the mixer | 55,296 |
| R2 | Qwen3.8 Gated Residual | four parallel streams; a learned gate decides what each layer reads from them and how its output goes back in | 74,547,200 |
| R3 | DeepSeek mHC | four parallel streams mixed by a learned matrix that is constrained to keep the mixing stable | 5,506,536 |
| R4 | Kimi Block Attention Residuals | each layer attends over the outputs of earlier blocks of layers and picks what to read | 114,688 |
| R5 | single-pass mHC (DeepSeek-V4.1) | R3, but each layer reuses the previous layer's mixing weights | 5,506,536 |
| R0w | wider MLP (control) | no new route, just a wider MLP (3,072 → 3,968) with about as many added parameters as R2 | 77,070,336 |
One more model, A_R1, is R1's full-precision twin, so the gated bypass gets its own small difference-in-differences. Second-stage models train at seeds 42 and 43.
Separating a better design from more parameters
Some designs add many parameters (R2 adds 74.5 million, about 12.5%), and more parameters lower the loss on their own. Rather than shrinking the MLP to compensate, each design keeps the same core and its extra parameters are counted separately. The control R0w then measures what extra parameters are worth when they are simply spent on a wider MLP.
From R0w we get a price per parameter, γ, and each design's gain is corrected by it:
H* is the chosen hybrid, N a parameter count, and g_k the gain of design k beyond what its parameters would buy. The correction matters mostly for R2; for R1 and R4 it is negligible. g_k is also reported with γ set to the Chinchilla value (0.143) and to zero, and flagged if its sign depends on the choice. One stated limitation: R0w's extra weights are ternary while R2's are full precision, so they are matched in parameter count but not in bytes (about 15 MB against 149 MB).
Running it
The order of runs, fixed before the first one.
All runs happen in a declared order, in two launches on the same pinned software environment. If time runs out, runs are dropped from the end of the list, never chosen by hand. The second launch refuses to start if the code or environment differs from the first one's.
Pre-flight checks, then the learning-rate rule
Every model is checked for memory use, numerical stability and kernel correctness, and the machines are tested for recovery after being pre-empted. Then the learning rates are chosen as described above. If no rate qualifies, the study stops here.
The six models, three seeds each
A and B, then the two ternary hybrids, then their full-precision twins. These 18 runs answer the main questions.
Interim check
Looks only at how noisy the runs are — never at a difference between models — and decides whether the second stage needs a third seed for some runs.
Measurements during training, longer runs, side checks
Reliance and flatness at 10, 25, 50 and 75% of training; A, B, A_R0 and R0 once more for 2 billion tokens, to see whether the picture changes with longer training; A_g and B_g; the learning-rate check; a descriptive report of the two hybrids' losses. The first paper is written from launch 1 alone.
Choosing the hybrid for the second stage
We pick C, R0 or neither, and which residual designs to run, and sign our reasons before any second-stage run. No main-study run is ever added or repeated after this point. Choosing “neither” ends the study.
R1 and its twin, then R2, R3, R5, R4 and R0w
Each chosen design at seeds 42 and 43. Roughly 400–440 of the ~1,100 GPU-hours fall here.
- Training data. FineWeb-Edu (the 10-billion-token sample), 1 billion tokens per run, sequences of 2,048 tokens, 65,536 tokens per optimizer step (15,259 steps).
- Held-out data. Taken from the same stream beyond the first 2.048 billion tokens, so even the 2-billion-token runs never train on it: 1,024 validation sequences, plus separate small sets for the internal measurements. A check confirms the sets do not overlap.
- Hardware. One to four identical NVIDIA A100 80GB machines, one run per GPU at a time. One machine does all evaluation, so a run's machine never affects a result.
- Compute. Projected from operation counts before any timing: about 1,100 GPU-hours (870–1,500) through the 2-billion-token runs, about 1,160 for both launches, plus about 18 for the learning-rate check. There is no hard GPU-hour cap; the projection only schedules the work. Runs use pre-emptible machines and resume from checkpoints.
Keeping the comparisons fair, in code
- Everything from scratch. No model starts from the pretrained Qwen checkpoint.
- One model class with switches. Every model is the same code with different settings, generated from one shared config, so shared settings cannot drift apart.
- Matched sizes. The shared core — embeddings, the mixer layers, a 3,072-wide MLP and the norms — is within 0.15% across all models (except the deliberately wider R0w). Anything a design adds is reported separately, never hidden by shrinking something else.
- Identical starts. At the same seed, each twin pair (and A and B) starts from bit-identical weights; a test checks every pair.
- An automatic fairness audit. Before two runs are compared, a script checks every setting that should match. Any mismatch marks the comparison as not controlled. A different training objective can never be declared acceptable.
- One schedule. Cosine learning-rate decay and the same weight decay for every model; only the peak rate comes from the rule above.
- No silent changes. Automatic batch-size reduction on out-of-memory is off. A model that needs more memory trades batch size for gradient accumulation, keeping 65,536 tokens per step, for all its seeds.
- A pinned plan. The pre-registration and its config are hashed before the first run, and the training driver refuses to start without that hash. It is also registered on OSF. Later changes go into a dated amendment log.
What this study is not
- Not a speed claim. The ternary weights are simulated during training (rounded on the fly), which is slower than normal training, not faster.
- Not a BitNet b1.58 reproduction. Only its quantization method is used, and only on the MLP weights.
- Not a reproduction of Kimi K3 or Qwen3.8. Only their attention layers and residual designs are borrowed, scaled down, with every change declared.
- Not an attempt at the best possible small model. Every change has to stay attributable, which rules out chasing the best number.
Bugs that a loss curve would not have shown
Several bugs found during development produced plausible-looking training with wrong models, which is part of why the design leans on tests rather than on loss curves. In the KDA layer (used before GDN-2 replaced it): the decay was applied along the wrong axis, and one intermediate term overflowed for long chunks. Both were caught by checking the fast chunked implementation against a slow step-by-step reference — the same test that now checks GDN-2.
In the sparse attention layer: a scoring bias let one future token leak into the attention scores, so generation with a cache disagreed with a full forward pass by about 1e-2. In initialization: an overridden weight-initialization function left the rotary-position buffers at zero after a model was reloaded — same weights, different outputs, no error. Every resumed run would have been silently wrong.
One finding changed a rule: on a CUDA laptop, two identical runs of C diverged from the first gradient step, while two runs of R0 were bit-identical. Training is not bitwise reproducible, so the second launch's check against the first is reported as a caveat rather than used as a gate.
Reproduce it
The code, configs and plan
The code, configs, tests and pre-registration live in github.com/Kyouma45/BitFuse (private at the time of writing; the repository and its Python package keep the project's earlier name, BitFuse). Development and the whole test suite run on CPU with tiny models; training needs a CUDA GPU. The commands below come from the repository's README and development guide.
Install — transformers v5 is required
python -m venv .venv
source .venv/bin/activate # Linux/macOS
pip install -e ".[dev,eval]"
pip install "git+https://github.com/huggingface/transformers.git@main"
Test and inspect, on CPU
python -m pytest tests/ -q # full suite, CPU, tiny models
python -m bitfuse.cli.validate_cli --skip-reference --device cpu
python -m bitfuse.cli.pretrain_cli --config configs/ternary_mlp.yaml --dry-run
python scripts/show_param_budget.py
--dry-run prints a run's plan without training; the trainer refuses a full-size run on a
machine without a GPU. show_param_budget.py prints the parameter counts of every model.
Smoke-test the GPU kernels — any CUDA GPU, even a 4 GB laptop card
./scripts/local_cuda_smoke.sh ternary_mlp_kda # one model, for a fast signal
./scripts/local_cuda_smoke.sh # all 45 registered models
The full study — one to four A100 80GB machines
scripts/gpu/final_run_tmux.sh start --root <DIR> --remote <DEST>
The driver pauses for sign-offs and refuses to continue if the code, configs or software drift from the pinned versions. The runbook covers recovery after a machine is pre-empted.
Read next
docs/preregistration.md— the frozen plan, with its amendment log.docs/01-overview.md— the question, the models and the hypotheses.docs/20-final-run.md— the operator's runbook for both launches.docs/03-architecture.mdanddocs/06-fairness.md— every layer, and how matching is enforced.
Appendix · history, safe to skip
The larger plan this study was cut down from.
Until late September 2026 the project was much broader: an earlier version of the proposal (v7) had 36 model variants, eight hypotheses and 27 research questions, borrowing ideas from DeepSeek, Kimi, Qwen and NVIDIA models. It was narrowed to the one study above because that was the part that could give a clear answer. Most of the other models are still in the code — built, parameter-counted and tested on CPU — but none of them will be trained or reported. They are recorded here for completeness; the terms below are the repository's own and are not explained further.
How the design changed between v7 (20 September) and the frozen plan (21 November 2026)
- 26–28 Sep — the pre-registration.
docs/preregistration.mdfixes the main outcome, the 0.02-nat threshold, the families, the Holm correction, the verdict rules and the learning-rate rule before any run. There is no GPU-hour cap: every admitted run runs, in a fixed order. - 29 Sep — the side experiments leave. 23 models (the DeepSeek-V4 and V4.1, Kimi K3, Qwen3.8, mixture-of-experts and learned-scale families, and multi-token prediction) stay in the code but are neither run nor reported.
- 1 Oct — one recurrent layer for both hybrids. Gated DeltaNet-2 replaces Kimi Delta Attention and Gated DeltaNet everywhere. The Mamba-2 hybrid and its variants are dropped, so no Mamba-2 model is trained. Models that became identical to a main-study model were deleted.
- 4 Oct — amendment AMD-20261004. Hybrid 1's attention becomes Kimi K3's Gated MLA without positions, hybrid 2's sparse attention gets Qwen3.8's partial rotary encoding, and the two are matched layer by layer, so comparing C with R0 tests the attention layer alone. Ten exploratory analyses are registered.
- 5 Oct — AMD-20261005. The residual-stream experiments move to a second launch on a hybrid chosen after the first, which makes them exploratory. The learning-rate rule gets two steps and the safety check. A_g and B_g are added.
- 9–10 Oct — AMD-20261009, AMD-20261010. The ternary MLP rates are set relative to the full-precision rate; up to four identical machines; the plan is also registered on OSF; the second launch's reproducibility check becomes a stated caveat.
- 12 Oct — the GPU. The study runs on NVIDIA A100 80GB.
- 21 Nov — AMD-20261121, after a third external review. The knowledge-vs-context token split becomes a confirmatory test (H6, family M3); the learning-rate check on the hybrids is added; the two launches are reported in separate papers; the plan discloses the odds of each verdict at different noise levels and records an abstract for each outcome before any result. No seeds were added.
Unchanged throughout: only the MLP weights are ternary (activations stay 16-bit), the model shape is Qwen3-0.6B, and the measurement code, fairness audit and checkpointing carry over. The eight hypotheses became H1–H6, the 27 research questions became RQ1–RQ5, and the main models went from two seeds to three. The only training so far is a reduced-width pilot on Apple silicon whose numbers are not comparable with the study's.
The models that are implemented but not trained — an interactive explorer, the full list, where the 27 old questions went, and the DeepSeek, attention-budget, multi-token-prediction and multimodal material
The secondary conditions
Parameter counts from scripts/show_param_budget.py at the 0.6B profile. Variants
with expert banks or hash tables are listed on their active count, with the stored total beside
it. Every one of these is implemented and CPU-tested, and none is run or reported.
| Variant | Mixer / residual | Params | Why it is outside | |
|---|---|---|---|---|
| E | ternary_mlp_hybrid | 24 Mamba-2 : 4 attention (Nemotron-H placement) | 595,193,984 | dropped 1 Oct; no Mamba-2 model is trained |
| F | ternary_mlp_hybrid_attnres | E + R1 bypass | 595,249,280 | |
| A_E | fp_hybrid | E's full-precision twin | 595,193,984 | |
| G | ternary_mlp_deepseek | sliding-window + CSA + HCA, Lightning Indexer (V4 legacy) | 599,065,600 | tier T3, removed 29 Sep |
| H | ternary_mlp_mamba_deepseek | Mamba-2 + CSA + HCA (V4 legacy) | 596,951,056 | |
| DS41-1 | ternary_mlp_ced | Causal Encoder-Decoder, shared global KV | 598,147,072 | tier T3 (DeepSeek-V4.1-Flash), removed 29 Sep |
| DS41-2 | ternary_mlp_csa2 | CSA2, flat indexer | 599,634,944 | |
| DS41-3 | ternary_mlp_ced_csa2 | CED + CSA2 | 601,969,664 | |
| DS41-4 | ternary_mlp_ced_csa2_hsi | CED + CSA2, hierarchical indexer | 601,969,664 | |
| DS41-5 | ternary_mlp_ced_csa2_mhcsp | CED + CSA2 + single-pass mHC | 607,476,200 | |
| DS41-6 | ternary_mlp_ds41_engram | softmax + Engram memory | 600,248,320 / 801,705,984 | |
| DS41-7 | ternary_mlp_ds41 | CED + CSA2 + Engram + single-pass mHC | 611,674,600 / 813,132,264 | |
| K3 | ternary_mlp_k3_situ | C's GDN-2 + Gated MLA, SiTU-GLU | 595,791,256 | tier T3 (Kimi K3), removed 29 Sep; now built on C |
| K3 | ternary_mlp_k3_core | + SiTU-GLU + Block AttnRes | 595,905,944 | |
| K3 | ternary_mlp_k3_latentmoe | + Stable LatentMoE | 595,919,768 / 935,326,616 | |
| Q38 | ternary_mlp_qwen_ngram | R0's GDN-2 + QSA, n-gram memory | 600,177,552 / 633,766,800 | tier T3 (Qwen3.8), removed 29 Sep |
| Q38 | ternary_mlp_qwen_core | + n-gram + Gated Residual | 674,724,752 / 708,314,000 | |
| Q38 | ternary_mlp_qwen_moe | + sparse MoE FFN | 674,954,128 / 1,501,266,832 | |
| N | ternary_mlp_mtp | R0 + Gated Residual + multi-token heads | 713,135,760 | tier T4, removed 29 Sep; changes the objective |
| O | ternary_mlp_learned_scale | B + per-channel scale after each ternary matmul | 596,250,624 | tier T3, removed 29 Sep |
| P | ternary_mlp_magact | B + grouped 8-bit activations | 596,049,920 | retired: the lesion is weight-only |
| Q | ternary_mlp_moe | softmax + top-2 MoE FFN | 596,279,296 / 1,389,002,752 | tier T3 (MoE), removed 29 Sep |
| R | ternary_mlp_gdn_moe | R0's mixer + top-2 MoE FFN | 598,307,728 / 1,391,031,184 |
Five v7 variants were deleted rather than kept: once GDN-2 replaced KDA, D became R1 on C, the KDA×QSA pair became R0 and R4 on R0, and the first two Kimi K3 arms became C and R4 on C — same switches, layer types, shapes and counts, and bit-identical initial weights.
Where the 27 v7 questions went
| v7 question | Now |
|---|---|
| RQ1 | RQ1 — confirmatory (F1, M1) |
| RQ2, RQ6 | RQ2 — confirmatory, as a difference-in-differences against each hybrid's twin (F2) |
| RQ3, RQ8 | RQ3 — exploratory, on H* in the R launch |
| RQ4 | RQ5 — descriptive carrier relocation and agreement between measures |
| RQ5 | descriptive: quality against analytic compute and measured memory |
| RQ12 | exploratory: B and C against R0, no verdict |
| RQ13, RQ14, RQ23 | exploratory route contrasts on H*: raw route effects, R1 against R2 and R3, R3 against R5 |
| RQ17 | not run — needs 8-bit activations |
| RQ7, RQ9, RQ10, RQ15, RQ16, RQ18–RQ22, RQ24, RQ25 | outside the study: their conditions are implemented, not trained |
| RQ11, RQ26, RQ27 | outside the study: attention capacity, FP4 KV caching, speculative decoding |
Where the borrowed mechanisms ended up
Sparse Attention · Gated Residual
QSA is R0's global layer, in the study. The Gated Residual is R2, in the R launch. The n-gram memory and the Qwen3.8 core and MoE models are implemented only.
Gated MLA · Attention Residuals
NoPE Gated MLA is C's global layer, in the study. Block AttnRes is R4, in the R launch. SiTU-GLU and Stable LatentMoE are implemented only.
mHC · CSA2 · CED · Engram
mHC is R3 and its single-pass sibling R5, in the R launch. The compressed-attention families (V4 legacy and V4.1-Flash) are implemented only.
Gated DeltaNet-2 · Mamba-2
GDN-2 is the recurrent half of both hybrids. The Nemotron-H Mamba-2 hybrid, delegated to NVIDIA's own mixer, is implemented only.
DeepSeek: a V4 legacy control and the V4.1-Flash family
Two DeepSeek branches were built and kept apart. The V4 legacy pair (G, H) keeps sliding-window + Compressed + Heavily-Compressed attention with a Lightning Indexer. The V4.1-Flash family (DS41-1…7) adds one mechanism at a time: CSA2, the Causal Encoder-Decoder (encoder layers, then decoder layers reading one shared global KV), the hierarchical sparse indexer, single-pass mHC and a research-scale Engram n-gram memory. Each CSA2 layer reads a local window at full resolution and a compressed global pool in one softmax, so it is not “attention over fewer tokens”.
Causality is structural: a compressed entry covering \([\text{start}, \text{end})\) is readable
only from token \(\text{end}-1\) on, and the indexer ranks after that mask, so its selection is
always a subset of what dense causal attention would see. None of V4.1-Flash's production scale
(MoE, a 196B Engram, 1M context, FP4/FP8 serving) is reproduced; the indexer's
index_q/index_k projections are named so the ternary conversion pass
never claims them.
The attention-budget sweep (v7's RQ11)
v7 asked whether a ternary model wants more dynamic sequence mixing than a full-precision one, and planned to answer it by moving one axis at a time: attention share (DS-25/50/75), then layer count with head geometry frozen, then head count at constant width, then placement and indexer budget. The generator still exists, on a Mamba-2 + CSA2 schedule; none of its points is trained.
Multi-token prediction, multimodality and the Phase-6 ablations
MTP (N) changes the training objective, so v7 treated it as two experiments — one on backbone quality, one on speculative-decoding acceptance — that must never share a table. N is implemented on R0 with the Gated Residual; the fairness audit treats an objective difference as a hard, non-declarable violation.
Multimodal integration was staged as four gates — a frozen vision encoder with a trainable projector, then a partially trainable adapter, then early-fusion tokens, then the best architecture multimodal — with vision parameters always reported apart. It was specified, never implemented. The Phase-6 ablations were a learned per-channel scale after each ternary matmul (O), grouped 8-bit activations (P, now retired), and a top-2 MoE FFN over ternary experts on softmax (Q) and on R0's mixer (R), compared on active parameters with the router never ternarized.
The v7 framing: reallocating the freed budget
v7's organising question was where the memory freed by ternary weights is best reinvested — more ternary parameters, dynamic retrieval, residual topology, prediction heads or experts. The final study narrows that to one measurable piece (does the mixer change the lesion's cost, and what do the residual routes buy beyond their parameters), but the arithmetic below is still why R0w is priced in parameters and its bytes are reported beside it.
The phased Azure scripts (a disposable smoke test, then core, extension and residual phases)
remain in the repo for reproducing the study elsewhere. They are not how the reported results are
produced; one driver, scripts/gpu/final_run.sh, runs both launches.