Loading…
Topic
Tokenizers
2 posts about Tokenizers. Every summary links to the original.
- 2 posts
- 1 company
The Good Stuff
Paid picks we use ourselves. Links carry a referral code — a subscription through one earns us a commission at no extra cost to you.
Newest first
Posts
How Specializing the Vocabulary of SLMs Can Cut Inference Cost by 77% in Real Applications
The post describes how specializing the vocabulary of a small language model cut inference cost by 77% in a Portuguese essay grader built on Qwen3-4B. The original general-purpose tokenizer fragmented domain text and included unused tokens, wasting compute. The authors developed VocabX, which rebuilds the tokenizer by weighting token cost based on whether tokens appear in input or output, since generated tokens cost 7.4 times more due to memory bandwidth limits. VocabX works on sub-word and multi-word layers, reducing vocabulary from 151,669 to about 65,000, and outperformed three reference methods across five domains and three model families. In the grader, it reduced response tokens from 350 to 101, cut cost by 77%, and improved quality from 0.703 to 0.810, though compressing the grade into a macro token hurt quality.
tokenizers v1: encode, decode and scaling, measured
The tokenizers library is being reworked for version 1 with a heavy focus on performance, as tokenization can become a bottleneck that starves models of data when workloads scale. The work draws on ideas from other open-source tokenizers like gigatoken, tiktoken, and kitoken. Key optimizations include using SIMD instructions for UTF-8 text, ensuring merges never cross pre-token boundaries, and reusing scratch buffers to avoid allocations. The release candidate is implemented in the Rust pre-release on crates.io, with the crate split into tk-encode, tk-serialize, tk-convert, and tk-train. Batched model calls and faster decoding with parallel batch processing are also part of the improvements.
Related topics
All topics →Weekly digest
The best engineering reads, once a week.