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.[src] For example, one simple method (not necessarily the best) is to average the probabilities assigned by each model.[src] The random forest is another method: it outputs the prediction that is the mode of the predictions output by individual models.[src] Combining models is an active area of research in machine learning.[src] The PAQ series of data compression programs use context mixing to assign probabilities to individual bits of the input.[src]
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.[src] For example, one simple method (not necessarily the best) is to average the probabilities assigned by each model.[src] The random forest is another method: it outputs the prediction that is the mode of the predictions output by individual models.[src] Combining models is an active area of research in machine learning.[src] The PAQ series of data compression programs use context mixing to assign probabilities to individual bits of the input.[src] For example, suppose that we are compressing a text file.[src] We wish to predict whether the next character will be a linefeed, given that the previous character was a period (context A ) and that the last linefeed occurred 72 characters ago (context B ).[src] Suppose that a linefeed previously occurred after 1 of the last 5 periods ( P(X|A=0.2 ) and in 5 out of the last 10 lines at column 72 ( P(X|B)=0.5 ).[src] How should these predictions be combined?[src] Two general approaches have been used, linear and logistic mixing.[src] Linear mixing uses a weighted average of the predictions weighted by evidence.[src] In this example, P(X|B) gets more weight than P(X|A) because P(X|B) is based on a greater number of tests.[src] Older versions of PAQ uses this approach.[src] Newer versions use logistic (or neural network) mixing by first transforming the predictions into the logistic domain, log(p/(1-p)) before averaging.[src] This effectively gives greater weight to predictions near 0 or 1, in this case P(X|A) .[src] 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.[src] All but the oldest versions of PAQ use adaptive weighting.[src] Most context mixing compressors predict one bit of input at a time.[src] The output probability is simply the probability that the next bit will be a 1.[src] We are given a set of predictions P_i(1) = n_{1i}/n_i , where n_i = n_{0i} + n_{1i} , and n_{0i} and n_{1i} are the counts of 0 and 1 bits respectively for the i 'th model.[src] The probabilities are computed by weighted addition of the 0 and 1 counts: S_0 = \sum_i w_i n_{0i} S_1 = \sum_i w_i n_{1i} S = S_0 + S_1 P(0) = \frac{S_0}{S} P(1) = \frac{S_1}{S} The weights w_i are initially equal and always sum to 1.[src] Under the initial conditions, each model is weighted in proportion to evidence.[src] The weights are then adjusted to favor the more accurate models.[src] Suppose we are given that the actual bit being predicted is y (0 or 1).[src] Then the weight adjustment is: w_i \leftarrow \max[0, w_i + (y - P(1)) \frac{S n_{1i} - S_1n_i}{S_0S_1}] Compression can be improved by bounding n_i so that the model weighting is better balanced.[src] In PAQ6, whenever one of the bit counts is incremented, the part of the other count that exceeds 2 is halved.[src] For example, after the sequence 000000001, the counts would go from (n_0, n_1) = (8, 0) to (5, 1) .[src] x_i = \text{stretch}(P_i(1)) P(1) = \text{squash}(\sum_i w_i x_i) where P(1) is the probability that the next bit will be a 1, P_i(1) is the probability estimated by the i 'th model, and \text{stretch}(x) = \ln(x / (1 - x)) \text{squash}(x) = \text{stretch}^{-1}(x) = 1/(1 + e^{-x}) After each prediction, the model is updated by adjusting the weights to minimize coding cost.[src] w_i \leftarrow w_i + \eta x_i (y - P(1)) where \eta is the learning rate (typically 0.002 to 0.01), y is the predicted bit, and ( y - P(1) ) is the prediction error.[src]
34 sentences · 34 cited inline · 0 references stored
References
No reference rows published for this article.
Cite this article
MLA
"Context mixing." encyclopegia.org, 2026, https://encyclopegia.org/wiki/context-mixing. Accessed 29 November 2026.
Chicago
"Context mixing." encyclopegia.org. Accessed November 29, 2026. https://encyclopegia.org/wiki/context-mixing.
APA
encyclopegia.org. (2026). Context mixing. Retrieved November 29, 2026, from https://encyclopegia.org/wiki/context-mixing
Accessed November 29, 2026 · CC BY-SA 4.0 · citation page · JSON