Perplexity fell 0.14 nats when I trained on 75% code
OpenAI's chart shows base-model log-perplexity falling from ~0.99 (GPT-3.5) to ~0.91 (GPT-4) to under 0.8 today, with the next wave of capabilities expected in the 0.68–0.7 window. The chart's evaluation set is a fixed corpus of code — that detail is buried in a footnote, as micjm's read of the post notes. I trained the same tiny model on 25% code versus 75% code — same size, same architecture, same everything except the mix — and its code perplexity moved 0.14 nats. The model didn't get smarter. The dial did.
The paper that already did this properly
micjm spotted the issue first: if the eval set is code, then a training mix heavier in code buys you a lower number for free. He points to Ye et al., "Data Mixing Laws" (arXiv:2403.16952), who trained a 160M model on five mixtures and measured held-out loss. As code went from 25% to 75% of training data, log-perplexity on held-out GitHub code fell from 1.213 to 1.041 nats — a 0.172-nat improvement. On non-code text, it went the other way. Two crossing lines.
I wanted to know if that shape survives at a scale I can run on my own machine, with a model so dumb it can't hide anything. So I built the smallest version of the experiment that still means something.
The setup
A character 5-gram with add-0.01 smoothing — the same machinery as my earlier perplexity piece, where a 5-gram scored 2.468 bits per character on English text. Three training sets, each exactly 2,000,000 characters, differing only in mix: 25%, 50%, and 75% code. Training text is drawn as interleaved 10,000-character blocks from the two pools, so no single chunk can dominate. Two seeds each, averaged. The test sets are fixed: 200,000 held-out characters of Python code and 200,000 held-out characters of English, neither seen in training.
- Code pool: the Python 3.12 standard library, 167 files, 4,669,187 characters.
- Text pool: norvig.com/big.txt, 6,488,666 characters of English.
mix code test (bits/char) text test (bits/char)
25% code 3.192 2.322
50% code 3.018 2.436
75% code 2.987 2.724
delta 25% -> 75%:
code test: -0.205 bits (-0.142 nats)
text test: +0.402 bits (+0.278 nats)
Seed-to-seed spread was at most 0.07 bits, so the shape is not sampling noise. And the paper's number, for comparison: a 160M transformer moved −0.172 nats on code over the same 25%→75% sweep. My 5-gram moved −0.142 nats. Different models, different corpora, same size of effect. That is the part I didn't expect: the mix dial is worth about the same at toy scale as at 160M parameters.
The shape is the story
Two details matter more than the headline delta:
The code gains saturate early. Most of the improvement happens between 25% and 50% code (−0.174 bits); from 50% to 75% the code test barely moves (−0.031 bits). A 5-gram learns the frequent surface patterns of code fast — def, import, indentation — and then there's nothing more for it to learn. The 160M model in the paper keeps improving across the whole range, which is exactly what you'd expect from a model with actual capacity. The saturation is a property of my model, not of the phenomenon.
The text cost accelerates. The damage to text perplexity is small from 25% to 50% (+0.114 bits) and more than doubles from 50% to 75% (+0.288 bits). Every point of code perplexity you buy past the halfway mark costs you more than the last one did on the other side. That's the crossing-lines picture from the paper, reproduced with a model that has no idea what code or English even is.
Why this matters for the chart
OpenAI's post proposes perplexity as a shared metric — a common yardstick, even a basis for common limits on development, with progress on this one number tracking the emergence of new capabilities. The post itself names the problem: "Different developers use different evaluation datasets and train on different data mixtures." My experiment puts a number on that caveat: turning one dial, the training mix, moves the headline metric by 0.14 nats — larger than the 0.08 gap between GPT-3.5 (~0.99) and GPT-4 (~0.91).
To be fair to the post: it does qualify the chart in a footnote, noting that predicting code is a poor proxy for general capabilities, and the authors of the data-mixing paper would be the first to say the 75%-code model really is better at code. The point isn't that the chart measures nothing. It's that a single perplexity number, without the mix that produced it, can't tell you whether the model got better or the training data got closer to the test. If perplexity becomes the shared yardstick, the mix has to be published next to the number — otherwise the yardstick is adjustable, and everyone will adjust it.
Caveats, stated plainly
A 5-gram is not a transformer. My absolute numbers (~3 bits per character) are far worse than a real model's (~1.5 bits per token in the paper's units), and the units aren't directly comparable — bits per character versus nats per token. What transfers is the delta and the shape, and only because the experiment holds everything else fixed. I also used Python stdlib as my code corpus and one English text as my text corpus; a different pair of corpora would give different absolute numbers, though the crossing shape is what the paper found too, on real training data. And I didn't test whether the 75%-code 5-gram is "better at code" in any downstream sense — a 5-gram can't write code, it can only predict the next character of it.
Sources
- OpenAI, "Perplexity and Intelligence" (Nov 22, 2026): https://openai.com/index/perplexity-and-intelligence/ — GPT-3.5 ~0.99, GPT-4 ~0.91, current models below 0.8, ~0.76 solving open math problems, next wave at 0.68–0.7
- micjm, "I, too, can make a chart of perplexity drops": https://micjm.com/blog/lowering-perplexity-without-scaling/
- Ye et al., "Data Mixing Laws" (arXiv:2403.16952): https://arxiv.org/abs/2403.16952 — 160M model, code 25%→75%, held-out code log-perplexity 1.213→1.041
- My earlier piece on the same machinery: https://dev.to/frankchu/218-bitsbyte-perplexity-is-just-compression-4bj3
- All experiment numbers are my own runs, Nov 24, 2026: char 5-gram, add-0.01 smoothing, 2M training chars, block-interleaved, 2 seeds averaged.
Top comments (0)