Synchronizing Probabilities in Model-Driven Lossless Compression
Aviv Adler, Jennifer Tang
TL;DR
This work tackles prediction mismatch in model-driven lossless compression caused by LLM non-determinism, formalizing a bounded-logit deviation setting and its impact on decoding. It introduces PMATIC, a model-agnostic Probability Matching Interval Coding scheme that uses bin-based quantization of next-bit probabilities and helper bits to ensure encoder/decoder agreement, guaranteeing correct decoding when the mismatch is bounded by $\varepsilon$ (with $\delta$ linked to $\varepsilon$). The authors provide a correctness proof and derive compression-loss bounds, showing the total overhead scales as $O(\sqrt{\delta \log(1/\delta)})$ with an optimally chosen bin width $r$. Empirically, PMATIC on text with Llama 3.1 demonstrates robustness to synthetic prediction mismatch and achieves substantially better compression than gzip, illustrating practical viability for robust, high-performance model-driven compression.
Abstract
It is well-known in the field of lossless data compression that probabilistic next-symbol prediction can be used to compress sequences of symbols. Deep neural networks are able to capture rich dependencies in data, offering a powerful means of estimating these probabilities and hence an avenue towards more effective compression algorithms. However, both compressor and decompressor must have exactly matching predictions; even small non-deterministic differences (which often happen with learned models due to hardware, software, or computation order) can lead to cascading decoding failures. In this paper, we formalize the problem of prediction mismatch in model-driven compression, and introduce Probability Matching Interval Coding (PMATIC), a model-agnostic algorithm that tolerates bounded prediction mismatch with low overhead. PMATIC works with the predicted probabilities, making it compatible as a drop-in replacement for the arithmetic encoder in model-driven compression tools. We show theoretical correctness and performance bounds for PMATIC, and validate these results on text data. These results confirm that, when paired an advanced prediction model, PMATIC is robust to prediction mismatch while achieving compression rates that out-perform standard modern compression tools.
