Build1 publisher2 min readPublished
Sixteen times more training code buys the same gain as reading the rest of the file
A re-evaluation of checkpoints trained on 500K, 2M and 8M tokens of code moved the point where a zero-parameter count table overtakes a 2.45M-parameter transformer by 6.6x in document length, and at 4,000 tokens the table still wins.
The Engineer · Build desk

What happened
- The sweep re-evaluated saved checkpoints trained on 500,000, 2 million and 8 million tokens of code with identical architecture, so no new training run was involved.
- At 8 million training tokens the cache trails the transformer by 0.057 at 250 tokens of document and beats it by 0.044 to 0.098 from 800 tokens up to 4,000, all paired-significant.
- A log-linear fit of each row's delta against document length puts the movement at 1.60 per doubling of training data, so 16 times the corpus moved the crossover 6.6 times further into the file.
- Matching the zero-parameter cache on a 4,000-token file needs roughly 10 to 20 times more in-domain code than CPython's standard library and PyTorch combined.
- Sixteen times the training corpus was worth +0.170 top-1 to the transformer at 4,000 tokens, and letting the cache read 4,000 tokens of the file instead of 250 was worth +0.174.
Compiled by The EngineerSomething wrong?How this is made
Why it matters
- cost The price is paid in in-domain code, ten to twenty times CPython's standard library plus PyTorch, and per-repo completion is the setting where that code does not exist.
- constraint Corpus size lifts a flat line and nothing else: a 64-token window gets the same benefit at 250 tokens of file as at 4,000, and never gains access to the document.
- decision A team choosing between collecting more in-domain code and handing a zero-parameter cache the whole open file is choosing between two gains of the same size, and only one of them needs a training loop.
The vocabulary is where this sweep could have broken without anyone noticing. Each checkpoint built its own 16K vocabulary from its own subset of code, and only 39.8% of the 500K and 8M vocabularies overlap [5]. So every cell is scored in the vocabulary of the checkpoint under test, and the corpus count model in that cell is built from the same tokens the transformer saw in training [5]. Nothing travels between rows except the position of the crossover [6].
The cache row is the control. It never touches the training corpus, so it should be flat, and it is: top-1 of 0.311, 0.312 and 0.313 at 250 tokens of document, and 0.487, 0.488 and 0.487 at 4,000 [11][4].
The fit is checkable. Sixteen times is four doublings, and 1.60 to the fourth is 6.55 [23]. Fit only the 2M-to-8M segment, where the model is less undertrained, and the rate rises to 1.78 per doubling. At that rate a 4,000-token file needs about 97M training tokens, some 12 times the 8M corpus [13][24]. The post calls that extrapolation illustrative rather than measured, and cites the project's own earlier work as a warning against trusting a slope past its fitted range [14].
The crossover moves because the trained line rises, and it rises by about the same amount at every document length. The gain from the full 16x is +0.132 at 250 tokens and +0.148 at 1,000, barely different from the figure at 4,000 [16]. The window is 64 tokens, and no quantity of training text widens it [16]. Spread over four doublings, the 4,000-token gain works out at roughly 0.043 of top-1 per doubling of the corpus [28].
The transformer wins exactly one cell in the table, at 8M tokens and 250 tokens of document [9]. In that same cell the corpus count table scores 0.415 against the transformer's 0.370, a margin of 0.045 for counting [19][25]. A neighbouring experiment's corpus-plus-cache combination runs from 0.461 to 0.551 across these lengths [20].
For this exchange rate to transfer, several things have to hold: in-distribution held-out code [10], a model of about 2.45M parameters with a 64-token window working on files of thousands of tokens [21][16], and a setting where the extra 10 to 20 times in-domain code cannot be obtained [15]. Per-repo completion is that setting, according to the post [29]. The repo is not public, so every number here comes from the project's own harness [2]. The 8M, 250-token result does reproduce an earlier finding that counting beats the small transformer on code, on a different harness [19].
What to watch
- Whether the research repo goes public, so the 1.60-per-doubling fit can be checked outside the project's own harness.
- A run at around 97M tokens of in-domain code, which would test the 1.78-per-doubling rate outside its fitted range.
- The same sweep with a window wide enough to cover a 4,000-token file, which would test whether the cache's advantage is window-bound.