Chiosa
Systems & Infrastructure

A GPU tokenizer preserves IDs while speeding cached requests

Taking Tokenization off the Host for Agentic LLM Serving · arXiv:2610.13325

3 min
Updated

In plain words

When a language model sees a long conversation again, its server can reuse stored work for the repeated part. But it still has to turn the whole request into token IDs before finding that stored work, so tokenization can become a bottleneck.

GraphTok moves supported tokenizers onto a GPU while preserving their reference token IDs. In one vLLM test, when nearly all of each prompt was cached, its median tokenizer call was 2.5–5.8 times shorter than TokTier’s across the tested models and lengths. The paper tests five tokenizer configurations, not every tokenizer.

The research

When a model server reuses stored work for a long repeated prompt, tokenization still has to produce the IDs needed to find that work. Can this remaining step be made faster while preserving the exact IDs the model receives?

GraphTok runs supported tokenizers on a GPU while preserving reference token IDs, aiming to reduce encoding time when prefix caching exposes that work.

The question is whether a serving system can reuse stored work for repeated text without leaving tokenization as a major part of the request. The system still needs token IDs before it can look up cached model state, and tokenizing only the new suffix is not generally safe.

GraphTok moves supported encoding steps onto a GPU while preserving reference token IDs. In vLLM, with 99.85–99.99% of prompt tokens cached, its median tokenizer call was 2.5–5.8 times shorter than TokTier’s across the tested models and lengths.

This supports faster tokenization under those conditions, alongside matching IDs in the evaluated correctness campaign.

The results cover five concrete tokenizer configurations, and every experiment used one H100 NVL. Dynamo’s GPU workers were simulated, so that test measures frontend capacity rather than end-to-end model serving.

What the evidence shows

  • The remaining request work

    GraphTok is a GPU tokenizer for five concrete tokenizer configurations. It produces ordered token IDs for the model, with the goal of matching each configuration’s reference tokenizer.

    The question is why speed up this step: when a serving engine reuses stored model state for repeated text, it still needs token IDs to look up that state, and tokenizing only the newly added text is not generally safe.

  • Caching shifts the balance

    The paper illustrates the shift with a 130k-token Llama 3.1 8B prompt in unmodified vLLM 0.27 on one H100 NVL. Tokenization accounted for 2% of median time to first token with a cold cache and 67% after a prefix-cache hit removed most prefill.

    This comparison explains why tokenization may become a major part of the request path when cached model work is reused.

  • Parallel work, ordered output

    GraphTok parallelizes tokenizer-specific boundary detection and BPE merging on the GPU, while preserving the reference merge order. It also runs the encoding stages in a captured CUDA graph, using fixed-capacity buffers and device counters to handle each request’s live work. The design aims to speed up the complete supported encoding path, rather than only one kernel.

  • Matching IDs, shorter calls

    The evaluation harness checked complete ordered token-ID sequences against the corresponding reference tokenizer. Every measured cell matched across five vocabularies, three corpora, ten input sizes and batch sizes from 1 to 256; Gemma 3 was tested one document at a time because it has no batch path.

    In vLLM, with 99.85–99.99% of prompt tokens cached, GraphTok’s median tokenizer call was 2.5–5.8 times shorter than TokTier’s across the tested model and length conditions.

  • Frontend capacity has a limit

    In a separate Dynamo frontend test with 121k-token traffic, GraphTok sustained 518 requests per second within a 2-second P99 time-to-first-token target, compared with 296 for gigatoken. A host-side stub with similar per-request cost sustained 444 requests per second, close to GraphTok.

    The authors interpret this control as evidence that Dynamo’s remaining request path constrained capacity in this setup; its GPU workers were simulated.

Deep

Next paperWhy a shared prompt cache raised tail latency