PPM uses three interlocking mechanisms to achieve high compression ratios on sequential data:
- Context Modeling: The algorithm uses a Markov model of order n, where n is the number of previous symbols used for prediction.
- Blending & Escape Symbols: If a symbol has not been seen in the current n-order context, an escape symbol is emitted, and the algorithm "escapes" to a shorter (n-1) context to attempt a new prediction. This continues until a match is found or it reaches a default order-0 or order-(-1) context.
- Arithmetic Coding: The final predicted probabilities are typically processed using an arithmetic coder to produce the compressed output.