HF tokenizers bug: 32-bit digest-only check makes BPE return wrong token IDs
art_zucker · x · 2026-11-25
tokenizers maintainer artzucker shares that for the library's next speed-focused release, the hot vocab-lookup path uses a memory-efficient perfect hash structure — until a community member found a nasty bug (issue #2722). In unmodified v1.0.0-rc.4 Rust sources, BucketVocabStore accepts a match based only on a 32-bit digest without comparing the candidate token's full bytes, so BPE can encode input into an unrelated vocab entry, changing the decoded text. It reproduces with a self-contained five-entry vocabulary and with real tokenizers like DeepSeek-V4.1-Flash-1017 and GLM-5.3. A fix is already linked (issues #2767/#2737 in review), and the author is publicly challenging others to beat it: any implementation where a hit is under 3ns wins open-source respect.
More from Infra
- AI compute stocks crushed despite record earnings; bull says only risk is compute-per-intelligence breakthrough — JOBhakdi · 2026-11-25
- Compute Prices Are Up 50% in 3 Months, Not Falling — JOBhakdi · 2026-11-25
- vLLM ships Day-0 support for Baidu's ERNIE 5.5 Flash: 280B MoE with 1M context — Xianbao_QIAN · 2026-11-25
- Hugging Face cuts storage 80% with Parquet deduplication, shares engineering talk — lhoestq · 2026-11-25
- Full 16-benchmark local LLM eval on 2x RTX 5060 Ti (32GB), with community voting on next 16B-36B models — Careful-Report6526 · 2026-11-25
- Free and funded compute: a compiled guide to research allocations, startup credits and more — StasBekman · 2026-11-25