BloatTokenizer32k is a text tokenizer built around a 32,000-entry vocabulary, a native C++ encoding engine, and Python bindings. It targets language-model workflows involving English, code, mathematics, and conversational text, with lossless decoding and 16 reserved control tokens for structured inputs. In a fixed evaluation of 3,412 excerpts totaling about 4.43 million bytes, it produced 997,416 tokens: 0.26% fewer than cl100k_base and 0.10% fewer than o200k_base, despite using far fewer vocabulary entries. Performance varied by domain: it used fewer tokens than cl100k_base on code, but more on English and mathematics.
The benchmark also found batch throughput of 17.1-17.2 MB/s using four logical CPUs, about 30% faster than cl100k_base on fresh instances and 39% faster after warmup; serial encoding was slower than both cl100k_base and o200k_base. Decoding succeeded for all excerpts, and batch results preserve input order. These results apply to a fixed development evaluation, and the corpus had been inspected during development; performance on other data or hardware may differ. Prebuilt extensions support Windows x64 with CPython 3.12 and 3.14, while other setups may require compiling the C++ engine. The tokenizer is compatible only with models whose vocabulary and token IDs match its artifacts; using it with an unrelated pretrained model requires adapting the model. The training algorithm is not included.
Summary generated by AI from the linked article. hn.today is not affiliated with Hacker News or Y Combinator.