TL;DR
This paper introduces BoundlessBPE, a novel Byte Pair Encoding (BPE) variant that breaks free from pre-tokenization boundaries to create "superwords." This approach leads to a more uniform token distribution, better text compression, and potentially improved language model performance by addressing a fundamental limitation in current tokenization methods.
What Problem Does This Paper Address?
Modern language models rely on tokenizers to break down text into manageable units. A crucial first step is "pre-tokenization," which typically splits text at whitespace and punctuation. While this creates meaningful units like words, it creates a significant problem for tokenization algorithms like BPE. The pre-tokenization step heavily skews the distribution of tokens in a corpus, with common words appearing overwhelmingly frequently. This means that even with larger vocabularies, the additional tokens are rarely used, limiting the benefits of expansion. Essentially, the pre-tokenization step dictates the vast majority of the token distribution, leaving tokenization algorithms with little room to maneuver.
Methods
The core innovation is BoundlessBPE, a modification of the standard BPE algorithm. The key change is the introduction of supermerges. Unlike standard BPE, which merges adjacent subword tokens, BoundlessBPE allows two complete pretokens (which have already been tokenized into single tokens) to be merged into a new unit called a superword. These superwords are not necessarily semantically cohesive; they are formed based on the frequency of adjacent pretokens. For example, "of" and "the" might merge into "of the".
Additionally, BoundlessBPE incorporates a variant of the PickyBPE deletion technique. This helps remove low-frequency intermediate tokens from the vocabulary, freeing up space for more common tokens and further contributing to a more uniform distribution. The paper also proposes a new pre-tokenization regular expression, BOUNDLESS_PATTERN, designed to work effectively with supermerges, particularly for code and named entities.
Datasets
The authors used a 5GB portion of MiniPILE (Kaddour, 2023) as their out-of-sample evaluation corpus. They trained tokenizers on a 1GB subset of MiniPILE.
Key Insights and Ideas
- Pre-tokenization is the bottleneck: The paper strongly argues that pre-tokenization, not the subsequent tokenization algorithm, is the primary driver of token distribution skew.
- Superwords as a solution: By allowing merges across pre-token boundaries, BoundlessBPE can create more diverse and evenly distributed tokens, effectively "breaking the barrier."
- Uniformity is key: The research reinforces the idea that a more uniform token distribution leads to better compression and potentially better downstream performance.
- Beyond semantic cohesion: Superwords are not about finding meaningful phrases like "New York City" but about statistically frequent adjacent pretokens, which can be more common words like "of the."
- Custom regex matters: The proposed
BOUNDLESS_PATTERNregex is crucial for enabling supermerges, especially for code and structured text.
Key Results
- More Uniform Distribution: BoundlessBPE achieves a substantially more uniform token distribution compared to standard BPE, WordPiece, and UnigramLM. This is evidenced by higher counts in the tail of the token frequency distribution and a higher fraction of the vocabulary being used.
- Improved Compression: The method results in an approximate 20% increase in bytes per token, indicating better text compression. This means fewer tokens are needed to represent the same text, which can speed up language model inference.
- Higher Rényi Efficiency: BoundlessBPE shows at least a 21% increase in Rényi efficiency compared to baselines, a metric that quantifies the uniformity of token distribution.
- Vocabulary Utilization: Over 97.5% of tokens in BoundlessBPE's vocabulary are used at least once in the evaluation corpus, compared to 82-95% for baselines.
Limitations and Future Work
- Computational Cost: Training BoundlessBPE is significantly more computationally expensive than standard BPE. The authors note that training their model took 4.7 CPU days for a 1GB dataset, compared to 59 seconds for Huggingface BPE on the same data. This is attributed to the lack of aggregation for supermerges.
- Superword Semantics: The paper acknowledges that superwords are not necessarily semantically cohesive. While this is a design choice to achieve uniformity, future work could explore ways to incorporate semantic awareness.
- Whitespace Handling: The paper notes that the handling of whitespace is an area that would benefit from further experimentation, as different approaches have trade-offs for different use cases (e.g., coding vs. natural language).
- Downstream Performance: While the paper hypothesizes that improved compression and uniformity will positively impact downstream performance, this is not directly evaluated. Future work should focus on empirical validation of these benefits on various NLP tasks.
Summary updated