Part I · Chapter 3

The Redundancy of Language

Twenty-six letters and a space could carry about 4.75 bits per character if every one were equally likely and independent. English carries far less. The rest is redundancy: letters you could have guessed. Here you measure it with your own guesses.

Watch someone play hangman. With the board showing T H _  Q U _ C K, nobody needs another clue: the blanks are E and I. Your phone's keyboard plays the same game every time it offers to finish a word for you. Neither trick would work if letters were drawn at random. They work because written language is full of patterns, and every pattern is a chance to guess ahead.

In Chapter 2 we measured the entropy of coins and dice. Language is a far richer source, and here is the twist: its entropy depends on how much of the past you are allowed to look at. The more context you use, the more predictable the next letter, and the fewer bits it really carries.

The guessing game

In 1951 Shannon published a beautifully simple experiment. Show a person a piece of text one letter at a time, and before each letter ask them to guess it, counting how many guesses they need. A letter guessed on the first try was barely news; a letter that took ten guesses was a genuine surprise. Play it yourself below. Spaces count as a symbol, so there are 27 possible answers each time.

Interactive 3.1Guess the Next Letter
Tap letters (or type on your keyboard after clicking the sentence)
darker amber = more guesses needed (more surprise) the letter you are guessing now
 
Once a word is under way, many letters fall on the first guess: the end of "questio_" is no mystery. The hard letters are at the starts of words. The outline histogram shows a simple computer model that looks at only the previous three characters (trained on a few pages of sample text in this book); it is decent, but a well-read human can often beat it, because people use far more context than three letters.

Count your first-guess letters. Every one of them was a letter that cost you almost no surprise, so a cleverer storage system would not have needed to spend a full 4.75 bits (let alone 8) on it. That is what redundancy means: the part of a message that could have been predicted from the rest.

Redundancy

Redundancy is the share of a message's capacity that is spent on symbols you could already have predicted.

Why the "u" after "q" tells you nothing

The cleanest example lives in the dictionary. In English, the letter q is almost always followed by u. So once you have seen a q, the u that follows was nearly certain, and by Chapter 1 a nearly certain event carries nearly zero bits of surprise. The u still takes up a slot on the page, but it brings no news.

Below, type any context (the text just before the next letter) and see how the letters that followed it are spread out in this book's sample text, a few pages of plain English prose. The model uses up to three characters of context; if a context never appears in the sample, it falls back to a shorter one.

Interactive 3.2What Context Buys You
Type a context or pick one
how often each letter came next, in the sample entropy of those next-letter counts (and with no context)
 
After "q", the sample shows u every single time: the next-letter entropy is 0 bits. After "th" it is mostly e, then a or i; after a space, almost anything can follow, which is why the starts of words are where your guesses failed. These numbers are the entropy of counts from one sample, a model of English, not English itself. Real English has rare exceptions such as "Iraq" or "qi", so a careful model would give the u a probability just below 1 and a surprise just above 0.

Notice the "the␣" context (with a space after it): the next letter is the start of a new word, and the bars spread out again. Letter-level context helps most inside words. To predict the start of the next word you need to understand the sentence, which is exactly the job that language models are built to do (Chapter 12).

A ladder of models

Now put a number on it. Take a piece of English the models have never seen and ask: if each letter were coded according to a model's predictions, how many bits per letter would it cost on average? (Chapter 12 explains why "average surprise under the model" is exactly that cost.) Climb the ladder from a model that knows nothing to one that remembers three characters.

Interactive 3.3The Model Ladder
Pick a test text, or type your own
average surprise per letter of the test text under each model 4.75 bits: 27 equally likely symbols, the ceiling
 
On unseen English each rung saves bits: from 4.75 down to well under 3 bits per letter with three letters of context, even though the models learned from only a few pages. With random letters the ladder turns upside down: the English models confidently predict the wrong things and pay more than 4.75 bits. A model only saves bits on text that matches its patterns.

How far down does the ladder go? Models with more context and far more training text keep descending. Shannon's own 1951 guessing experiments with people, who bring a lifetime of reading to the task, suggested that with a long stretch of preceding text English carries somewhere roughly between 0.6 and 1.3 bits per letter. Treat any such figure as approximate: it depends on the text, the guessers, and the method. But the conclusion is robust. If English carries around a bit per letter while its 27 symbols could carry 4.75, then most of the space on a page is redundancy.

redundancy = 1 − (bits per letter actually needed) / (maximum bits per letter) "The fraction of the page you could have predicted." With 2.4 bits needed out of 4.75 possible, about half the page is predictable; with 1 bit, about four-fifths.

Redundancy is not waste

It would be easy to read all this as "English is bloated". The opposite is closer to the truth. Redundancy is what lets you read a smudged sign, follow a conversation in a noisy café, or spot a typo. When some letters are lost, the patterns let you rebuild them. That is the theme of Part III: engineers protect messages against noise by adding redundancy on purpose, in carefully designed patterns.

And redundancy is what compression feeds on. A compressor is, at heart, a guesser: it spends few bits on what it predicted and more on what surprised it. Part II starts there. Random letters, with no patterns to exploit, give a compressor nothing to eat.

Two sides of one coin

Compression removes redundancy so a message takes less space; error correction adds redundancy back, in a controlled form, so the message survives noise. The rest of this book is a tour of both.

Intuition Check

In the guessing game, where in a word do people most often need many guesses?

Intuition Check

Why did the English-trained models cost more than 4.75 bits per letter on random letters?

Connections

What you now see

  • Letters in English are not independent: context makes many of them easy to guess, and an easily guessed letter carries little information.
  • The "u" after "q" is the extreme case: nearly certain, so nearly zero bits.
  • Better models (more context) cut the bits per letter of unseen English, from 4.75 toward something like a bit per letter for skilled human guessers; any such figure is approximate and model-dependent.
  • Redundancy is the predictable share of a message. Compression removes it; error correction adds a controlled form of it back.
  • A model only saves bits on text that fits its expectations; on random letters an English model does worse than no model at all.