Faster Superword Tokenization

Craig W Schmidt, Yuval Pinter, Chris Tanner

TL;DR

This paper introduces a massive 600-fold speedup for "superword" tokenization—a method that allows Large Language Models (LLMs) to represent multi-word phrases as single tokens. By moving to a two-phase training process and a clever data aggregation strategy, the authors reduced training time on a 1GB dataset from 4.7 days to just 10 minutes, making these high-performance tokenizers practical for real-world use.

What Problem Does This Paper Address?

Most LLMs today use Byte Pair Encoding (BPE) for tokenization. However, standard BPE has a major limitation: it cannot create tokens that cross "pre-tokenization" boundaries, such as spaces or punctuation. This means a single token can represent a sub-word (like "token" and "ization") or a full word, but never a phrase like "of the" or "New York."

Recent algorithms like BoundlessBPE and SuperBPE solved this by allowing "superwords"—tokens that span across these boundaries. While these methods improve compression and model accuracy, they were notoriously slow to train because they required keeping entire documents in memory to track potential phrase merges. For many researchers, the computational cost simply wasn't worth the gain.

Methods

The authors introduce three key innovations to make superword tokenization efficient:

  1. Two-Phase Formulation: Instead of trying to learn word-level and phrase-level merges simultaneously, they split the process. Phase 1 trains a standard BPE model to the target vocabulary size. Phase 2 then "replays" these merges while interleaving them with potential supermerges (phrases).
  2. Candidate Aggregation: The "aha" moment of the paper is that you don't need to store full documents. Just as standard BPE aggregates unique words into a frequency table, the authors show that "supermerge candidates" (sequences of words eligible to become a phrase) can also be aggregated by frequency. This drastically reduces the number of operations needed during training.
  3. Script-Specific Pre-tokenization: For languages that don't use spaces (like Chinese or Japanese), the authors introduced a strategy that treats each multi-byte character as its own pretoken. This prevents the creation of "broken" tokens that contain partial bytes from two different characters, a common issue in multilingual tokenization.

Datasets

The researchers used two primary datasets for their analysis:

  • MiniPile: A 5.9GB corpus of 1 million documents used for the main timing and scaling experiments.
  • CulturaX: A massive multilingual dataset. The authors used the first 100,000 documents from several languages (English, Chinese, Arabic, etc.) to test how their aggregation methods performed across different scripts.

Key Insights and Ideas

  • Algorithmic Speedup > Language Speedup: While the authors released a fast Rust implementation, they emphasize that the 600x speedup comes primarily from the aggregation logic, not just the programming language. The Python version of their new method is still significantly faster than the original implementations.
  • Unifying the Field: The paper demonstrates that BoundlessBPE and SuperBPE are mathematically near-equivalent. The main difference is that SuperBPE requires a manually tuned hyperparameter for the number of phrases, whereas BoundlessBPE determines this automatically during its second phase.
  • The "Shortcut" for Inference: They found that in standard BPE, 90% of words end up as single tokens. By simply checking if a whole word exists in the vocabulary before trying to break it into sub-words, they achieved a nearly 3x speedup in inference time for Python.

Key Results

  • Massive Efficiency Gains: On a 1GB subset of MiniPile, training time dropped from 406,000 seconds (4.7 days) to just 603 seconds (10 minutes) for BoundlessBPE.
  • Scaling: The new implementation scales sublinearly with vocabulary size. Once the initial cost of pre-tokenization is paid, expanding the vocabulary is relatively "cheap."
  • Open Source: The authors open-sourced both a reference Python implementation (for experimentation) and a high-performance Rust implementation (for production), both of which produce identical results.

Limitations and Future Work

  • Single-Threaded: The current implementation is single-threaded. The authors note that adding multi-threading could provide even further speed improvements.
  • Greedy Splitting Approximation: To speed up very long sequences, the authors tested a "greedy splitting" heuristic. While it aggregates data even more efficiently, it is an approximation that might slightly change the final vocabulary compared to the original algorithm.
  • Downstream Impact: While this paper focuses on the speed of training, it does not provide new benchmarks on how these tokens affect LLM reasoning or creativity, though it notes that previous work on SuperBPE already showed a 4% accuracy improvement across various tasks.

Summary updated

BibTeX
@inproceedings{schmidt2026faster,
  author = {Craig W Schmidt and Yuval Pinter and Chris Tanner},
  title = {{Faster Superword Tokenization}},
  booktitle = {COLM},
  year = {2026},
  url = {https://openreview.net/forum?id=0IJGXz4Wnv},
}
Figure