Component-Weighted Centroid Search for Exact Incremental BPE
Harshit Verma, Rex Ying
Key points
From the paper's conclusion- We also construct a normalized proper BPE family over a fixed alphabet where count-balanced search uses $Θ(\log^2 t)$ probes on a reachable update, while the weighted search uses $Θ(\log t)$.
Abstract
Exact incremental BPE maintains the canonical tokenization state after every appended byte. The recent algorithm of Jiang and Gong (2026) does this in $O(\log^2 t)$ worst-case time, where $t$ is the maximum canonical token length. Its centroid search visits $O(\log t)$ components and can pay another $O(\log t)$ for ordered point location at each one. Within Jiang and Gong's normalized/proper merge-stage model, we change only that local search. Each interval is weighted by the size of the recursive component it selects, so a move from size $m$ to size $m'$ costs $O(1+\log(m/m'))$. These charges telescope, giving $O(\log t)$ time per append and $O(n\log t)$ over an $n$-byte stream, with the same BPE semantics and asymptotic space. We also construct a normalized proper BPE family over a fixed alphabet where count-balanced search uses $Θ(\log^2 t)$ probes on a reachable update, while the weighted search uses $Θ(\log t)$. A Rust implementation matches the predicted probe counts on every tested instance. On ordinary vocabularies the queried degrees are small, however, and the improvement is a worst-case guarantee rather than an average-speed result.
Read the paper
Discussion
Science Skim's AI key points, plus readers' public thoughts
Readers' thoughts
No reader thoughts yet.
Related papers
- Greedy Byte-Pair Encoding Achieves at Least 0.361 of the Optimal CompressionarXiv · 2026
- Rethinking BPE: Merge Selection as Model SelectionarXiv · 2026
- Pair-Merge Tokenisation Is Hard to Approximate on Binary Strings and Strongly NP-Hard on Unary DatasetsarXiv · 2026
- Revisiting (Bijective) Burrows-Wheeler Transform Space-Time Trade-Off ConstructionsarXiv · 2026
- Adaptive encodings for small and fast compressed suffix arraysACM Transactions on Algorithms · 2026
- The Left Ripple of Byte-Pair Encoding: Certified Lookbehind for Every DictionaryarXiv · 2026