HoloCodec adapts the multiple context length strategy from Prediction by Partial Matching (PPM) algorithms. Rather than relying on a single fixed context window, the system maintains parallel probability matrices for different context orders.
For each context length k ∈ {0, 1, 2, 3, ..., n}, HoloCodec maintains:
Pk(s | context[−k:]) = softmax(Wk · φk(context[−k:]))
At each encoding step, HoloCodec employs a gating mechanism to determine which context length provides the most confident prediction:
1. Compute Confidence Scores: Evaluate prediction confidence for each context k
2. Expert Gating:
gk = confidence_score(Pk) → which expert is most certain?
3. Select Winner:
k* = argmaxk(gk) → choose highest confidence context
4. Encode Symbol: Use Pk* distribution for range encoding
This approach allows the compressor to dynamically select the optimal context length based on local data characteristics:
Unlike traditional PPM which uses escape codes to blend contexts, HoloCodec makes a decisive selection per symbol based on confidence. This reduces overhead and allows the model to fully commit to the most informative context.