Efficient Lempel-Ziv Prediction with the Run-Length BWT
Ohad Avnery
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 O(z n) mistakes on every string of length n with z 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 O(z z2 n) bits, and has worst-case update and prediction times O( z+ n) and O(σ( z+ n)), respectively, where σ is the size of the alphabet. This is an exponential improvement over Kosoy's implementation, whose update time is O(z7 n). We then introduce the Lempel-Ziv Majority (LZM) predictor, which has the same mistake bound and update time, and predicts in O(1) 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 O(σ(1+ z/ n)) time per symbol, which is constant when σ=O(1) and z=polylog(n).
Create a lesson
Related papers
State Evolution and Universality of Iterated Linear Programs for the Binary Perceptron
Jianan Zhang, Shuangping Li
Metric TSP in Sublinear Time: Breaking Two Approximation
Amir Azarmehr, Soheil Behnezhad
Testing Implies Distance Estimation with Polynomial Loss
Gaia Carenini, Cameron Seth
Online Metric Matching with Unknown i.i.d. Arrivals
Tsubasa Harada
Incremental Open Addressing Has No Time-Space Tradeoff
Martín Farach-Colton, Andrew Krapivin, William Kuszmaul
A Constant-Factor Approximation for Capacitated Facility Location with Outliers
Rajni Dabas