Retro Lab · History
From Shannon's bits to Claude's tokens
In 1948, Claude Shannon generated English-like text by hand, picking each letter or word according to how often it follows the ones before.1 Today's large language models make the same kind of prediction, learned from vast amounts of text.2
Specimens excerpted from Shannon's "A Mathematical Theory of Communication" (1948). He made the first two with a book of random numbers and a table of letter frequencies, and the rest by opening printed books at random, one letter or word at a time.1
Three threads from 1948 to today
Shannon did not invent language models. He supplied the ideas they are built and measured on. Each thread below starts in his papers and runs through later work into how models like Claude are trained.
Prediction
Language can be modeled as guessing what comes next.
- 1948
Shannon generates English-like text from letter and word statistics, and concludes that a complex enough random process can represent a language source.1
- 1951
In "Prediction and Entropy of Printed English," a test subject guesses a passage letter by letter, and the guesses measure how predictable English is.5
- 2003
Bengio and colleagues train a neural network to predict the next word, learning word embeddings along the way.6
- 2017
The Transformer's attention mechanism trains far more in parallel than earlier networks,7 which made next-token prediction practical at very large scale.8
- Today
Language models write each response one token at a time, sampling from a learned probability distribution over their vocabulary.910
Measurement
Information has a unit, and predictability can be counted in it.
- 1948
Shannon defines entropy and names its unit the bit, a word he credits to John Tukey.111
- 1951
With up to 100 letters of context, English carries roughly one bit per letter, within Shannon's estimated bounds of about 0.6 to 1.3.5
- n-gram era
Cross-entropy and perplexity, both built on Shannon entropy, become standard yardsticks for comparing language models.6
- 2020
Scaling-laws research, four of whose ten authors later co-founded Anthropic, shows cross-entropy loss falling predictably with model size, data and compute, and notes the trend must level off because language itself has non-zero entropy.812
- Today
Pretraining means minimizing cross-entropy: how surprised the model is by the actual next token, measured in Shannon's units.8
Compression
A better predictor is a better compressor, and the reverse.
- 1948
The source coding theorem: no code can average fewer bits per symbol than the source's entropy, and good codes can come arbitrarily close.1
- 1994
Philip Gage's Byte Pair Encoding compresses files by repeatedly replacing the most common pair of bytes with a single unused byte.13
- 2006
The Hutter Prize rewards compressing Wikipedia, treating compression as a measurable stand-in for intelligence.14
- 2016
Sennrich and colleagues adapt BPE to split words into subword tokens. Its descendants are how most LLMs tokenize text.1510
- 2023
Google DeepMind's "Language Modeling Is Compression" shows the 70B Chinchilla model, trained mostly on text, compressing image patches to 43% and audio to 16% of their raw size, better than PNG (58%) and FLAC (30%), not counting the size of the model itself.16
The same experiment, at a different scale
Shannon's subject predicted the next letter from up to 100 letters of preceding text.5 According to Anthropic's documentation, current Claude models can draw on up to a million tokens,17 at least ten thousand times as much text. Bars are not to exact scale; at true scale Shannon's would be invisible.
The groundwork beneath it all
Shannon's other contributions shaped the hardware AI runs on and the field of AI itself.
Logic in circuits
His MIT master's thesis showed Boolean algebra can describe switching circuits.1811 Every chip running a model today is, at bottom, a vast switching circuit.
Search and evaluation
"Programming a Computer for Playing Chess" laid out look-ahead search scored by an evaluation function.19
A machine that learns
Theseus, his relay-controlled mechanical mouse, found its way through a maze by trial and error and remembered the route.202111
Proposing the field
Shannon co-authored the 1955 Dartmouth proposal, whose title used the term "artificial intelligence" and which set the goal of finding "how to make machines use language."22
For how today's models use that groundwork, part by part, see the book AI, from the Parts Up.
In Shannon's words
"reproducing at one point either exactly or approximately a message selected at another point"
The fundamental problem of communication, 1948, p. 3791His definition of the problem. A language model is, in a sense, an engine for the "approximately" half.
"of the order of one bit per letter"
Prediction and Entropy of Printed English, 1951, p. 505His estimate of how much new information each letter of English carries once context is known.
"a point at which this statistical approach is going to break down"
Discussion of "The Redundancy of English," Macy Conference on Cybernetics, 1950 (published 1951), p. 13923Shannon doubted statistics could capture the long-range structure of language. Modern LLMs test that doubt at a scale he never saw.
"it has perhaps been ballooned to an importance beyond its actual accomplishments"
The Bandwagon, 1956, p. 3, on information theory's popularity24Shannon cautioned against overselling his own theory. It remains good advice for how we talk about AI.
Read more
On my reading list
A Mind at Play
Jimmy Soni and Rob Goodman's biography, How Claude Shannon Invented the Information Age (New York: Simon & Schuster, 2017).11 The story behind everything on this page, from the thesis to the unicycles. It's in my books list.
- Claude ShannonHis life, his work and his inventions.
- A Mathematical Theory of CommunicationThe 1948 paper behind the specimens above.
- Information theoryThe field the paper founded.
- Entropy (information theory)The measure that training loss is built on.
- Shannon's source coding theoremWhy a better predictor is a better compressor.
- A Symbolic Analysis of Relay and Switching CircuitsHis 1937 master's thesis.
- Dartmouth workshopThe 1956 summer project; its 1955 proposal used the term "artificial intelligence."
- Byte-pair encodingFrom file compression to LLM tokenizers.
Links go to English Wikipedia, for further reading only; the claims on this page rest on the sources below.