1. It runs
A shape, data-type or code-path conflict is recorded as a failed cell, not as a crash.
fdec, short for fight decode, is the knlp method for combining decode optimizations and showing that the combination is safe. Each optimization is a brick that reduces one pool of bytes a decode step reads. A brick counts only after it is measured together with every other brick, on text that no calibration step has seen.
A decode step on a GPU at low batch is limited by the bytes it moves, not by arithmetic. Those bytes are in separate pools: the decoder-block weights, the key/value (KV) cache and the output head. Each pool has its own best reducer, so no single technique wins decode. The useful result is a set of reducers that work together, with a measurement that shows they do not damage each other. One command runs that measurement.
Result: int8 weights, an asymmetric KV cache and a certified output head compose in all eight combinations on Qwen2.5-7B, Llama-3.2-3B and Qwen3-8B. Together they remove 40% to 46% of the bytes a decode step reads at a 32,768-token context, at a perplexity within 0.3% of the 16-bit model. The certified head returns the exact token in every cell. A trained cartridge composes with int8 weights and the asymmetric cache at a combined loss cost of 0.1%. Two earlier results did not survive stricter measurement: a published byte saving was in-sample, and the first matrix rounded attention scores to 16 bits. See the corrections.
For each generated token the GPU reads every weight in the decoder blocks once, reads the whole KV cache, and multiplies the hidden state against the output head. At low batch the arithmetic is small next to the memory traffic, so latency follows bytes read divided by memory bandwidth. The memory-traffic study gives the evidence for that.
Bytes read per decode step at a 32,768-token context, batch 1, from the byte model in the harness. The input embedding is left out because a step reads one row of it.
The KV share grows with context and with batch. The head share grows with vocabulary size. On Qwen2.5-7B the decoder blocks are 81% of the bytes; on Llama-3.2-3B they are 55% and the KV cache is 37%. A reducer for one pool has a ceiling set by that pool's share, so the stack needs one reducer per pool.
There are two kinds of optimization. Byte movement bricks reduce what a step reads: quantized weights, a quantized or shorter KV cache, a partial read of the head. Arithmetic intensity bricks do more useful work per byte read, for example a mixed-precision attention kernel that runs on Tensor Cores. The matrix on this page measures the byte movement bricks. Speed is a separate measurement.
| Brick | Pool | What it does | Result alone |
|---|---|---|---|
| int8 weights | Decoder blocks | Group-wise int8 for every linear layer, 128 weights per group, no calibration | 49% fewer block bytes, near-lossless (weight quantization study) |
| Asymmetric KV cache | KV cache | Keys stay 16-bit, values go to 8-bit floating point (FP8) by a direct cast | 25% fewer KV bytes (asymmetric quantization) |
| Certified output head | Output head | An int8 screen of the head gives an upper bound for every logit; the decoder then fetches only the rows that can still win | Exact argmax from 51% to 56% of the head (certified decode) |
| Trained cartridge | KV cache length | A trained KV prefix replaces a long document | A few hundred cache positions in place of the document (cartridges) |
The weight brick is int8 and not int4. The Fisher-sensitivity study that ranked which weights need more bits found int8 to be the point where quality holds without calibration. Int4 with activation-aware or second-order error compensation looked good on a six-prompt proxy and lost quality on a held-out evaluation, so it is not in the stack.
The KV brick keeps keys at 16 bits because keys are what break. Symmetric FP8 keys collapse on models with a large key bias (FP8 failure atlas).
Linear-attention models such as Gated DeltaNet, Mamba2 and RWKV remove the KV pool instead of shrinking it. They are a model class and not a brick. The KV and cartridge bricks do not apply to them, and the weight and head bricks are not yet measured on them.
A cell is one model with one subset of bricks enabled. The harness measures every subset, so three bricks give eight cells. A cell composes when three conditions hold.
A shape, data-type or code-path conflict is recorded as a failed cell, not as a crash.
The certified head must return the token that the full output head selects, computed in float32, at every evaluated position of that cell's own model. It is checked on hidden states that the other bricks have already changed.
The increase in log-perplexity of the cell must be within 0.01 of the sum of the increases of its bricks measured alone. A larger excess means the bricks amplify each other's error.
Quality is measured against the 16-bit model on WikiText-2 test: perplexity, top-1 agreement of the predicted token, and mean KL divergence. A brick that needs calibration takes it from WikiText-2 train.
Each run uses 8,192 evaluation tokens and 65,536 calibration tokens. "Bytes saved" is the reduction in bytes read per decode step at a 32,768-token context. "Head read" is the fraction of the dense output head that the certified decode reads, its int8 screen included. The three models were measured in bfloat16 on one Radeon Pro W7900 with PyTorch 2.9.1 and transformers 4.57.1, at knlp commit 0d5fe72b6 with the direct FP8 cast selected. That cast is the default since commit 4aa007a2c.
| All three bricks | Perplexity, 16-bit | Perplexity, stack | Top-1 agreement | Head read | Bytes saved |
|---|---|---|---|---|---|
| Qwen2.5-7B | 8.443 | 8.465 | 0.973 | 56.0% | 46.0% |
| Llama-3.2-3B | 11.811 | 11.828 | 0.980 | 51.4% | 40.2% |
| Qwen3-8B | 15.024 | 15.059 | 0.978 | 54.1% | 43.1% |
| Cell | Perplexity | Top-1 agreement | KL | Certificate exact | Head read | Bytes saved |
|---|---|---|---|---|---|---|
| none | 8.443 | 1.000 | 0.0000 | n/a | n/a | 0.0% |
| int8 weights | 8.449 | 0.976 | 0.0018 | n/a | n/a | 40.1% |
| asymmetric KV | 8.452 | 0.980 | 0.0018 | n/a | n/a | 2.9% |
| certified head | 8.443 | 1.000 | 0.0000 | yes | 55.9% | 3.0% |
| int8 weights + asymmetric KV | 8.465 | 0.973 | 0.0026 | n/a | n/a | 43.0% |
| int8 weights + certified head | 8.449 | 0.976 | 0.0018 | yes | 56.0% | 43.1% |
| asymmetric KV + certified head | 8.452 | 0.980 | 0.0018 | yes | 56.0% | 5.9% |
| all three | 8.465 | 0.973 | 0.0026 | yes | 56.0% | 46.0% |
| Cell | Perplexity | Top-1 agreement | KL | Certificate exact | Head read | Bytes saved |
|---|---|---|---|---|---|---|
| none | 11.811 | 1.000 | 0.0000 | n/a | n/a | 0.0% |
| int8 weights | 11.812 | 0.983 | 0.0013 | n/a | n/a | 27.2% |
| asymmetric KV | 11.822 | 0.981 | 0.0011 | n/a | n/a | 9.2% |
| certified head | 11.811 | 1.000 | 0.0000 | yes | 51.4% | 3.8% |
| int8 weights + asymmetric KV | 11.828 | 0.980 | 0.0018 | n/a | n/a | 36.5% |
| int8 weights + certified head | 11.812 | 0.983 | 0.0013 | yes | 51.4% | 31.0% |
| asymmetric KV + certified head | 11.822 | 0.981 | 0.0011 | yes | 51.4% | 13.0% |
| all three | 11.828 | 0.980 | 0.0018 | yes | 51.4% | 40.2% |
| Cell | Perplexity | Top-1 agreement | KL | Certificate exact | Head read | Bytes saved |
|---|---|---|---|---|---|---|
| none | 15.024 | 1.000 | 0.0000 | n/a | n/a | 0.0% |
| int8 weights | 15.048 | 0.980 | 0.0017 | n/a | n/a | 34.2% |
| asymmetric KV | 15.036 | 0.983 | 0.0013 | n/a | n/a | 6.0% |
| certified head | 15.024 | 1.000 | 0.0000 | yes | 54.1% | 2.9% |
| int8 weights + asymmetric KV | 15.059 | 0.978 | 0.0021 | n/a | n/a | 40.3% |
| int8 weights + certified head | 15.048 | 0.980 | 0.0017 | yes | 54.1% | 37.1% |
| asymmetric KV + certified head | 15.036 | 0.983 | 0.0013 | yes | 54.1% | 8.9% |
| all three | 15.059 | 0.978 | 0.0021 | yes | 54.1% | 43.1% |
The certified head is exact in every cell that has it, including the cells where int8 weights and FP8 values changed the hidden states it certifies. A screen built from the 16-bit model reads the same fraction of the head as one rebuilt for the quantized model, so the head artifact does not need a rebuild when the other bricks change.
The interaction term is at most 0.0008 in log-perplexity, which is inside the noise of an 8,192-token evaluation. Top-1 agreement is the more sensitive measure. Each brick alone changes about 2% of the predicted tokens, and the full stack changes 2% to 3%, while perplexity moves by at most 0.26%. The changed predictions are therefore near-ties. The next section checks what that does to answers.
The asymmetric cache casts each value to FP8 as it is. That is the default of the vLLM FP8 cache, so the cell computes what a serving engine computes. The first version of these tables divided each value tensor by one scale before the cast, which uses the whole FP8 range. With that scale the cells that contain the cache have a log-perplexity 0.0001 to 0.0012 lower and a top-1 agreement within 0.001, every cell composes, and the full stack is within 0.14% of the 16-bit perplexity. The cells without the cache are identical in the two runs. The per-tensor variant was measured on the W7900 and on one RTX 4090 with PyTorch 2.10, and the two GPUs agreed within 0.008 in perplexity and 0.002 in top-1 agreement in every cell. --kv-scale tensor selects it.
On Llama-3.2-3B and Qwen2.5-7B, int8 weights, the asymmetric cache and the two together leave task accuracy within the noise of the test. On Llama-3.2-3B, MMLU accuracy is 56.57% for the 16-bit model and 56.63% with both bricks, and GSM8K accuracy is 29.4% and 30.3%. On Qwen2.5-7B, MMLU accuracy is 74.25% and 74.18%, and GSM8K accuracy is 81.4% and 80.5%. Every paired interval contains zero. The Qwen3-8B runs are not finished.
Perplexity and top-1 agreement are measured on running text. The task check asks what a user asks: does a model with int8 weights, the asymmetric cache, or both, answer as many questions correctly as the 16-bit model? fdec_task_acc.py scores every cell on the same items, so each comparison is paired.
GSM8K is 1,319 grade-school math problems. The prompt holds eight worked examples, decoding is greedy, and an answer is correct when the first number after the answer marker equals the reference. A completion with no answer marker counts as wrong. MMLU is 14,042 four-choice questions with five examples per subject; the answer is the choice letter with the largest logit. The certified head returns the largest float32 logit, and the other cells take the largest 16-bit logit, so the two can differ where the two largest logits tie within the 16-bit rounding step. A certified-head cell computes the logits of the last position in float32, which is the token the certificate returns. So far it is measured for Qwen2.5-7B on GSM8K. The asymmetric KV cells in these tables scale each value tensor before the FP8 cast; the runs with the direct cast are not finished. The matrix shows that the two differ by at most 0.001 in top-1 agreement.
All runs are in bfloat16 at knlp commit dd3a68306; the certified-head cell is at 0d5fe72b6. Llama-3.2-3B and the MMLU run of Qwen2.5-7B ran on one RTX 4090 with PyTorch 2.10 and transformers 5.3.0. The GSM8K run of Qwen2.5-7B used one Radeon Pro W7900 with PyTorch 2.9.1 and transformers 4.57.1. The 16-bit references are close to the published scores of the models. The MMLU accuracy of Llama-3.2-3B averaged over the 57 subjects is 57.95%, and its model card reports 58 with five examples. Qwen2.5-7B answers 74.25% of the MMLU items, or 75.46% averaged over the subjects, and the Qwen2.5 report gives 74.2 with five examples. It solves 81.4% of GSM8K with the eight examples used here; the report gives 85.4% with four examples of its own.
| Task | Cell | Accuracy | Difference, points | 95% interval | Lost | Gained | p |
|---|---|---|---|---|---|---|---|
| GSM8K, 1,319 items | 16-bit model | 81.43% | reference | ||||
| GSM8K, 1,319 items | int8 weights | 80.52% | -0.91 | -2.13 to +0.31 | 40 | 28 | 0.18 |
| GSM8K, 1,319 items | asymmetric KV | 80.82% | -0.61 | -1.92 to +0.71 | 43 | 35 | 0.43 |
| GSM8K, 1,319 items | certified head | 80.52% | -0.91 | -2.02 to +0.20 | 34 | 22 | 0.14 |
| GSM8K, 1,319 items | int8 weights + asymmetric KV | 80.52% | -0.91 | -2.22 to +0.40 | 45 | 33 | 0.21 |
| MMLU, 14,042 items | 16-bit model | 74.25% | reference | ||||
| MMLU, 14,042 items | int8 weights | 74.12% | -0.13 | -0.31 to +0.05 | 95 | 77 | 0.19 |
| MMLU, 14,042 items | asymmetric KV | 74.11% | -0.14 | -0.31 to +0.03 | 83 | 63 | 0.12 |
| MMLU, 14,042 items | int8 weights + asymmetric KV | 74.18% | -0.07 | -0.25 to +0.11 | 91 | 81 | 0.49 |
| Task | Cell | Accuracy | Difference, points | 95% interval | Lost | Gained | p |
|---|---|---|---|---|---|---|---|
| GSM8K, 1,319 items | 16-bit model | 29.42% | reference | ||||
| GSM8K, 1,319 items | int8 weights | 29.72% | +0.30 | -0.97 to +1.58 | 35 | 39 | 0.73 |
| GSM8K, 1,319 items | asymmetric KV | 28.89% | -0.53 | -1.82 to +0.76 | 41 | 34 | 0.49 |
| GSM8K, 1,319 items | int8 weights + asymmetric KV | 30.33% | +0.91 | -0.47 to +2.29 | 37 | 49 | 0.24 |
| MMLU, 14,042 items | 16-bit model | 56.57% | reference | ||||
| MMLU, 14,042 items | int8 weights | 56.57% | +0.01 | -0.25 to +0.27 | 172 | 173 | 1.00 |
| MMLU, 14,042 items | asymmetric KV | 56.52% | -0.05 | -0.31 to +0.21 | 174 | 167 | 0.75 |
| MMLU, 14,042 items | int8 weights + asymmetric KV | 56.63% | +0.06 | -0.22 to +0.35 | 204 | 213 | 0.70 |
"Lost" counts the items that the 16-bit model answers correctly and the cell does not; "gained" counts the reverse. The interval is the 95% interval of the paired difference in accuracy points. The p-value is the exact McNemar test on the lost and gained counts. The models are the base models, not the instruction-tuned ones, so the accuracy level is lower than chat-model reports.
The bricks do change single answers. Against the 16-bit model, 2.4% to 3.0% of the MMLU items flip on Llama-3.2-3B and 1.0% to 1.2% on Qwen2.5-7B, and 5.2% to 6.5% of the GSM8K problems flip. The flips go both ways in almost equal numbers, which is what a small perturbation does to items that the model answers by a narrow margin.
The test resolves about 0.2 to 0.3 points on MMLU and 1.4 points on GSM8K; a smaller effect would not show. On Qwen2.5-7B all six differences are negative: 0.07 to 0.14 points on MMLU and 0.6 to 0.9 points on GSM8K. None is significant, and for the two bricks together the test cannot exclude a loss of 0.25 points on MMLU and 2.2 points on GSM8K. On Llama-3.2-3B the differences have both signs.
The certified-head cell is a control for these numbers. It changes no weight and no cached value; it only breaks ties between logits with exact arithmetic. On Qwen2.5-7B it changes 4.2% of the GSM8K answers (56 of 1,319), and its accuracy is 0.9 points below the 16-bit cell, with p 0.14. That is the same difference as int8 weights, and the bricks change 5.2% to 5.9% of the answers. One changed token can change the rest of a greedy completion, so on GSM8K the differences of the bricks cannot be told apart from the effect of a tie-break change.
The bricks also compose on task accuracy. The table gives the change of the pair minus the sum of the two single changes. Every interval contains zero.
| Model | Task | Pair minus sum of singles, points | 95% interval |
|---|---|---|---|
| Llama-3.2-3B | MMLU | +0.11 | −0.26 to +0.47 |
| Llama-3.2-3B | GSM8K | +1.14 | −0.61 to +2.89 |
| Qwen2.5-7B | MMLU | +0.20 | −0.04 to +0.44 |
| Qwen2.5-7B | GSM8K | +0.61 | −1.09 to +2.30 |
A cartridge is a KV prefix trained so that a frozen model answers questions about a document without reading it. It shortens the KV cache, so it is a byte movement brick for the KV pool. It was trained against the 16-bit model, which raises two questions. Does it survive a reader with int8 weights? Does it survive storage with FP8 values?
The test scores two Qwen3-8B cartridges, trained on two patient records from the LongHealth benchmark, on 256 training conversations each. The score is the trainer's own distillation loss against a teacher that reads the full document. The same cartridge is read in each way, so the comparison is paired. The stored values use FP8 with one scale per tensor.
| Reader weights | Cartridge storage | Loss, patient 1 | Loss, patient 2 |
|---|---|---|---|
| 16-bit | 16-bit keys and values | 0.015102 | 0.016170 |
| int8 | 16-bit keys and values | 0.015111 (+0.06%) | 0.016181 (+0.07%) |
| 16-bit | 16-bit keys, FP8 values | 0.015106 (+0.03%) | 0.016177 (+0.04%) |
| int8 | 16-bit keys, FP8 values | 0.015116 (+0.09%) | 0.016188 (+0.11%) |
| int8 | FP8 keys and values | 0.015307 (+1.36%) | 0.016357 (+1.16%) |
| 16-bit, no cartridge | none | 0.043067 | 0.045057 |
The cost of both bricks together equals the sum of the two costs alone, so they compose. The loss without a cartridge is 2.8 times higher, so the cartridge keeps its value under int8 weights. Symmetric FP8 keys still cost more than 1%, the same penalty that the cartridge quantization study found with a 16-bit reader.
These cartridges saw the scored conversations during training, so the loss level is in-sample. The paired differences between readings do not depend on that. The certified head is exact for any hidden state, so it needs no separate cartridge test.
Each stricter measurement on this page found an error in an earlier result. Both corrections are recorded here, because they are the reason for the rules of the method.
The certified output head bounds every logit with a low-rank shadow of the head, plus a residual term for the part of the hidden state outside the shadow's basis. The earlier measurement built a rank-1280 basis from the same 600 to 1,500 hidden states that it then scored. A basis fitted to so few states contains them, so the residual was near zero and the decoder read about a quarter of the head.
The first held-out run of the matrix built the basis from 65,408 train positions and scored 8,176 test positions. The same certificate then opened every vocabulary block and read 118% of the dense head. The token was exact in both cases. Only the byte count was wrong, and only a held-out measurement could show it.
| Shadow rank, Qwen2.5-7B (hidden size 3584) | Head read, held-out | Head read, in-sample | Exact |
|---|---|---|---|
| 1279 | 117.8% | 24.7% | 1.000 |
| 2688 | 130.1% | 42.6% | 1.000 |
| 3226 | 97.0% | 51.1% | 1.000 |
| 3405 | 70.6% | 54.0% | 1.000 |
| 3584 (full rank) | 56.0% | 56.9% | 1.000 |
The saving returns near full rank. There the method is an int8 screen of the whole head, followed by an exact fetch of 1% to 6% of the rows. That configuration reads 51% to 56% of the head on unseen text, and it is the one the matrix uses. The certified decode page has the full sweep. This is the reason for the rule that a brick counts only after the matrix measures it held-out and in combination.
The first version of this matrix gave the 16-bit Qwen2.5-7B model a perplexity of 9.84. The correct value is 8.44. The task-accuracy run exposed the error: the same 16-bit model solved only 18% of the GSM8K problems.
The harness replaces the attention function of the model, because the asymmetric cache changes how values are read. For the unmodified model it called the plain attention function of the transformers library. That function rounds the query-key scores to the model data type before the softmax. A 16-bit float (bfloat16) keeps 8 significant bits, so a score near 700 moves in steps of 4. Qwen2.5-7B has a mean absolute score of 713 in its last layer, and the rounding moves a score there by 1.4 on average. A fused attention kernel accumulates the scores in float32 and does not have this error. The fused kernel is the default path of the library and of a serving engine.
| Attention arithmetic, 16-bit Qwen2.5-7B | Perplexity | GSM8K problems solved, of 32 |
|---|---|---|
| Fused kernel, the library default | 7.462 | 24 |
| Plain function, scores rounded to 16 bits | 8.843 | 7 |
| float32 scores and value sum, 16-bit output | 7.463 | 25 |
WikiText-2 test, 8 sequences of 512 tokens, and the first 32 GSM8K test problems, on one RTX 4090. The same check on one Radeon Pro W7900 gives 7.459, 8.801 and 7.459, and 25, 7 and 25 problems. The last row is what every cell of the matrix uses now.
Llama-3.2-3B and Qwen3-8B have attention scores below 50, and the three paths agree within 0.03 in perplexity on both. Every cell now computes attention with float32 scores and a float32 value sum, the 16-bit model included. The asymmetric cache cell therefore differs from its reference only in the precision of the values. All three models were measured again. Llama-3.2-3B and Qwen3-8B moved by less than 0.03 in perplexity. Qwen2.5-7B changed in two ways. Its 16-bit perplexity is 8.44 and not 9.84. And it is no longer the weakest model: the first matrix showed int8 weights changing 8.3% of its predicted tokens, and with correct attention they change 2.4%, close to the 1.7% and 2.0% of the other two models. With scores rounded to 16 bits, a small change to the model moves many scores across a rounding step, which is the likely source of the 8.3%.
The matrix shows that the bricks agree in what they compute. Speed needs each brick in a real kernel. Two measurements exist: two bricks together in a serving engine, and the certified head alone against the dense head.
Packed int4 weights and the asymmetric K16/V8 cache ran in one vLLM and FlashInfer process on Qwen3-8B, with 8,192 input tokens at batch 32 on one H100. Request throughput was 3.45% higher than the same weights with a 16-bit cache, and the tested quality checks passed. With dense 16-bit weights the same cache change gave 3.55%. The cache brick therefore keeps its gain when the weights are packed. The asymmetric KV results give the controls.
That measurement counts whole requests, and an 8,192-token prompt with 128 output tokens is mostly prefill. It does not test the decode byte model on this page. The weights in it are int4 and not the int8 of the matrix.
On hidden states it has not seen, the certified head runs at 0.99 to 1.28 times the speed of the dense head in the mean, and on three of the four models its 95th-percentile token takes about 1.8 times as long. The earlier figures of 1.97 and 1.85 times came from the in-sample shadow and do not describe a deployed head.
fdec_cert_latency.py builds the full-rank shadow from WikiText-2 train hidden states. It then times 1,000 WikiText-2 test positions, one token at a time, against the dense 16-bit head on the same GPU. The timed variant makes one fused fetch of the vocabulary blocks with the highest bounds, then checks the certificate once. A token that does not certify falls back to the dense head.
| Model | GPU | Dense head, mean | Certified head, mean | Speed, mean | Speed, median | 95th percentile, dense → certified | Fetch | Certified | Head read |
|---|---|---|---|---|---|---|---|---|---|
| Qwen2.5-7B | RTX 4090 | 1.166 ms | 1.087 ms | 1.07× | 1.23× | 1.17 → 2.11 ms | 12.5% | 88.0% | 73.1% |
| Llama-3.2-3B | RTX 4090 | 0.867 ms | 0.678 ms | 1.28× | 1.30× | 0.87 → 0.67 ms | 6.25% | 98.6% | 57.6% |
| Qwen3-8B | Radeon Pro W7900 | 2.002 ms | 1.978 ms | 1.01× | 1.16× | 2.01 → 3.68 ms | 12.5% | 87.5% | 73.5% |
| Qwen2.5-0.5B | RTX 4090 | 0.311 ms | 0.315 ms | 0.99× | 1.04× | 0.31 → 0.58 ms | 12.5% | 95.0% | 67.1% |
Time per token for the output head only, batch 1, 1,000 held-out tokens per model. "Fetch" is the share of vocabulary blocks opened in the one fused fetch; the table shows the fastest of three budgets. "Certified" is the share of tokens that did not need the dense fallback. "Head read" counts the int8 screen, the fetched rows, and the whole head for a token that fell back.
The variant that reads the fewest bytes is not the fastest. Opening one block at a time until the certificate closes reads 51% to 56% of the head, which is the figure in the matrix. Its mean speed is only 0.72 to 1.16 times the dense head, because each block costs a kernel launch. A dense head at batch 1 takes 0.3 to 2 ms, so there is little time to win, and a token that falls back pays for the screen and for the dense product.
The script repeats the in-sample setup on the same GPU. There the fused variant is 1.56 to 1.78 times faster in the mean on the three larger models. That reproduces the size of the earlier figures, so the difference is the shadow and not the kernel.
"Exact" on this page means equal to the argmax of float32 logits. The block-by-block variant certified every token and returned that argmax for every token on all four models. The dense 16-bit head rounds its logits to 8 significant bits, which makes ties among the top tokens: it returned the float32 argmax on 94.8% to 98.6% of the tokens.
# Qwen2.5-7B and Llama-3.2-3B, all eight cells each
make defconfig-fdec
make
# the same eight cells on Qwen2.5-0.5B on the CPU, under three minutes
make defconfig-fdec-smoke
make
# optional: GSM8K and MMLU for the same bricks, hours per model on one GPU
make fdec-tasks
make fdec-report
make runs scripts/fdec_compose.py once per model. It writes one result file per model and a REPORT.md table under results/fdec, and it exits non-zero if any cell does not compose. A model with a result file is skipped, so an interrupted run resumes. The 7B model needs a GPU with 24 GiB of memory; each model takes two to five minutes. The smoke configuration checks the harness, not the numbers: its calibration set is small.
make fdec-tasks runs scripts/fdec_task_acc.py once per model: GSM8K and MMLU for the 16-bit model, each enabled brick alone and the stack, on the same items. It is not part of the default target, because it takes about four hours for the 3B model on one RTX 4090. make fdec-report then adds the task tables to the report and fails if a cell is significantly below the 16-bit model. The test is the exact McNemar test on the items that changed, with a Bonferroni correction over the cells of one model and task, at 0.05.
The options are in Kconfig.fdec. CONFIG_FDEC_MODELS takes a space-separated list of Hugging Face model names. Each brick has its own switch, and the harness measures every subset of the enabled bricks.
| Tool | What it measures |
|---|---|
fdec_compose.py | The composition matrix: every subset of bricks, on held-out text |
fdec_task_acc.py | Paired task accuracy: GSM8K and MMLU on the same items for every cell |
fdec_cert_heldout.py | Bytes the certified head reads against shadow rank, held-out and in-sample |
fdec_attn_precision.py | Whether 16-bit attention scores degrade a model: perplexity, a GSM8K sample and the score error per layer |
fdec_cert_latency.py | Time per token of the certified head against the dense head |
cas_cart_loss.py with W8=1 | A trained cartridge read by a model with int8 weights |
A new brick enters the stack in four steps. State the byte pool it reduces and its result alone on a held-out evaluation. Add it to fdec_compose.py, either as a transform that changes the model or its attention, or as a measurement that checks an exactness claim on the changed model. Add its factor to the byte model. Then run the matrix. The brick is in when every cell that contains it composes on at least two model families.
The matrix emulates the bricks in PyTorch. Weights are rounded in place, values pass through a direct FP8 cast, attention runs with float32 arithmetic, and the certified decode is replayed against float32 logits. This shows that the bricks do not conflict in what they compute. It does not measure speed, and "bytes saved" is a model of bytes read, not a latency.
The perplexity evaluation is WikiText-2 only, on 8,192 tokens per model. The task check covers Llama-3.2-3B and Qwen2.5-7B so far, and its certified-head cell is measured for one model and one task. The cartridge cells cover one model and two documents, and their loss level is in-sample. Linear-attention models are not in the matrix. No single serving engine runs all four bricks today.