When training a key-value prefix is worth it. One reader, one document panel, one sampler. A trained cartridge and a scored store of the document's own key-value cells were compared at equal bytes per record, with the build cost of each.
Cartridges (arXiv:2506.06266) · Cartridges at Scale (arXiv:2606.04557) · KVzip (arXiv:2505.23416) · Fast KVzip (arXiv:2601.17668) · KVzap (arXiv:2601.07891) · Cartridges on knlp.io
At equal bytes per record, a scored store matches a trained cartridge on this panel, on both readers tested. Above equal bytes the store leads: from 0.77 of the cartridge's bytes on Qwen3-8B, from 0.5 on Qwen3-14B, where at 0.77 it also matches the whole record. The store costs seconds to build. The cartridge costs hours: on Qwen3-14B, measured end to end, 4.8 to 5.1 H100 hours per record against 22 to 35 H100 seconds, about 700 times more. On this panel the cartridge is worth training only when bytes per record must stay below about 0.385 of a recipe-sized cartridge, a region where no cartridge was trained and the store falls off, or when its build cost amortizes over very many reads.
Two ways to stand in for a long document were compared. A trained cartridge is a learned key-value (KV) prefix that replaces the document at read time. It follows Cartridges with the recipe from Cartridges at Scale. A scored store is a selection of the document's own KV cells. The reader prefills the document once, a scorer rates every cell, and the store keeps the best cells per attention head. The scorers follow KVzip (the repeat-pass scorer), the KVzip+ scorer, the Fast KVzip gate, and the KVzap head.
Both were measured on two readers, Qwen3-8B and Qwen3-14B, and one panel: LongHealth, four patient records, 20 questions per record, 80 questions in all. Sections 2 to 5 give the 8B numbers; section 8 gives the 14B numbers, where every build stage was timed. Each question was sampled six times with thinking on, a 4,096-token cap, temperature 0.6, top-k 20 and top-p 0.95. The score is the mean over 80 questions and six runs.
The readings in detail:
Decision rule. A result is above or below only when the exact two-sided sign test over 80 questions gives p<0.05 and the 95% bootstrap interval over the difference excludes 0. Everything else is reported as no decision. Section 6 gives the readout rule.
Bytes are for patient record 01. The score is the mean of 80 questions times six runs. "Fraction" is the share of the 16-bit cartridge's bytes (90.7 MB) that the arm keeps. Two training seeds (42 and 43) were run for the cartridge arms.
| Arm | Fraction | Bytes per record | Score | Note |
|---|---|---|---|---|
| Anchors | ||||
| No record | 0 | 0 B | 0.417 | Reader answers from the question alone. |
| Whole record | 19.96 | 1.81 GB | 0.875 | Full prefill, every KV cell kept at 16 bits. |
| Trained cartridges | ||||
| Cartridge 16-bit, fitted start, seed 42 | 1.00 | 90.7 MB | 0.719 | Recipe cartridge, 615 rows. |
| Cartridge 16-bit, fitted start, seed 43 | 1.00 | 90.7 MB | 0.733 | Seed spread +0.014, no decision. |
| Cartridge 16-bit, native start | 1.00 | 90.7 MB | 0.700 | Start from the first tokens, no local fit. |
| Coded cartridge, seed 42 | 0.385 | 35.0 MB | 0.710 | 8-bit keys, 4-bit values. Coder costs -0.008, no decision. |
| Coded cartridge, seed 43 | 0.385 | 35.0 MB | 0.721 | Coder costs +0.012 here, no decision. |
| Scored stores, coded like the cartridge | ||||
| Store, KVzip+ scorer | 0.385 | 34.5 MB | 0.690 | Ties the coded cartridge. Keeps 3.8% of cells. |
| Store, repeat-pass scorer (KVzip) | 0.385 | 34.5 MB | 0.698 | |
| Store, KVzip+ scorer | 0.5 | 44.7 MB | 0.752 | +0.033 over the 16-bit cartridge, no decision. |
| Store, repeat-pass scorer (KVzip) | 0.5 | 44.7 MB | 0.723 | |
| Store, KVzip+ scorer | 0.77 | 68.8 MB | 0.819 | +0.10 over the 16-bit cartridge, above (p<0.01). |
| Store, repeat-pass scorer (KVzip) | 0.77 | 68.8 MB | 0.773 | KVzip+ leads repeat by +0.046. |
| Store, 16-bit cells, no coder | 0.77 | 68.8 MB | 0.773 | Fewer cells at 16 bits instead of more cells coded. |
| Cheaper scorers | ||||
| Fast KVzip gate, 2% window | 0.385 | 34.5 MB | 0.369 | Below the no-record anchor. |
| Fast KVzip gate, 2% window | 0.77 | 68.8 MB | 0.615 | |
| Fast KVzip gate, no window | 0.385 | 34.5 MB | 0.573 | +0.204 over the windowed gate (p 0.0013), still below KVzip+. |
| Fast KVzip gate, no window | 0.77 | 68.8 MB | 0.762 | |
| KVzap head, with window | 0.385 / 0.77 | 34.5 / 68.8 MB | below KVzip+ | Lower than the KVzip+ store at both budgets. |
Qwen3-8B uses grouped-query attention (GQA) with 8 KV heads of width 128 in each of 36 layers. One KV row (one token position, all layers, keys and values, bf16) is 36 × 8 × 128 × 2 × 2 = 147,456 bytes. Patient record 01 prefills to 12,274 rows, so the whole record is 1.81 GB. The cartridge has 615 rows: one sink row plus the first ceil(12,274 / 20) = 614 token rows as the start. The store at 0.385 keeps 134,784 of the record's 3,534,912 cells (one cell is one row in one head in one layer), which is 3.8%. The store also keeps 54 template rows at 16 bits, 7.96 MB, inside its byte budget.
The two store lines climb with bytes. The cartridge sits at one byte size, 90.7 MB, and its coded form at 35.0 MB. At 35 MB the coded cartridge and the store share the same score band. From 45 MB up the KVzip+ store is at or above the 16-bit cartridge while it uses fewer bytes.
Each row compares arm A against arm B on the same 80 questions. The difference is A minus B in mean score. The decision follows the readout rule in section 6.
| A | B | Difference | Decision |
|---|---|---|---|
| Store KVzip+ at 0.385 | Coded cartridge at 0.385 | within +0.03 / -0.02 | no decision (tie at equal bytes) |
| Store KVzip+ at 0.5 | Cartridge 16-bit | +0.033 | no decision (match) |
| Store KVzip+ at 0.77 | Cartridge 16-bit | +0.10 | above, p<0.01 |
| Store KVzip+ at 0.77 | Store repeat at 0.77 | +0.046 | KVzip+ leads |
| Fast KVzip gate, no window, 0.385 | Fast KVzip gate, 2% window, 0.385 | +0.204 | above, p 0.0013; still below KVzip+ |
| Cartridge seed 43 | Cartridge seed 42 | +0.014 | no decision (seed spread) |
| Coded cartridge | Cartridge 16-bit, same seed | -0.008 / +0.012 | no decision (coder is free) |
| Cartridge, fitted start | Cartridge, native start | +0.019 | no decision |
Three readings matter for the decision. The tie at equal bytes means the training did not buy quality that the store cannot select. The +0.10 lead at 0.77 means more of the record's own cells beat a learned prefix once the budget allows them. The seed spread, coder cost and start difference are all inside the no-decision band, so the cartridge result is not an unlucky seed or a coder artifact.
All times are measured unless marked as an estimate. The cartridge pipeline has three parts: synthesis, a fitted start, and training. The store pipeline has one part: a prefill plus scoring.
| Part | Work | Time | Device |
|---|---|---|---|
| Cartridge | |||
| Synthesis | About 3,250 to 4,420 answered questions per record. Questions written by a 70B model. Answers and top-20 log-probabilities by the reader through vLLM. | 38.5 min on four H100 for 15,500 answers (2.5 GPU h; 0.5 to 0.7 GPU h per record), measured on Qwen3-14B | H100 |
| Fitted start | Teacher capture, then a local key-value fit on 192 held conversations. | 5 to 14 min + 5 to 6 min | H100 |
| Training | 18.7 s per update × 1,440 updates of 32 packed 2,048-token sequences. | 7.3 to 7.5 h | A100-40GB |
| Training, Qwen3-14B | 10.3 to 10.6 s per update × 1,440 updates, measured on twelve cartridges. | 4.1 to 4.2 h | H100 |
| Store | |||
| Repeat-pass scorer | One prefill, one repeat pass, score every cell. | 9 to 14 s | H100 |
| KVzip+ scorer | One prefill, score every cell. | 10 to 17 s | H100 |
| KVzip+ scorer | Same, on a consumer GPU. | 15 to 23 s | RTX 4090 |
| Four-record cut | Score and cut all four records, including model load. | 62 to 68 s | H100 |
| Panel evaluation, 480 answers | |||
| No record | 80 questions × 6 runs. | 0.7 h | H100 |
| Cartridges | Same panel. | 1.5 h | H100 |
| Stores | Same panel. | 3 h | H100 |
| Whole record | Same panel. | 4.9 h | H100 |
| Build compute per record | |||
| Cartridge, Qwen3-8B | Fitted start plus training. Synthesis not included (unmeasured on 8B). | about 2.8 to 3.0 H100 h (estimate) | H100 equivalent |
| Store, Qwen3-8B | Prefill plus KVzip+ scoring. | about 15 s | H100 |
| Cartridge, Qwen3-14B | This record's share of the synthesis, native start, fit and training, all measured. | 4.8 to 5.1 h | H100 |
| Store, Qwen3-14B | One quarter of a four-record cut with the model load. | 22 to 35 s | H100 |
| Ratio | Cartridge build over store build: 8B before synthesis (estimate), 14B measured end to end. | near 700× on both | |
On Qwen3-8B the A100-40GB training time was converted to H100 hours by an estimate, and synthesis was not counted, so the 8B ratio is a lower bound. On Qwen3-14B every stage was timed on the H100, and the ratio comes out the same: 17,300 to 18,200 GPU seconds for a cartridge against 22 to 35 for a store. The evaluation times differ by arm because the arms write answers of different lengths: on 14B the cartridge arms took 1.6 to 1.8 h for 480 answers (median 350 to 410 thinking tokens), the stores 2.3 to 3.6 h (median 480 to 1,040) and the whole record 4.4 h.
The reader prefills the record once. A scorer rates every KV cell in every head. The store keeps the best cells per head. A per-layer grid over all 36 layers sets how many cells each layer keeps. Keys are coded at 8 bits with a per-channel scale. Values are coded at 4 bits with a range per row. The 54 template rows (the chat template around the record) stay at 16 bits. The byte target per record is the coded or 16-bit bytes of that record's cartridge, so each store is compared against a cartridge of the same size.
The cartridge follows the Cartridges at Scale recipe. The fitted start takes the first tokens of the record as the start and then runs a local key-value fit on 192 held conversations. Training uses 32 packed 2,048-token sequences per update, a rate of 0.035, 1,440 updates, Adam beta2 0.999, float32 master weights and FlexAttention. The training data are the self-study conversations from synthesis: questions written by a 70B model, answers and top-20 log-probabilities from the reader itself.
Each question has six sampled runs per arm. A question is up for arm A against arm B when more of A's six runs are right than B's. A question with equal counts is a tie and is dropped from the sign test. The exact two-sided sign test runs over the 80 questions. A 95% bootstrap interval over the mean difference uses 10,000 draws. An arm is above or below only when p<0.05 and the interval excludes 0. All other results are no decision.
The same arms were run on Qwen3-14B as a second reader, with store budgets at 0.2 and 1.0 of the cartridge's bytes added and the Fast KVzip gate released for 14B. Qwen3-14B has 40 layers with 8 KV heads of width 128, so one KV row is 40 × 8 × 128 × 2 × 2 = 163,840 bytes; patient record 01 prefills to 12,274 rows, 2.01 GB. The recipe cartridge has 615 rows, 100.6 MB at 16 bits. Every build stage was timed on this reader: synthesis of 15,500 self-study answers, the native and fitted starts, twelve trainings (fitted start with two seeds, native start with one, four records) and the store cuts. The sampler, questions, runs and readout rule are those of section 6. Bytes are for patient record 01.
| Arm | Fraction | Bytes per record | Score | Build per record (H100) | Note |
|---|---|---|---|---|---|
| Anchors | |||||
| No record | 0 | 0 B | 0.469 | 0 | Above the 8B reader's 0.417. |
| Whole record | 19.99 | 2.01 GB | 0.873 | prefill only | Every KV cell at 16 bits. |
| Trained cartridges | |||||
| Cartridge 16-bit, fitted start, seed 42 | 1.00 | 100.6 MB | 0.752 | 4.8 to 5.1 h | Synthesis share 0.5 to 0.7 h, start 9 min, training 4.1 h. |
| Cartridge 16-bit, fitted start, seed 43 | 1.00 | 100.6 MB | 0.748 | 4.8 to 5.1 h | Seed spread -0.004, no decision. |
| Cartridge 16-bit, native start | 1.00 | 100.6 MB | 0.690 | 4.7 to 4.9 h | Fitted start +0.062 over it (p 0.017, interval low end +0.000: no decision). |
| Coded cartridge, seed 42 | 0.385 | 38.8 MB | 0.740 | cartridge + 20 s | Coder costs -0.012, no decision. |
| Coded cartridge, seed 43 | 0.385 | 38.8 MB | 0.738 | cartridge + 20 s | Coder costs -0.010, no decision. |
| Scored stores, coded like the cartridge | |||||
| Store, KVzip+ scorer | 0.2 | 20.1 MB | 0.500 | 23 s | Below the 16-bit cartridge by 0.252 (p 3e-6). The store's floor is between 0.2 and 0.385. |
| Store, KVzip+ scorer | 0.385 | 38.7 MB | 0.800 | 22 s | +0.060 over the coded cartridge, no decision (p 0.28). |
| Store, KVzip+ scorer | 0.5 | 50.3 MB | 0.852 | 22 s | +0.100 over the 16-bit cartridge, above (p 0.041). |
| Store, KVzip+ scorer | 0.77 | 77.5 MB | 0.871 | 35 s | +0.119 over the 16-bit cartridge, above (p 0.007). Level with the whole record (+0.002). |
| Store, KVzip+ scorer | 1.0 | 100.6 MB | 0.877 | 22 s | +0.125 over the 16-bit cartridge at the same bytes (p 0.0008). |
| Store, repeat-pass scorer (KVzip) | 0.385 | 38.7 MB | 0.696 | 20 s | KVzip+ leads repeat by +0.104 (p 0.0003). |
| Store, repeat-pass scorer (KVzip) | 0.77 | 77.5 MB | 0.842 | 21 s | KVzip+ leads by +0.029, no decision. |
| Cheaper scorer | |||||
| Fast KVzip gate (14B release), 2% window | 0.385 | 38.7 MB | 0.440 | 6 s | Below KVzip+ by 0.360 (p 2e-10); below the no-record anchor. |
| Fast KVzip gate (14B release), 2% window | 0.77 | 77.5 MB | 0.827 | 7 s | -0.044 under KVzip+, no decision (p 0.115). |
The KVzip+ line rises steeply from 0.2 to 0.5 of the cartridge's bytes and is flat from 0.5 up, level with the whole record from 0.77. The cartridge at 100.6 MB sits 0.12 under the store at the same bytes, and its coded form at 38.8 MB sits 0.06 under the store at that size, inside the no-decision band. The gate's 2% window takes most of its budget at the small size and it drops below the no-record anchor there.
| A | B | Difference | 95% interval | Up / down | p | Decision |
|---|---|---|---|---|---|---|
| Whole record | No record | +0.404 | +0.304 to +0.506 | 48 / 5 | 7e-10 | above (reader check) |
| Store KVzip+ at 0.385 | Coded cartridge, seed 42 | +0.060 | -0.017 to +0.140 | 25 / 17 | 0.28 | no decision (tie at equal bytes) |
| Store KVzip+ at 0.5 | Cartridge 16-bit, seed 42 | +0.100 | +0.033 to +0.169 | 24 / 11 | 0.041 | above |
| Store KVzip+ at 0.77 | Cartridge 16-bit, seed 42 | +0.119 | +0.050 to +0.190 | 24 / 8 | 0.007 | above |
| Store KVzip+ at 0.2 | Cartridge 16-bit, seed 42 | -0.252 | -0.356 to -0.148 | 12 / 48 | 3e-6 | below |
| Store KVzip+ at 0.77 | Whole record | -0.002 | -0.042 to +0.035 | 9 / 9 | 1 | no decision (level) |
| Store KVzip+ at 0.385 | Store repeat at 0.385 | +0.104 | +0.054 to +0.156 | 31 / 8 | 0.0003 | above (KVzip+ replaces repeat) |
| Store KVzip+ at 0.77 | Store repeat at 0.77 | +0.029 | -0.002 to +0.067 | 13 / 5 | 0.096 | no decision |
| Fast KVzip gate at 0.385 | Store KVzip+ at 0.385 | -0.360 | -0.452 to -0.267 | 8 / 58 | 2e-10 | below |
| Cartridge, fitted start | Cartridge, native start | +0.062 | +0.000 to +0.125 | 25 / 10 | 0.017 | no decision (interval touches 0) |
| Cartridge seed 43 | Cartridge seed 42 | -0.004 | -0.052 to +0.042 | 17 / 12 | 0.46 | no decision (seed spread) |
| Coded cartridge | Cartridge 16-bit, same seed | -0.012 / -0.010 | 0.52 / 1 | no decision (coder is free) | ||
| Whole record | Cartridge 16-bit, seed 42 | +0.121 | +0.054 to +0.192 | 26 / 5 | 0.0002 | above |
| Part | Work | Time | Device |
|---|---|---|---|
| Cartridge | |||
| Synthesis | 15,500 answers with top-20 log-probabilities by the reader through vLLM, four servers, 3,875 prompts each. | 2,169 to 2,321 s per server; 38.5 min of wall, 2.5 GPU h | 4 × H100 |
| Native start | The KV state of the record's first tokens, one row in 20. | 16 s | H100 |
| Fitted start | Teacher capture (9.5 GB on disk), then a layer-by-layer key-value fit. | 7.5 to 9 min (fit 6 to 8 min) | H100 |
| Training | 1,440 updates of 32 packed 2,048-token sequences, float32 masters, FlexAttention. | 4.1 to 4.2 h (10.3 to 10.6 s per update) | H100 |
| Build per record | Synthesis share by the record's rows, start and training. | 17,300 to 18,200 s (4.8 to 5.1 h) | H100 |
| Store | |||
| Four-record cut, KVzip+ or repeat | Model load, one prefill per record, score, keep, code. | 81 to 140 s | H100 |
| Four-record cut, gate | Same with the released gate on the prefill's hidden states. | 24 to 27 s | H100 |
| Build per record | One quarter of the cut. | 22 to 35 s | H100 |
| Panel evaluation, 480 answers | |||
| No record / cartridges / stores / whole record | 80 questions × 6 runs; time follows the answers' thinking length. | 0.65 h / 1.6 to 1.8 h / 2.3 to 3.6 h / 4.4 h | H100 |
The 15,500 self-study questions were an input, written once by a larger model for the 8B work and reused; their cost is not in the cartridge's build time, which favors the cartridge. Even so, the cartridge costs about 700 times the store's build compute for a lower score at every byte budget from 0.385 of its bytes up.
The cartridge improved by 0.03 on the larger reader (0.752 against 0.719 at 16 bits). The store improved by 0.11 at equal coded bytes (0.800 against 0.690), by 0.10 at half the bytes and by 0.05 at 0.77, where it now matches the whole record. The crossing stays at 0.385 of the bytes, but the store's lead above it is decided on 14B where on 8B it was a match at 0.5 and a lead at 0.77. KVzip+ stays the scorer. The fitted start's edge over the native start grew from +0.019 to +0.062 but stays inside the rule's no-decision band. A reader that attends more selectively lets a sparser selection of its own cells keep what its answers use; the cartridge must learn the record through self-study whose teacher is the same reader, and the better teacher moved it less. This is a reading of the numbers, not a demonstrated mechanism.