分词器提速1000倍,GB/s吞吐
推荐指数 82.0 NO. 013 · 2026.07.23
发布2026/07/22Score131Comments25
为什么值得看
GigaToken 是 HuggingFace Tokenizers 和 Tiktoken 的即插即用替代方案,在已多线程优化的 Rust 基础上再将 tokenization 速度提升约 1000 倍。对需要大规模预处理文本数据的 AI 团队和云厂商而言,这意味着训练数据 pipeline 的瓶颈从 CPU 分词端彻底解除。
编辑判断
HF tokenizers 和 tiktoken 已经是 Rust 多线程实现,GigaToken 能再榨出 1000 倍性能,说明瓶颈不在语言层而在算法和内存布局——很可能是避免了 Python GIL 交互开销、SIMD 向量化,或改进了 BPE 合并的缓存局部性。
实际影响分两层:做预训练的团队,数据加载从小时级缩到分钟级,实验迭代周期直接缩短;做推理服务的团队,动态批处理的 tokenization 延迟可能成为新的优化点,尤其长上下文场景。
建议用 compatibility mode 跑现有 pipeline 的 benchmark,重点测 batch size 变化和不同 CPU 架构(ARM vs x86)的表现,官方数据里跨硬件的一致性比峰值数字更值得关注。
社区反馈
正面 26 条评论
核心争论:超高速分词是否必要:是训练pipeline关键瓶颈还是过度优化?
What sort of setups do people have that are bounded by the speed of the tokenizer?
It can be useful for checking input token usage before sending it to the model, e.g. preventing calls above a given token bound or grouping requests into batches. It can also be used by the LLMs to provide the input and output token counts on the different APIs, though I'm not sure if this is how ll
But are those bounded on the speed of tokenization?