TL;DR
Can we finally ditch clunky subword tokenizers and train language models directly on raw bytes without losing performance? By pitting two nearly identical 350M-parameter "twin" models against each other on the exact same stream of 10 billion bytes, this study finds that standard Byte-Pair Encoding (BPE) still holds a clear edge in text prediction and factual recall, while the byte-level model shines at character manipulation. Perhaps most importantly, the authors uncover how subtle evaluation bugs can completely flip which model looks like the winner.
What Problem Does This Paper Address?
Every modern language model relies on a slightly awkward translator at the front door: the subword tokenizer, usually Byte-Pair Encoding (BPE). Tokenizers chop text into common chunks to keep sequences short and affordable. However, they are frozen before training begins, blind to spelling, and notoriously brittle with code whitespace.
Training directly on raw UTF-8 bytes solves these headaches, and hierarchical architectures—which group bytes into small "patches" so the heavy Transformer layers don't choke on ultra-long sequences—make byte models computationally feasible.
Yet, comparing byte models to token models is a minefield. Previous studies typically hold token budgets or compute (FLOPs) constant. Under a fixed token budget, a better-compressing tokenizer actually feeds its model more raw text, confounding the comparison. Maliyawala and Lisal ask a cleaner, foundational question: if we hold the exact raw data, its document order, and the training recipe fixed, can a fixed-patch byte model replace a BPE tokenizer?
Methods
The authors construct a "matched-twin" experiment at the 350M parameter scale, sharing an identical 26-layer, 1024-width Transformer backbone:
- BPE-8K (The Standard Twin): A classic decoder-only Transformer using a byte-level BPE vocabulary of 8,000 subwords, trained on packed sequences of 512 tokens.
- LOCAL64 (The Byte-Patch Twin): A tokenizer-free, hierarchical model inspired by MEGABYTE. It groups raw bytes into fixed patches of 4, runs the heavy 26-layer global Transformer over those patches, and hands the output to a lightweight 2-layer causal byte decoder. Crucially, unlike MEGABYTE—where local attention stays trapped inside each patch—LOCAL64 uses a 64-byte sliding attention window that crosses patch boundaries.
Both twins see the exact same $10^{10}$ bytes in the exact same order, with learning-rate schedules keyed to bytes seen rather than steps.
The other major methodological contribution is matched-span evaluation. Because BPE compresses code differently than prose, scoring both models on fixed 2048-byte windows forces BPE-8K beyond its 512-token training horizon. Instead, the authors slide across documents so both models score identical byte ranges using identical left-context start bytes.
Datasets
- Training (
real_v3): A shuffled 10-billion-byte slice drawn from a mix of 85% FineWeb-Edu (web text), 10% codeparrot-clean (code), and 5% open-web-math. - Downstream Evaluation: Standard benchmarks—HellaSwag, PIQA, ARC-Easy, and LAMBADA—alongside two local, hash-locked suites released with the paper: fact200 (a 200-item few-shot factual recall test) and CharBench (600 test items across 12 character-level tasks like reversing strings, counting letters, and checking palindromes, tested both 5-shot and with equal fine-tuning).
Key Insights and Ideas
- Evaluation protocol can flip the winner: When evaluated naively on fixed 2048-byte windows, BPE-8K appears to lose badly on code (0.843 vs. 0.669 bits-per-byte). Why? Because 512 BPE tokens only cover ~900 bytes of code—so a 2048-byte window forces BPE-8K into severe context-length extrapolation! Equalizing the scored spans drops BPE-8K's score to 0.600, turning an apparent byte-model victory into a decisive BPE win.
- Subwords pack facts; bytes grok characters: BPE-8K wins on factual recall and commonsense multiple-choice, suggesting whole subwords store named entities and short answers more sample-efficiently. Conversely, LOCAL64 dominates CharBench—but only after fine-tuning (5-shot is a tie), showing that byte representations are primed for character manipulation once nudged.
- A field guide to evaluation pitfalls: The authors transparently catalog internal bugs they caught—like dividing negative log-likelihoods by re-encoded window lengths instead of target-token byte lengths, or subtle trailing-space bugs in LAMBADA—each of which dramatically skewed headline numbers.
Key Results
On byte-normalized likelihood (bits-per-byte, or BPB, where lower is better), BPE-8K wins across the board under matched spans, despite LOCAL64 having 4.7% more parameters and using ~2% more training FLOPs:
- Overall BPB: BPE-8K leads at 0.9155 vs. LOCAL64's 0.9634 (a -5.2% relative gap). BPE-8K leads across text (-4.9%), code (-9.3%), and math (-6.1%). While the gap shrinks as training progresses, it never closes.
- Downstream Tasks: After statistical correction ($\alpha = 0.05$), BPE-8K wins fact200 (16.5% vs. 7.0%), PIQA (61.4% vs. 58.9% raw), and length-normalized ARC-Easy (38.4% vs. 32.8%). LOCAL64 wins CharBench equal fine-tuning decisively (53.7% vs. 40.0%). LAMBADA, HellaSwag (near chance at this scale), and 5-shot CharBench are statistical ties.
Limitations and Future Work
The authors are admirably blunt about what this study does not prove. It tests one model size (350M), one random seed, one fixed patch size (4 bytes), and one untuned 8k BPE vocabulary. Furthermore, an unintended recipe discrepancy remained: BPE embeddings were initialized from $\mathcal{N}(0, 0.02^2)$, whereas LOCAL64's byte embeddings kept PyTorch's default $\mathcal{N}(0, 1)$, which could account for part of the performance gap. Finally, matched-span code evaluation caps context at ~900 bytes, potentially underutilizing LOCAL64's native 2048-byte training range. Future extensions can use the team's open-source checkpoints and hash-locked suites to test longer BPE contexts, larger vocabularies, dynamic patching, and matched initializations.
Summary updated