Can a Language Model Beat ZIP?
A fair comparison must include the cost of intelligence.

A language model is trained to predict what comes next. That makes it a candidate for lossless compression. If the model assigns a high probability to the next token in a file, an entropy coder can represent it with fewer bits on average.
Suppose the resulting stream is smaller than a ZIP archive of the same text. To know whether it wins, we still need to know how the recipient decodes it, which dependencies they already have, and what exact output their decoder can reconstruct.
Turning prediction into a codec
ZIP is a container. For this comparison, use ZIP with DEFLATE as the conventional baseline. DEFLATE represents repeated byte sequences using references to earlier data and uses Huffman codes for symbols in the compressed representation. A neural codec can instead predict a distribution over the next symbol given the symbols already seen and use arithmetic coding to encode the actual symbol. The model supplies the distribution. The coder makes the sequence recoverable. [1] [2] [3]
At each step the decoder runs the same prediction on the prefix it has recovered. A practical arithmetic coder partitions its range using integer cumulative frequencies. Both ends must agree on those frequencies, symbol order, how context is initialized, and when the stream ends. Even with the same weights, a different numerical implementation can move a probability across a rounding boundary. Compatibility depends on reproducing the integer tables the coder actually consumes (Figure 1).
Fig. 01 / Interactive
What if the probability table changes?
The encoder divides a scale of 100 points at 70: points 0–69 mean A and points 70–99 mean B.
Point 60 represents A at a split of 70. A decoder whose split is 50 reads the same point as B.
Recovering the exact bytes
Tokenization has its own round-trip requirement. Two sequences of Unicode characters can look the same while their UTF-8 bytes differ. A tokenizer that normalizes the input can erase the distinction before the model sees it. Use a reversible representation of the source bytes, or carry the extra information needed to undo transformations such as normalization. For arbitrary files, text decoding with replacement characters can also lose information (Figure 2). [4]
Fig. 02 / Interactive
Same glyph, different bytes.
Compare a precomposed é with an e followed by a combining acute accent.
| Source form | UTF-8 bytes entering the coder |
|---|---|
| Precomposed | |
| Combining | |
The precomposed form is C3 A9 and the combining form is 65 CC 81. NFC maps both to C3 A9.
Who already has the model?
Suppose a neural codec produces 1 MB of coded text and requires a 100 MB model. For a recipient without the model, a one-off self-contained transfer takes at least 101 MB before framing or additional runtime components. If the recipient already has the exact compatible model and decoder, the marginal transfer can be close to 1 MB. If you send the model once and reuse it, the upfront cost spreads over the files you actually transfer (Figure 3).
Fig. 03 / Interactive
How many files pay for the model?
Assume a hypothetical 3 MB ZIP archive or a 1 MB neural stream per file. The ZIP decoder is already available.
| Transfer | ZIP | Neural codec |
|---|---|---|
| Coded files | ||
| Model | 0 MB | |
| Total |
Sending the model once costs 101 MB for one file. At 50 files both methods total 150 MB; at 51 files the neural transfer is 151 MB and ZIP is 153 MB.
Transfer size is one measure. Reproducing the probability tables also costs time and memory, and the first decode may have to load substantial weights before it reads the first symbol. In Language Modeling Is Compression, Delétang and colleagues report raw compression rates separately from rates that charge for model parameters. The Hutter Prize uses its own explicit rules for what executables and archives count toward the score. State which accounting boundary your comparison uses. [3] [5]
How to investigate it
Compare a pinned ZIP/DEFLATE implementation against a small deterministic predictor paired with an entropy coder. Prepare the same public held-out text for both. For a model trained specifically for the test, separate its training corpus from the evaluation corpus. For pretrained weights, report what you can establish about overlap and what remains unknown.
- Freeze the inputs and decoder contract. Record input hashes, software versions, model and tokenizer hashes, context rules, symbol order, and the integer probability table construction.
- Check exact reconstruction. Decode from a fresh process and compare the output bytes with the input. Repeat on every platform or runtime you claim is compatible. Keep cases with accented characters, unusual line endings, and inputs near block boundaries.
- Separate marginal and delivered sizes. Record the actual coded bytes including framing. Record model, tokenizer, and required runtime components separately and charge them according to what each endpoint already has.
- Measure both directions. Report encode and decode throughput, startup time, and peak memory. Use the same documented machine and distinguish a cold model load from a warm run.
This is a proposed experiment. The figures demonstrate a decoding choice, actual byte representations for two sample strings, and hypothetical transfer sizes.
What this means
A language model can yield a smaller coded stream on a particular corpus. Whether that is a better way to move or store the file depends on who has the decoder, how often the model will be reused, and what the receiver can afford to run.
A compression result needs to say what the decoder already knows.
References and further reading
- PKWARE. ZIP File Format Specification (APPNOTE).
- L. Peter Deutsch. RFC 1951, DEFLATE Compressed Data Format Specification.
- Grégoire Delétang et al. Language Modeling Is Compression, especially sections 2 and 3.
- Unicode Consortium. Unicode Normalization Forms (UAX #15).
- Marcus Hutter. Human Knowledge Compression Contest rules.
