Decode · composition of optimizations · November 2026

fdec: decode optimizations, measured together.

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.

24 of 24 cells compose on three modelsHeld-out text for every numberOne defconfig, one makeQuality and bytes, not a served latency

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.

01 / Why several bricks

Three byte pools, and no pool has a fixed share.

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, by pool, before and after the three bricksQwen2.5-7B 16-bit 16.0 GB; Qwen2.5-7B all three bricks 8.6 GB; Llama-3.2-3B 16-bit 10.2 GB; Llama-3.2-3B all three bricks 6.1 GB; Qwen3-8B 16-bit 20.0 GB; Qwen3-8B all three bricks 11.4 GB.0 GB5 GB10 GB15 GB20 GBQwen2.5-7B16-bit16.0 GBall three bricks8.6 GBLlama-3.2-3B16-bit10.2 GBall three bricks6.1 GBQwen3-8B16-bit20.0 GBall three bricks11.4 GB

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.

02 / The bricks

One reducer per pool.

BrickPoolWhat it doesResult alone
int8 weightsDecoder blocksGroup-wise int8 for every linear layer, 128 weights per group, no calibration49% fewer block bytes, near-lossless (weight quantization study)
Asymmetric KV cacheKV cacheKeys stay 16-bit, values go to 8-bit floating point (FP8) by a direct cast25% fewer KV bytes (asymmetric quantization)
Certified output headOutput headAn int8 screen of the head gives an upper bound for every logit; the decoder then fetches only the rows that can still winExact argmax from 51% to 56% of the head (certified decode)
Trained cartridgeKV cache lengthA trained KV prefix replaces a long documentA 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.

03 / The rule

What "composes" means.

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.

1. It runs

A shape, data-type or code-path conflict is recorded as a failed cell, not as a crash.

2. Exactness claims still hold

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.

3. Quality costs add

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.

Held-out text only

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.

04 / The measured matrix

All 24 cells compose.

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 bricksPerplexity, 16-bitPerplexity, stackTop-1 agreementHead readBytes saved
Qwen2.5-7B8.4438.4650.97356.0%46.0%
Llama-3.2-3B11.81111.8280.98051.4%40.2%
Qwen3-8B15.02415.0590.97854.1%43.1%

Qwen2.5-7B

CellPerplexityTop-1 agreementKLCertificate exactHead readBytes saved
none8.4431.0000.0000n/an/a0.0%
int8 weights8.4490.9760.0018n/an/a40.1%
asymmetric KV8.4520.9800.0018n/an/a2.9%
certified head8.4431.0000.0000yes55.9%3.0%
int8 weights + asymmetric KV8.4650.9730.0026n/an/a43.0%
int8 weights + certified head8.4490.9760.0018yes56.0%43.1%
asymmetric KV + certified head8.4520.9800.0018yes56.0%5.9%
all three8.4650.9730.0026yes56.0%46.0%

Llama-3.2-3B

CellPerplexityTop-1 agreementKLCertificate exactHead readBytes saved
none11.8111.0000.0000n/an/a0.0%
int8 weights11.8120.9830.0013n/an/a27.2%
asymmetric KV11.8220.9810.0011n/an/a9.2%
certified head11.8111.0000.0000yes51.4%3.8%
int8 weights + asymmetric KV11.8280.9800.0018n/an/a36.5%
int8 weights + certified head11.8120.9830.0013yes51.4%31.0%
asymmetric KV + certified head11.8220.9810.0011yes51.4%13.0%
all three11.8280.9800.0018yes51.4%40.2%

Qwen3-8B

CellPerplexityTop-1 agreementKLCertificate exactHead readBytes saved
none15.0241.0000.0000n/an/a0.0%
int8 weights15.0480.9800.0017n/an/a34.2%
asymmetric KV15.0360.9830.0013n/an/a6.0%
certified head15.0241.0000.0000yes54.1%2.9%
int8 weights + asymmetric KV15.0590.9780.0021n/an/a40.3%
int8 weights + certified head15.0480.9800.0017yes54.1%37.1%
asymmetric KV + certified head15.0360.9830.0013yes54.1%8.9%
all three15.0590.9780.0021yes54.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 FP8 cast of the values

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.

05 / Task accuracy

Do the bricks change answers?

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.

Qwen2.5-7B

TaskCellAccuracyDifference, points95% intervalLostGainedp
GSM8K, 1,319 items16-bit model81.43%reference
GSM8K, 1,319 itemsint8 weights80.52%-0.91-2.13 to +0.3140280.18
GSM8K, 1,319 itemsasymmetric KV80.82%-0.61-1.92 to +0.7143350.43
GSM8K, 1,319 itemscertified head80.52%-0.91-2.02 to +0.2034220.14
GSM8K, 1,319 itemsint8 weights + asymmetric KV80.52%-0.91-2.22 to +0.4045330.21
MMLU, 14,042 items16-bit model74.25%reference
MMLU, 14,042 itemsint8 weights74.12%-0.13-0.31 to +0.0595770.19
MMLU, 14,042 itemsasymmetric KV74.11%-0.14-0.31 to +0.0383630.12
MMLU, 14,042 itemsint8 weights + asymmetric KV74.18%-0.07-0.25 to +0.1191810.49

Llama-3.2-3B

TaskCellAccuracyDifference, points95% intervalLostGainedp
GSM8K, 1,319 items16-bit model29.42%reference
GSM8K, 1,319 itemsint8 weights29.72%+0.30-0.97 to +1.5835390.73
GSM8K, 1,319 itemsasymmetric KV28.89%-0.53-1.82 to +0.7641340.49
GSM8K, 1,319 itemsint8 weights + asymmetric KV30.33%+0.91-0.47 to +2.2937490.24
MMLU, 14,042 items16-bit model56.57%reference
MMLU, 14,042 itemsint8 weights56.57%+0.01-0.25 to +0.271721731.00
MMLU, 14,042 itemsasymmetric KV56.52%-0.05-0.31 to +0.211741670.75
MMLU, 14,042 itemsint8 weights + asymmetric KV56.63%+0.06-0.22 to +0.352042130.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.

ModelTaskPair minus sum of singles, points95% interval
Llama-3.2-3BMMLU+0.11−0.26 to +0.47
Llama-3.2-3BGSM8K+1.14−0.61 to +2.89
Qwen2.5-7BMMLU+0.20−0.04 to +0.44
Qwen2.5-7BGSM8K+0.61−1.09 to +2.30
06 / Cartridges as a brick

A trained cartridge survives a quantized reader and quantized storage.

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 weightsCartridge storageLoss, patient 1Loss, patient 2
16-bit16-bit keys and values0.0151020.016170
int816-bit keys and values0.015111 (+0.06%)0.016181 (+0.07%)
16-bit16-bit keys, FP8 values0.015106 (+0.03%)0.016177 (+0.04%)
int816-bit keys, FP8 values0.015116 (+0.09%)0.016188 (+0.11%)
int8FP8 keys and values0.015307 (+1.36%)0.016357 (+1.16%)
16-bit, no cartridgenone0.0430670.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.

07 / What the measurements corrected

Two results did not survive a stricter measurement.

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.

A published byte saving was in-sample

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-outHead read, in-sampleExact
1279117.8%24.7%1.000
2688130.1%42.6%1.000
322697.0%51.1%1.000
340570.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 matrix rounded attention scores to 16 bits

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-7BPerplexityGSM8K problems solved, of 32
Fused kernel, the library default7.46224
Plain function, scores rounded to 16 bits8.8437
float32 scores and value sum, 16-bit output7.46325

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%.

08 / Speed

What has been timed so far.

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.

Two bricks in one serving engine

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.

The certified head on unseen hidden states

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.

ModelGPUDense head, meanCertified head, meanSpeed, meanSpeed, median95th percentile, dense → certifiedFetchCertifiedHead read
Qwen2.5-7BRTX 40901.166 ms1.087 ms1.07×1.23×1.17 → 2.11 ms12.5%88.0%73.1%
Llama-3.2-3BRTX 40900.867 ms0.678 ms1.28×1.30×0.87 → 0.67 ms6.25%98.6%57.6%
Qwen3-8BRadeon Pro W79002.002 ms1.978 ms1.01×1.16×2.01 → 3.68 ms12.5%87.5%73.5%
Qwen2.5-0.5BRTX 40900.311 ms0.315 ms0.99×1.04×0.31 → 0.58 ms12.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.

09 / Run it

One defconfig runs the matrix.

# 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.

ToolWhat it measures
fdec_compose.pyThe composition matrix: every subset of bricks, on held-out text
fdec_task_acc.pyPaired task accuracy: GSM8K and MMLU on the same items for every cell
fdec_cert_heldout.pyBytes the certified head reads against shadow rank, held-out and in-sample
fdec_attn_precision.pyWhether 16-bit attention scores degrade a model: perplexity, a GSM8K sample and the score error per layer
fdec_cert_latency.pyTime per token of the certified head against the dense head
cas_cart_loss.py with W8=1A trained cartridge read by a model with int8 weights

Adding a brick

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.

10 / Limits

What these results do not show.

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.