Hugging Face tokenizers v1.0 push: BERT tokenizer gets ~50x faster
Hugging Face is revitalizing its tokenizers library and pushing toward v1.0.0. Simon Brandeis aggressively optimized the WordPiece tokenizer used by bert-base-uncased, gaining roughly another 5.7x on top of v1 improvements—about 50x total versus v0.23—with identical token output. The optimization is currently a PR and not yet merged, and it directly benefits large-scale text preprocessing and embedding-model inference.
Confirmed
- The tokenizers v1 rewrite already boosted encoding speed: classic BPE tokenizers are up to 30x faster than v0.23 (@tomaarsen)
- The WordPiece tokenizer used by bert-base-uncased originally gained only 8.6x in v1, one of the slower cases (@tomaarsen)
- Profiling showed 88% of that tokenizer's time is spent on text normalization (@LysandreJik relaying Simon Brandeis's finding)
- Simon Brandeis detailed further optimizations for BERT-style tokenizers: tricks such as skipping ASCII normalization yield a 5.7x speedup, 50x total over v0.23, with identical token output; currently a PR (@tomaarsen, relayed by @artzucker)
- Methodologically, the author profiled not only the code but also the data itself, revealing work that could be skipped (@artzucker)
- Sentence Transformers maintainer @tomaarsen noted the tokenization rewrite can significantly speed up inference for the most-used Sentence Transformer models, with static embedding models benefiting most
Unconfirmed
- The 50x total speedup comes from a PR-stage optimization not yet merged; final released performance remains to be confirmed
Why it matters
- Tokenization is an often-overlooked bottleneck in NLP pipelines; 30-50x speedups matter for both bulk corpus preprocessing and real-time inference
- bert-base-uncased is 8 years old yet still widely used; the optimization preserves identical token output, keeping compatibility risk low
- WordPiece/BERT-style tokenization is one of the most widely deployed schemes, so targeted optimizations have broad reach, benefiting downstream libraries like Sentence Transformers
2026-10-15 ~ 2026-10-16 · 7 related posts
Primary sources
- [source] Tokenmaxxing BERT: how skipping ASCII normalization made tokenization 50x faster — tomaarsen · 2026-10-15
- BERT tokenizers headed for ~50x total speedup as tokenizers v1 work continues — tomaarsen · 2026-10-15
- Tokenization refactor speeds up Sentence Transformers, biggest gains for static embedding models — tomaarsen · 2026-10-15
- [source] Hugging Face tokenizers: another ~5x speedup for BERT tokenizers on top of v1 — tomaarsen · 2026-10-15
- [source] BERT tokenizer gets 50x speedup by skipping text normalization, not optimizing it — LysandreJik · 2026-10-15
- tokenizers v1 promises up to 30x faster BPE tokenization via data profiling — art_zucker · 2026-10-16
1 near-duplicate retellings: art_zucker