All stories
Markov Chains: From a Poetry Dispute to Language Models (1906)  -  Mathematics | AI History by CobuildX
CobuildX
1906Mathematics

Markov Chains: From a Poetry Dispute to Language Models

Markov Chains were invented to prove free will doesn't exist in Russian poetry.

Markov chainsAndrei MarkovMarkov propertyHidden Markov Modelsstatistical NLPlanguage models history

In 1906, Andrei Markov, a mathematician at St. Petersburg, was involved in a dispute with his colleague Pavel Nekrasov. Nekrasov had published a paper claiming that the law of large numbers (roughly: averages stabilise with large samples) required that events be independent of each other. He used this, controversially, to argue that free will existed, because independent choices could aggregate to predictable societal outcomes.

Markov thought this was philosophically absurd and mathematically wrong. He set out to prove that the law of large numbers applied even to dependent events, sequences where each outcome depended on the one before it. He developed the mathematical framework for what became Markov Chains: sequences of states where the probability of each state depends only on the previous state (the "memoryless" or Markov property).

To demonstrate his point concretely, Markov did something unusual for a pure mathematician: he manually counted vowels and consonants in the first 20,000 letters of Pushkin's poem "Eugeny Onegin." He built a transition matrix, the probability of a vowel following a consonant, a consonant following a vowel, and so on. He showed that the sequence of letters obeyed his laws despite depending on each other. Poetry, he demonstrated, was neither random nor free: it was a chain of probabilistic dependencies.

Markov Chains became foundational across science and engineering. Hidden Markov Models (HMMs), where the chain's states are unobservable but emissions are observable, powered speech recognition systems from the 1970s through the 2000s. Every speech recognition system before neural networks was essentially a carefully engineered HMM. Markov Chain Monte Carlo methods (MCMC) underpin Bayesian statistics and physical simulation.

And then language modelling. N-gram models, the first statistical approach to text prediction, are essentially Markov Chains over words. The probability of each word depends on the previous N words. These models, combined with HMMs, generated the first decent automatic speech recognisers, machine translation systems, and predictive text. The chain from Markov's 1906 Pushkin analysis to the statistical language models that preceded GPT is direct. He was trying to settle a philosophical argument about free will. He accidentally built the mathematical foundation of language AI.

What it actually meant

The Markov property, that the future depends only on the present, is a simplification that turns out to be approximately right for an enormous range of real-world sequences. The model's power comes from this constraint, not despite it. Approximately correct simplifying assumptions are more useful than exactly correct complex models applied in the wrong regime.

What enterprises get wrong today

Enterprises dismiss simpler sequence models as too primitive and reach for deep learning even when the data has short-range dependencies and limited examples per state. A Markov chain with well-estimated transition probabilities will outperform an undertrained LSTM with fifty examples per state. Simple models that fit the data beat complex models that overfit it.

Related capabilities

AI History

Ask about this story

Explore this history

Markov built his chains to win an argument about free will in Russian poetry, and ended up creating the mathematical foundation of speech recognition, Bayesian statistics, and the statistical language models that preceded GPT. What would you like to dig into?