Wikipedia / Context mixing
Wikipedia / Context mixing
Context mixing is a type of data compression algorithm in which the next-symbol predictions of two or more statistical models are combined to yield a prediction that is often more accurate than any of the individual predictions. For example, one simple method (not necessarily the best) is to average the probabilities assigned by each model. The random forest is another method: it outputs the prediction that is the mode of the predictions output by individual models. Combining models is an active area of research in machine learning.
The PAQ series of data compression programs use context mixing to assign probabilities to individual bits of the input.
Application to Data Compression
. There is insufficient information for probability theory to give a result. In fact, it is possible to construct scenarios in which the result could be anything at all. But intuitively, we would expect the result to be some kind of average of the two.
are the probability estimates by two independent models. The compression ratio in each context, but the two contexts either have not occurred together frequently, or there are insufficient computing resources (time and memory) to collect statistics for the combined case.
). How should these predictions be combined?
is based on a greater number of tests. Older versions of PAQ uses this approach. Newer versions use logistic (or neural network) mixing by first transforming the predictions into the logistic domain, log(p/(1-p)) before averaging.. In both cases, additional weights may be given to each of the input models and adapted to favor the models that have given the most accurate predictions in the past. All but the oldest versions of PAQ use adaptive weighting.
Most context mixing compressors predict one bit of input at a time. The output probability is simply the probability that the next bit will be a 1.
Linear Mixing
'th model. The probabilities are computed by weighted addition of the 0 and 1 counts:
(0 or 1). Then the weight adjustment is:.
Logistic Mixing
is calculated:
'th model, and
After each prediction, the model is updated by adjusting the weights to minimize coding cost.
) is the prediction error.
List of Context Mixing Compressors
All versions below use logistic mixing unless otherwise indicated.
All PAQ versions (Matt Mahoney, Serge Osnach, Alexander Ratushnyak, Przemysław Skibiński, Jan Ondrus, and others) https://mattmahoney.net/dc/paq.html. PAQAR and versions prior to PAQ7 used linear mixing. Later versions used logistic mixing.
All LPAQ versions (Matt Mahoney, Alexander Ratushnyak) https://mattmahoney.net/dc/#lpaq.
ZPAQ (Matt Mahoney) https://mattmahoney.net/dc/#zpaq.
WinRK 3.0.3 (Malcolm Taylor) in maximum compression PWCM mode https://www.msoftware.co.nz/. Version 3.0.2 was based on linear mixing.
NanoZip (Sami Runsas) in maximum compression mode (option -cc) https://web.archive.org/web/20150717170923/http://nanozip.net/.
xwrt 3.2 (Przemysław Skibiński) in maximum compression mode (options -i10 through -i14) https://sourceforge.net/projects/xwrt/files/ as a back end to a dictionary encoder.
cmm1 through cmm4, M1, and M1X2 (Christopher Mattern) use a small number of contexts for high speed. M1 and M1X2 use a genetic algorithm to select two bit masked contexts in a separate optimization pass.
ccm (Christian Martelock).
bit (Osman Turan) https://web.archive.org/web/20110725042648/http://www.osmanturan.com/bit07.zip.
pimple, pimple2, tc, and px (Ilia Muraviev) https://web.archive.org/web/20100921013136/http://lovepimple.110mb.com/.
enc (Serge Osnach) tries several methods based on PPM and (linear) context mixing and chooses the best one. http://www.compression.ru/so/
fpaq2 (Nania Francesco Antonio) using fixed weight averaging for high speed.
cmix (Byron Knoll) mixes many models, and is currently ranked first in the Large Text Compression benchmark, as well as the Silesia corpus and has surpassed the winning entry of the Hutter Prize although it is not eligible due to using too much memory.
References