Efficient Lempel-Ziv Prediction with the Run-Length BWT
Organizations: Computational Rational Agents Laboratory (CORAL)
Abstract
Lempel-Ziv Plurality (LZP) is an algorithm of Kosoy that predicts the next symbol of a string by using its Lempel-Ziv factorization, and makes at most mistakes on every string of length with LZ77 phrases. We give efficient online implementations of LZP and of a new variant of it. Our first implementation maintains a run-length encoded Burrows-Wheeler transform (RLBWT) of the reversed history. It implements LZP, uses bits, and has worst-case update and prediction times and , respectively, where is the size of the alphabet. This is an exponential improvement over Kosoy's implementation, whose update time is . We then introduce the Lempel-Ziv Majority (LZM) predictor, which has the same mistake bound and update time, and predicts in time independently of . These two predictors accept new symbols at any time, without knowing the alphabet in advance. For an alphabet known in advance, a different data structure gives time per symbol, which is constant when and .
Figures & tables
| Predictor | Update | Prediction | Space (bits) | Alphabet |
|---|---|---|---|---|
| LZP (Kosoy) | fixed | |||
| RLBWT-LZP | dynamic | |||
| RLBWT-LZM | dynamic | |||
| RLBWT-LZP, alphabet-indexed | fixed |