Trained cartridges against scored stores

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

1. Conclusion

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.

tie
store vs coded cartridge at equal bytes, both readers
+0.10 / +0.12
store lead at 0.77 of bytes, 8B / 14B (p<0.01)
0.871 vs 0.873
store at 0.77 vs whole record, 14B (77 MB vs 2.01 GB)
22-35 s
store build per record (H100, 14B)
4.8-5.1 h
cartridge build per record (H100, 14B, all stages)

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.

2. Numbers

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.

ArmFractionBytes per recordScoreNote
Anchors
No record00 B0.417Reader answers from the question alone.
Whole record19.961.81 GB0.875Full prefill, every KV cell kept at 16 bits.
Trained cartridges
Cartridge 16-bit, fitted start, seed 421.0090.7 MB0.719Recipe cartridge, 615 rows.
Cartridge 16-bit, fitted start, seed 431.0090.7 MB0.733Seed spread +0.014, no decision.
Cartridge 16-bit, native start1.0090.7 MB0.700Start from the first tokens, no local fit.
Coded cartridge, seed 420.38535.0 MB0.7108-bit keys, 4-bit values. Coder costs -0.008, no decision.
Coded cartridge, seed 430.38535.0 MB0.721Coder costs +0.012 here, no decision.
Scored stores, coded like the cartridge
Store, KVzip+ scorer0.38534.5 MB0.690Ties the coded cartridge. Keeps 3.8% of cells.
Store, repeat-pass scorer (KVzip)0.38534.5 MB0.698
Store, KVzip+ scorer0.544.7 MB0.752+0.033 over the 16-bit cartridge, no decision.
Store, repeat-pass scorer (KVzip)0.544.7 MB0.723
Store, KVzip+ scorer0.7768.8 MB0.819+0.10 over the 16-bit cartridge, above (p<0.01).
Store, repeat-pass scorer (KVzip)0.7768.8 MB0.773KVzip+ leads repeat by +0.046.
Store, 16-bit cells, no coder0.7768.8 MB0.773Fewer cells at 16 bits instead of more cells coded.
Cheaper scorers
Fast KVzip gate, 2% window0.38534.5 MB0.369Below the no-record anchor.
Fast KVzip gate, 2% window0.7768.8 MB0.615
Fast KVzip gate, no window0.38534.5 MB0.573+0.204 over the windowed gate (p 0.0013), still below KVzip+.
Fast KVzip gate, no window0.7768.8 MB0.762
KVzap head, with window0.385 / 0.7734.5 / 68.8 MBbelow KVzip+Lower than the KVzip+ store at both budgets.

Geometry

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.

3. Score against bytes per record

LongHealth score against bytes per record, Qwen3-8B
x: bytes per record in MB, log scale. y: mean score over 80 questions × 6 runs. Hover a point for its value.
store, KVzip+ scorer store, repeat-pass scorer cartridge 16-bit (two seeds) cartridge 16-bit, native start coded cartridge (two seeds) whole record no record
LongHealth score against bytes per record on Qwen3-8B Stores at 34.5, 44.7 and 68.8 MB score 0.690, 0.752 and 0.819 with the KVzip+ scorer and 0.698, 0.723 and 0.773 with the repeat scorer. Cartridges at 90.7 MB score 0.719 and 0.733, and 0.700 from a native start. Coded cartridges at 35.0 MB score 0.710 and 0.721. The whole record at 1,810 MB scores 0.875. No record scores 0.417. 0.4 0.5 0.6 0.7 0.8 0.9 score 10 20 50 100 200 500 1000 2000 bytes per record (MB, log scale) no record 0.417 store, repeat scorer, 0.385 of bytes: 34.5 MB, score 0.698 store, repeat scorer, 0.5 of bytes: 44.7 MB, score 0.723 store, repeat scorer, 0.77 of bytes: 68.8 MB, score 0.773 store, KVzip+ scorer, 0.385 of bytes: 34.5 MB, score 0.690 store, KVzip+ scorer, 0.5 of bytes: 44.7 MB, score 0.752 store, KVzip+ scorer, 0.77 of bytes: 68.8 MB, score 0.819 coded cartridge, seed 42: 35.0 MB, score 0.710 coded cartridge, seed 43: 35.0 MB, score 0.721 cartridge 16-bit, fitted start, seed 42: 90.7 MB, score 0.719 cartridge 16-bit, fitted start, seed 43: 90.7 MB, score 0.733 cartridge 16-bit, native start: 90.7 MB, score 0.700 whole record: 1,810 MB, score 0.875 KVzip+ store 0.819 repeat store 0.773 cartridge 16-bit 0.719 / 0.733 native start 0.700 coded cartridge 0.710 / 0.721 stores 0.690 / 0.698 whole record 0.875 1.81 GB

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.

4. Statistical readings

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.

ABDifferenceDecision
Store KVzip+ at 0.385Coded cartridge at 0.385within +0.03 / -0.02no decision (tie at equal bytes)
Store KVzip+ at 0.5Cartridge 16-bit+0.033no decision (match)
Store KVzip+ at 0.77Cartridge 16-bit+0.10above, p<0.01
Store KVzip+ at 0.77Store repeat at 0.77+0.046KVzip+ leads
Fast KVzip gate, no window, 0.385Fast KVzip gate, 2% window, 0.385+0.204above, p 0.0013; still below KVzip+
Cartridge seed 43Cartridge seed 42+0.014no decision (seed spread)
Coded cartridgeCartridge 16-bit, same seed-0.008 / +0.012no decision (coder is free)
Cartridge, fitted startCartridge, native start+0.019no 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.

5. Compute per part

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.

PartWorkTimeDevice
Cartridge
SynthesisAbout 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-14BH100
Fitted startTeacher capture, then a local key-value fit on 192 held conversations.5 to 14 min + 5 to 6 minH100
Training18.7 s per update × 1,440 updates of 32 packed 2,048-token sequences.7.3 to 7.5 hA100-40GB
Training, Qwen3-14B10.3 to 10.6 s per update × 1,440 updates, measured on twelve cartridges.4.1 to 4.2 hH100
Store
Repeat-pass scorerOne prefill, one repeat pass, score every cell.9 to 14 sH100
KVzip+ scorerOne prefill, score every cell.10 to 17 sH100
KVzip+ scorerSame, on a consumer GPU.15 to 23 sRTX 4090
Four-record cutScore and cut all four records, including model load.62 to 68 sH100
Panel evaluation, 480 answers
No record80 questions × 6 runs.0.7 hH100
CartridgesSame panel.1.5 hH100
StoresSame panel.3 hH100
Whole recordSame panel.4.9 hH100
Build compute per record
Cartridge, Qwen3-8BFitted start plus training. Synthesis not included (unmeasured on 8B).about 2.8 to 3.0 H100 h (estimate)H100 equivalent
Store, Qwen3-8BPrefill plus KVzip+ scoring.about 15 sH100
Cartridge, Qwen3-14BThis record's share of the synthesis, native start, fit and training, all measured.4.8 to 5.1 hH100
Store, Qwen3-14BOne quarter of a four-record cut with the model load.22 to 35 sH100
RatioCartridge 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.

6. Method

The store pipeline

prefill once
→
score every cell per head
→
keep best cells, per-layer grid
→
code keys 8-bit, values 4-bit
→
keep 54 template rows at 16 bits

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 recipe

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.

The readout rule

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.

7. Limits

8. Qwen3-14B, the second reader

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.

0.800 vs 0.740
KVzip+ store vs coded cartridge at equal bytes (no decision)
+0.100
store at 0.5 of bytes over 16-bit cartridge (p 0.041)
+0.119
store at 0.77 over 16-bit cartridge (p 0.007)
0.871 vs 0.873
store at 0.77 (77 MB) vs whole record (2.01 GB)
~700×
cartridge build over store build, measured
ArmFractionBytes per recordScoreBuild per record (H100)Note
Anchors
No record00 B0.4690Above the 8B reader's 0.417.
Whole record19.992.01 GB0.873prefill onlyEvery KV cell at 16 bits.
Trained cartridges
Cartridge 16-bit, fitted start, seed 421.00100.6 MB0.7524.8 to 5.1 hSynthesis share 0.5 to 0.7 h, start 9 min, training 4.1 h.
Cartridge 16-bit, fitted start, seed 431.00100.6 MB0.7484.8 to 5.1 hSeed spread -0.004, no decision.
Cartridge 16-bit, native start1.00100.6 MB0.6904.7 to 4.9 hFitted start +0.062 over it (p 0.017, interval low end +0.000: no decision).
Coded cartridge, seed 420.38538.8 MB0.740cartridge + 20 sCoder costs -0.012, no decision.
Coded cartridge, seed 430.38538.8 MB0.738cartridge + 20 sCoder costs -0.010, no decision.
Scored stores, coded like the cartridge
Store, KVzip+ scorer0.220.1 MB0.50023 sBelow the 16-bit cartridge by 0.252 (p 3e-6). The store's floor is between 0.2 and 0.385.
Store, KVzip+ scorer0.38538.7 MB0.80022 s+0.060 over the coded cartridge, no decision (p 0.28).
Store, KVzip+ scorer0.550.3 MB0.85222 s+0.100 over the 16-bit cartridge, above (p 0.041).
Store, KVzip+ scorer0.7777.5 MB0.87135 s+0.119 over the 16-bit cartridge, above (p 0.007). Level with the whole record (+0.002).
Store, KVzip+ scorer1.0100.6 MB0.87722 s+0.125 over the 16-bit cartridge at the same bytes (p 0.0008).
Store, repeat-pass scorer (KVzip)0.38538.7 MB0.69620 sKVzip+ leads repeat by +0.104 (p 0.0003).
Store, repeat-pass scorer (KVzip)0.7777.5 MB0.84221 sKVzip+ leads by +0.029, no decision.
Cheaper scorer
Fast KVzip gate (14B release), 2% window0.38538.7 MB0.4406 sBelow KVzip+ by 0.360 (p 2e-10); below the no-record anchor.
Fast KVzip gate (14B release), 2% window0.7777.5 MB0.8277 s-0.044 under KVzip+, no decision (p 0.115).
LongHealth score against bytes per record, Qwen3-14B
x: bytes per record in MB, log scale. y: mean score over 80 questions × 6 runs. Hover a point for its value.
store, KVzip+ scorer store, repeat-pass scorer store, Fast KVzip gate cartridge 16-bit (two seeds) cartridge 16-bit, native start coded cartridge (two seeds) whole record no record
LongHealth score against bytes per record on Qwen3-14B KVzip+ stores at 20.1, 38.7, 50.3, 77.5 and 100.6 MB score 0.500, 0.800, 0.852, 0.871 and 0.877. Repeat stores at 38.7 and 77.5 MB score 0.696 and 0.842; the gate 0.440 and 0.827. Cartridges at 100.6 MB score 0.752 and 0.748, and 0.690 from a native start. Coded cartridges at 38.8 MB score 0.740 and 0.738. The whole record at 2,010 MB scores 0.873. No record scores 0.469. 0.4 0.5 0.6 0.7 0.8 0.9 score 10 20 50 100 200 500 1000 2000 bytes per record (MB, log scale) no record 0.469 store, Fast KVzip gate with window, 38.7 MB, score 0.440 store, Fast KVzip gate with window, 77.5 MB, score 0.827 store, repeat scorer, 38.7 MB, score 0.696 store, repeat scorer, 77.5 MB, score 0.842 store, KVzip+ scorer, 20.1 MB, score 0.500 store, KVzip+ scorer, 38.7 MB, score 0.800 store, KVzip+ scorer, 50.3 MB, score 0.852 store, KVzip+ scorer, 77.5 MB, score 0.871 store, KVzip+ scorer, 100.6 MB, score 0.877 coded cartridge, seed 42: 38.8 MB, score 0.740 coded cartridge, seed 43: 38.8 MB, score 0.738 cartridge 16-bit, fitted start, seed 42: 100.6 MB, score 0.752 cartridge 16-bit, fitted start, seed 43: 100.6 MB, score 0.748 cartridge 16-bit, native start: 100.6 MB, score 0.690 whole record: 2,010 MB, score 0.873 KVzip+ store 0.871 / 0.877 repeat store 0.842 gate 0.827 cartridge 16-bit 0.752 / 0.748 native start 0.690 KVzip+ store 0.800 coded cartridge 0.740 / 0.738 repeat store 0.696 gate 0.440 KVzip+ at 0.2: 0.500 whole record 0.873 2.01 GB

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.

Statistical readings

ABDifference95% intervalUp / downpDecision
Whole recordNo record+0.404+0.304 to +0.50648 / 57e-10above (reader check)
Store KVzip+ at 0.385Coded cartridge, seed 42+0.060-0.017 to +0.14025 / 170.28no decision (tie at equal bytes)
Store KVzip+ at 0.5Cartridge 16-bit, seed 42+0.100+0.033 to +0.16924 / 110.041above
Store KVzip+ at 0.77Cartridge 16-bit, seed 42+0.119+0.050 to +0.19024 / 80.007above
Store KVzip+ at 0.2Cartridge 16-bit, seed 42-0.252-0.356 to -0.14812 / 483e-6below
Store KVzip+ at 0.77Whole record-0.002-0.042 to +0.0359 / 91no decision (level)
Store KVzip+ at 0.385Store repeat at 0.385+0.104+0.054 to +0.15631 / 80.0003above (KVzip+ replaces repeat)
Store KVzip+ at 0.77Store repeat at 0.77+0.029-0.002 to +0.06713 / 50.096no decision
Fast KVzip gate at 0.385Store KVzip+ at 0.385-0.360-0.452 to -0.2678 / 582e-10below
Cartridge, fitted startCartridge, native start+0.062+0.000 to +0.12525 / 100.017no decision (interval touches 0)
Cartridge seed 43Cartridge seed 42-0.004-0.052 to +0.04217 / 120.46no decision (seed spread)
Coded cartridgeCartridge 16-bit, same seed-0.012 / -0.0100.52 / 1no decision (coder is free)
Whole recordCartridge 16-bit, seed 42+0.121+0.054 to +0.19226 / 50.0002above

Compute, every stage measured

PartWorkTimeDevice
Cartridge
Synthesis15,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 h4 × H100
Native startThe KV state of the record's first tokens, one row in 20.16 sH100
Fitted startTeacher 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
Training1,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 recordSynthesis 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 repeatModel load, one prefill per record, score, keep, code.81 to 140 sH100
Four-record cut, gateSame with the released gate on the prefill's hidden states.24 to 27 sH100
Build per recordOne quarter of the cut.22 to 35 sH100
Panel evaluation, 480 answers
No record / cartridges / stores / whole record80 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 hH100

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.

What changed from Qwen3-8B

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.