A file gets smaller when you can guess what is in it

2 months ago

You zip a file and it gets smaller. Your phone guesses the next word in your message. An essay published yesterday shows those two obey the same rule.

Ask

Ask about this presentation

Answers are generated from this presentation.

Chapters

  1. 0:00A file gets smaller when you can guess what is in it
  2. 0:10A bit is one yes-or-no answer, and likely things need fewer of them
  3. 0:23Only one message fits the range that is left
  4. 0:41The guess changed, and the phrase came out half the size
  5. 1:18The 2019 model more than halved the letter-by-letter price
  6. 1:35Sending the guesser costs more than the guessing saves
  7. 1:46A file gets smaller when you can guess what is in it
Show transcript

A file gets smaller when you can guess what is in it

A file gets smaller when you can guess what is in it.

The space a letter costs is set by how surprised you were to see it.
essay ngrok.com/blog

You zip a file and it gets smaller. Your phone guesses the next word in your message. An essay published yesterday shows those two obey the same rule.

A bit is one yes-or-no answer, and likely things need fewer of them

A bit is one yes-or-no answer, and likely things need fewer of them.

figures recomputed here · ngrok.com/blog

Picture five animals, each half as likely as the one before. A bird takes one yes-or-no answer to pin down. A bear takes four. Those answers are the bits, and every file on your computer is priced that way.

Only one message fits the range that is left

Only one message fits the range that is left.

A method from 1976 narrows the range with every character it reads.
A B A B A A C, seven characters, 56 bits written plainly against 10 encoded. Below it A A A A A A A A A A B C, twelve characters with ten of them the same letter, 96 bits written plainly against the same 10 encoded.
within 1% of the smallest possible size · Moffat, Neal and Witten, 1998
figures recomputed here · ngrok.com/blog

A method from nineteen seventy-six writes a whole message down as one number. Seven characters cost ten bits. A twelve-character string that is mostly one repeated letter costs the same ten. That method lands within about one percent of the smallest size the odds allow. The writing-down half is finished work.

The guess changed, and the phrase came out half the size

The guess changed, and the phrase came out half the size.

Each letter priced by the letter in front of it.
TO BE OR NOT TO BE, eighteen characters: 144 bits written plainly at 8 bits a character, 47 bits priced by how often each letter appears at 2.59 a character, and 21 bits priced by the letter before it at 1.16 a character.
less than half
of the 47 bits above
U · 2.9% of letters · 99.8% of the letters that follow a Q
measured here on 2.6 million letters of public-domain English
figures recomputed here · ngrok.com/blog

Take the phrase TO BE OR NOT TO BE. Written out plainly it costs a hundred and forty-four bits. Price each letter by how often it appears and the phrase costs forty-seven. Price each letter by the letter in front of it and the phrase costs twenty-one. A U is a rare letter in English. After a Q, the U is close to certain. So the guesser is the only part left worth improving. The best guessers we have for text are language models, trained to guess what word comes next. Give that model the text. The real next word is already known, so the model only prices it.

The 2019 model more than halved the letter-by-letter price

The 2019 model more than halved the letter-by-letter price.

The same quote costs 1,832 bits written out plainly.
a quarter of its plain size
a tenth of its plain size
figures recomputed here · ngrok.com/blog

The author ran the same test on a famous sentence from Charles Dickens. Pricing each letter by the letter before it got the quote down to a quarter of its plain size. Then GPT-2, a language model from twenty nineteen the author calls archaic, wrote the same quote at a tenth.

Sending the guesser costs more than the guessing saves

Sending the guesser costs more than the guessing saves.

Both ends of the connection need the same model before either one can open the file.
The essay’s own stepper, part-way through encoding: probability slices for each symbol and a range readout of 0.37984 to 0.39507 at step five of seven.
several gigabytes down
a few kilobytes saved
Annie Sexton · “Compression is prediction” · ngrok.com/blog · 11 August 2026

Your browser is not using any of this. Both ends of the connection need the same model to open the file. So every visitor downloads several gigabytes to save a few kilobytes.

A file gets smaller when you can guess what is in it

A file gets smaller when you can guess what is in it.
The best guessers we have for text are the models behind autocomplete.
ngrok.com/blog

The writing down is finished work. The guessing is not. Every bit you save from here comes from a better guess.