Developer shows gzip's DEFLATE algorithm can crudely generate text like a language model
A blogger demonstrated that gzip, primed with a corpus of Shakespeare text, can 'continue' a prompt by finding byte sequences that compress most efficiently against its sliding window, producing text that is semi-coherent but clearly reflects patterns from the source material. The experiment was inspired by a paper arguing that prediction and compression are mathematically equivalent, since both rely on assigning probabilities to what comes next.
GoKawiil's interpretation of the reporting above, not reported fact.
The demo makes concrete an important theoretical point: any compression algorithm implicitly contains a probabilistic model of the data it compresses, even something as simple and old as gzip's DEFLATE. This reframes the relationship between compression and modern large language models, suggesting they are different points on the same spectrum rather than fundamentally distinct technologies.
- gzip, using only its built-in DEFLATE compression, can generate text resembling a rudimentary language model.
- The result stems from a known equivalence in information theory: prediction and compression rely on the same probability math.
- The experiment used a 32 KiB sliding window and Shakespeare text to prime and generate the output.
Source: nathan.rs, 2026-09-22
Published there as: “Can gzip be a language model?”
Read the original report → The summary and analysis above are GoKawiil's own, written from reporting by the source above. Facts and quotes belong to the original publisher.