TL;DR
ByteSpan is a novel subword tokenisation method that moves away from frequency-based merging (like BPE) toward an information-driven approach. By using entropy and surprisal from a byte-level language model to identify predictable sequences, it creates vocabularies that align significantly better with human morphology and use information more efficiently across 25 languages.
What Problem Does This Paper Address?
Most modern Large Language Models (LLMs) don't "see" words; they see tokens. The standard way to create these tokens is Byte-Pair Encoding (BPE), which iteratively merges the most frequent pairs of characters. While BPE is computationally efficient, it has a major flaw: it is purely frequency-driven. This often results in subwords that make little linguistic sense, are highly sensitive to typos, and vary wildly in compression quality across different languages.
Recent "patching" methods attempt to fix this by grouping bytes dynamically during model training, but these methods are complex and don't provide a fixed vocabulary that standard LLM architectures require. The authors of ByteSpan ask: Can we use the information-theoretic principles of patching to build a better, fixed subword vocabulary?
Methods
ByteSpan leverages the idea that predictability is high within a lexical unit (like a word or morpheme) and low between them.
- The Information Signal: The authors train a small, external byte-level Language Model (LM) based on the Llama-2 architecture. They use this model to calculate the entropy or surprisal (measures of "unexpectedness") for every byte in a training corpus.
- Boundary Constraints: To decide where to "span" or group bytes into a token, they test three constraints:
- Global: Groups bytes that fall below a fixed information threshold (i.e., they are predictable).
- Monotonic: Groups bytes as long as the information is decreasing (i.e., the model is getting more certain as it sees more of the sequence).
- Combined: A hybrid of the two.
- Vocabulary Learning: They propose three ways to turn these spans into a fixed vocabulary: Frequency (taking the most common spans), Incremental (gradually raising the threshold), and Seeding BPE (using ByteSpan to find initial units, then letting BPE handle the rest).
- Inference: Unlike patching methods, ByteSpan produces a standard vocabulary file. At inference time, it uses simple longest-prefix matching (like WordPiece), making it a drop-in replacement for existing tokenisers.
Datasets
- English: A 500M byte sample of the FineWeb-Edu dataset.
- Multilingual: A balanced 25-language sample from the Common-Corpus (approx. 250M bytes total), covering diverse scripts and morphological structures.
- Evaluation: The authors used the intrinsic evaluation benchmark from Uzan et al. (2024), which includes gold-standard morphological segmentations from sources like LADEC and MorphoLex.
Key Insights and Ideas
- Predictability > Frequency: The "aha moment" is that a sequence's predictability is a better proxy for "meaning" than its raw frequency. BPE might merge "th" and "e" because they appear together often, but ByteSpan groups "un-" and "stable" because the byte-level LM "knows" that once you see "unstabl-", the "e" is almost certain.
- Morphological Alignment: Because ByteSpan follows the "spikes" in prediction error, it naturally finds the boundaries of prefixes, suffixes, and stems.
- The "Superword" Capability: ByteSpan can actually group across whitespace to create "superwords" (e.g., "in the") if the sequence is sufficiently predictable, potentially reducing sequence length for LLMs.
- Vocabulary Balancing: In multilingual settings, frequency-based methods are biased toward Latin scripts. The authors found that a "round-robin" approach—dedicating a portion of the vocabulary to each language—is essential for maintaining efficiency in rare orthographies.
Key Results
- Morphological Alignment: In English, ByteSpan (Global/Increment) achieved a score of 0.899, vastly outperforming standard BPE (0.694) and even WordPiece-style BPE (0.834) at a 16k vocabulary size.
- Rényi Efficiency: ByteSpan consistently showed higher Rényi efficiency than BPE. This means it uses its "information channel" more effectively, avoiding the trap of having a vocabulary full of tokens that are either never used or used too much.
- Compression: Despite being more linguistically "correct," ByteSpan maintains compression rates (fertility) comparable to BPE, especially when using the "Seeding BPE" or "Monotonic" methods.
- Multilingual Stability: Across 25 languages, ByteSpan showed similar or better efficiency scores than BPE, provided the vocabulary was balanced to account for underrepresented scripts.
Limitations and Future Work
- Cognitive Plausibility: Interestingly, ByteSpan scored lower than BPE on "cognitive plausibility" (how well token counts correlate with human reaction times in lexical tasks). This suggests that while ByteSpan is linguistically logical, it might not perfectly mirror human psychological processing.
- Computational Cost: Training the initial byte-level LM is an extra step not required by BPE, though the authors note this only needs to be done once per domain/language set.
- Inference Strategy: The study focused on longest-prefix matching. The authors suggest that exploring other inference methods, like longest-suffix matching or unigram-style sampling, could further improve results.
- Non-Concatenative Languages: The authors acknowledge that the method still relies on contiguous byte sequences, which might struggle with languages that use non-concatenative morphology (like Arabic root-and-pattern systems).
Summary updated