Ugrás a tartalomra
Vissza a hírekhez
Hugging Face2026. szept. 21.eszköz

Akár 30-szor gyorsabb szövegfeldolgozást hoz a Tokenizers v1

A Hugging Face bemutatta a Tokenizers v1-et, amely a korábbi verzióknál akár 30-szor gyorsabban készíti elő a szövegeket az AI-modellek számára.

tokenizers v1: encode, decode and scaling, measured

A Hugging Face bejelentette a Tokenizers v1 kiadását, amely az AI-modellek szöveg-előkészítési folyamatát gyorsítja fel drasztikusan. A tokenizáció során a nyers szöveget a gép számára érthető számokká alakítják, ami a hatalmas adatmennyiségek feldolgozásakor eddig gyakran lelassította a munkafolyamatokat.

Az új verzió az Apple M4 Max chipen végzett tesztek alapján 3-30-szor gyorsabb a korábbi v0.23-as változatnál. Ezt a fejlesztők egy kézzel írt felosztó funkcióval, az ismétlődő szavak gyorsítótárazásával és a memóriahasználat optimalizálásával érték el, miközben az eszköz teljesen kompatibilis maradt a korábbi modellekkel.

A frissítés különösen a párhuzamos feladatoknál és a hosszú szövegek feldolgozásánál hoz komoly előrelépést, így a grafikus kártyáknak nem kell többé a processzorra várniuk. A Hugging Face projektje mögött széles körű iparági összefogás áll, többek között az IBM és az NVIDIA támogatásával.

Az eredeti szöveg (Hugging Face)
Results What V1 Is The Split: Bitstreams Instead Of A Regex The Word Cache The Merge Loop Method What This Adds Up To Getting It Progress Towards V1 Release Candidate: Implemented 1.0.0 After 1.0.0 The tokenizer has not historically been the bottleneck within ML workflows. Compute-wise, tokenization is light compared to the heavy modeling happening in the rest of the pipeline. Yet, in some cases, it has rapidly become key to accelerating (or slowing down) your machine learning work. As models become faster and workloads scale, that balance begins to shift. Training on massive datasets, serving many concurrent requests, or repeatedly processing long inputs can put enough pressure on the tokenizer that it starves the model of data. This is why we have chosen to heavily focus on performance for the upcoming version 1 of tokenizers. Tokenization should be light and should scale with your workflow. Your GPUs should never sit idle waiting for the CPU to complete its tokenization. In this article, we look at what makes v1 faster than v0.23, often by tens of times. This work was entirely possible thanks to the rest of the ecosystem. Tokenization is a very active area of open source work, and libraries such as gigatoken, tiktoken, kitoken, tokie, fastokens, wordchipper and ai-tokenizer, as well as many others, have each pushed on what a fast tokenizer can be. We read that work, and several of the ideas below reached us because another project showed they were worth trying. Before this refactor, tokenizers was nowhere near the performance it could have had, so contributing to it may not have seemed worth it. With this refactor, we hope to make clear that we intend tokenizers to be a library worth contributing to. We also thank IBM, NVIDIA, and the ExecuTorch team for contributing patches and helping us test across a wide range of hardware to broaden platform support. We showcase results for the release candidate of tokenizers v1 against other widely used alternatives. We go over single-threaded, multi-threaded, scaling across threads, per-model comparison, per-language comparison, latency, decoding throughput, memory heap, as well as crate size. We run this from the tokbench repository, and add a command to rerun the benchmarks on your hardware if you would like to do so. v1 will produce the same token IDs as v0.23. The goal was to preserve the output, the API, the vocabulary and the merge ranks, and improve everything that can be improved. That includes breadth. The library stays general across tokenizer families rather than specialising on BPE, so v1 loads everything v0.23 loaded. A tokenizer converts text into the list of integers a model reads. tokenizers runs that conversion in four stages. Normalization applies operations such as lowercasing or Unicode normalization to the raw text. Pre-tokenization splits the text into smaller pieces called pre-tokens. The model turns each pre-token into tokens and maps them to IDs in its vocabulary. Post-processing adds any special tokens the model expects. The model stage is where most of the work described here happens. Eight of the ten model families measured in this article use byte pair encoding, or BPE. BPE starts from the bytes of a pre-token and repeatedly joins the highest ranked adjacent pair until no ranked pair remains. The ranking is learned when the tokenizer is trained and ships with it, so the same text always produces the same IDs. A merge never crosses a pre-token boundary. The other two families use WordPiece and Unigram, the two other model types the library supports. The tokenization pipeline page documents the four stages. Tokenization algorithms documents BPE, WordPiece and Unigram. Each stage was worked on. These are the changes that mattered: BPE models use a regular expression to split the input text into smaller, easier to process chunks called pre-tokens. Merges happen inside a pre-token and never across the boundary between two of them, so this split de