Skip to content

Prediction by Partial Matching

Estimate the next symbol from adaptive continuation statistics at the longest informative recent context, backing off to shorter contexts when the continuation is unseen.

Core Idea

Prediction by partial matching (PPM) estimates the next discrete symbol from observed continuations of recent symbol histories. It first uses the longest informative suffix context; when a symbol has not previously followed that context, classic PPM reserves escape probability and falls back to a shorter suffix. The model updates as new symbols arrive. Escape is about an unseen continuation, not necessarily an entirely unseen context.[1]

The probabilities can feed a coder for lossless compression, but coding is not part of the predictor's necessary identity. Dasher uses a PPM5D+ character model to organize an interactive text-entry display. Maximum order, escape estimate, exclusion policy and treatment of novel symbols vary across implementations.[1][2]

How would you explain it like I'm…

The Next-Letter Guesser

Imagine guessing the next letter in a word. You look at the last few letters and think, 'What came next the other times I saw these letters?' If you've never seen those letters before, you look at fewer letters instead, until you find something you remember. And every time you see the real letter, you remember it for next time.

Shrinking-Clue Guessing

Prediction by Partial Matching (PPM) is a way for a computer to guess the next letter or symbol by looking at what came right before. It first looks at the longest recent stretch it has seen before and checks what usually came next. If the next symbol has never followed that stretch, it 'escapes' to a shorter stretch, and keeps shortening until it finds something useful. After each real symbol arrives, it updates its counts, so it keeps learning. These guesses can help squeeze files smaller, or help other tools, like a typing program that makes likely letters bigger and easier to pick.

Variable-Context Adaptive Prediction

Prediction by Partial Matching (PPM) is an adaptive model that assigns probabilities to the next symbol in a sequence based on the symbols just before it (the context). It starts with the longest available context. If the actual next symbol has never followed that context, PPM assigns some probability to an 'escape' to a shorter context and tries again, repeating until the symbol can be predicted, even from no context at all. After seeing each symbol, it updates its statistics. These probabilities are often fed to an arithmetic coder for lossless compression, but the coder just uses the predictions; it isn't part of PPM itself. The text-entry system Dasher, for example, used a PPM model to size the regions users select characters from. PPM is a family of methods: details like the maximum context length and how escapes are estimated vary.

 

Prediction by partial matching (PPM) is an adaptive, variable-order context model for discrete sequences. To predict the next symbol, it consults the longest usable suffix context of the recent history and the statistics of what has followed it. If the actual continuation has not been observed in that context, classic probabilistic PPM allocates probability to an escape event that moves to the next shorter suffix, repeating until the symbol can be coded or represented (with a final fallback for novel symbols). Context statistics are updated after each observation. It is thus a probability model, not merely a repeated-substring search. Its estimates can drive an arithmetic coder for lossless compression, as in its original lineage, but the coder is a consumer of the model rather than a component; Dasher, for instance, used a PPM5D+ model to size interactive character-selection regions, updating it as characters were entered, without producing compressed output. PPM is a family: maximum order, escape estimator, exclusion policy and treatment of entirely new symbols vary across implementations.

Scope of Application

Cleary and Witten's original compression experiments included a gray-scale image serialized in raster order, so previous sample values rather than English letters formed the symbol context. The original paper's indexed sample statement supports this input example; its full PDF could not be opened here, and no image-specific performance result is claimed.[3] In Dasher, previously entered characters provide context; PPM5D+ next-character probabilities size interactive regions, and entered characters update the model. Dasher's probability floor is an interface adaptation, not a universal PPM rule.[2]

Both settings share ordered symbols, learned context-conditioned continuations, more-specific-first use, a route for low- or unseen-probability symbols, and adaptive updates. The consumers differ: a compressed representation in one, an interface display in the other. An indirect-branch target predictor also calls itself PPM, but uses approximate history tables and highest-valid-history selection; it is an adaptation, not evidence that all variants perform classic novelty-escape probability coding.[1][2][4]

Clarity

PPM is neither a repeated-string dictionary nor arithmetic coding. The string match selects a context and its continuation statistics; the coder, when present, consumes probabilities. A fixed-order Markov table likewise omits the shorter-suffix fallback that distinguishes classic PPM. It would be wrong to assert one universal order −1 fallback or one escape formula from Moffat's particular variants.[1]

Manages Complexity

The context hierarchy lets a predictor exploit specific histories without requiring every long history to have seen every possible next symbol. When long contexts are sparse, shorter contexts provide a route for a continuation. The cost moves to maintaining context data, estimating escape probability and conducting multiple lookups. Moffat discusses memory/coding tradeoffs; Dasher needs repeated estimates fast enough for interaction.[1][2]

Abstract Reasoning

Given a recent symbol suffix, consult the longest usable context's observed continuations. If the target symbol is represented, estimate its mass under the chosen variant; otherwise allocate escape mass and consult a shorter suffix. After the symbol is observed, update the statistics. More escape mass protects novel continuations but takes mass from known ones; more context detail may sharpen estimates but costs memory and time. These are diagnostic tensions, not promises of one optimal PPM variant.[1]

Knowledge Transfer

The same conditional-probability organization transfers from a raster-ordered image-symbol stream to Dasher's interactive character stream. Only the alphabet, output consumer and implementation constraints change. The broader maxim “use specific evidence, then fall back” is not itself PPM without ordered symbols and continuation probabilities. Accordingly this remains a domain-specific method. Live Compression is related but not a strict parent, because Dasher's predictor need not compress; Predictive Coding is also a distinct neighbor.

Neighborhood in Abstraction Space

Prediction by Partial Matching sits in a sparse region of the domain-specific corpus (69th percentile for distinctiveness): few abstractions share its structure, so a faithful description tends to retrieve it precisely.

Family — Scaling Laws & Growth Patterns (13 abstractions)

Nearest neighbors

Computed from structural-signature embeddings · 2026-11-14

References

[1] Alistair Moffat, “Implementing the PPM Data Compression Scheme”, IEEE Transactions on Communications 38(11), 1917–1921 (1990), original full paper §§II–III inspected 2026-10-01. registry ↩a ↩b ↩c ↩d ↩e ↩f

[2] David J. Ward, Alan F. Blackwell and David J. C. MacKay, “Dasher—a data entry interface using continuous gestures and language models”, original UIST 2000 author manuscript §§4.1–4.5 inspected 2026-10-01; publisher DOI. registry ↩a ↩b ↩c ↩d

[3] John G. Cleary and Ian H. Witten, “Data Compression Using Adaptive Coding and Partial String Matching”, IEEE Transactions on Communications 32(4), 396–402 (1984), original-paper indexed abstract and §III sample excerpt inspected 2026-10-01; direct PDF opening failed, so no sample-specific results are inferred. registry ↩

[4] John Kalamatianos and David R. Kaeli, “Predicting Indirect Branches via Data Compression”, original MICRO 1998 author-hosted paper §§3–4 inspected 2026-10-01; cited as an adaptation boundary only. registry ↩