arXiv:2607.29678v3 cs.CL

TokTier: 에이전틱 LLM 서빙을 위한 정확한 상태 기반 CPU+GPU 토큰화

TokTier: Exact Stateful CPU+GPU Tokenization for Agentic LLM Serving

Zhenyu Zhang, Zhichao Cao

제출 2026-07-31

한국어 초록

대규모 언어 모델(LLM) 서빙은 프롬프트(prompt) KV 상태를 캐시하지만, 대부분의 프론트엔드는 여전히 모든 호출마다 전체 요청을 다시 토큰화합니다. 코딩 에이전트(agent)에서 발생하는 비용이 가장 큽니다. 세션은 작은 추가(append)가 발생한 후에도 긴 대화 기록을 반복적으로 제출하며, 이는 이전 시퀀스 끝부분의 토큰(token) 경계를 이동시킬 수 있습니다. 153,951건의 호출 전반에서 중앙값 추가 길이는 약 1.4K 문자이며, 호출의 1.0~3.6%만이 세션을 시작하거나 재구축하지만 이들은 수백만 자 규모의 문맥을 전달합니다. 플릿 프롬프트 캐시 적중률은 94.1%에 달하며, 이 비율이 0.99에 가까워질수록 구성 요소 측정에서 첫 번째 토큰 생성 시간(TTFT) 중 토큰화(tokenization)가 차지하는 비중은 10%에서 64%로 증가합니다. TokTier는 이러한 두 가지 모드의 워크로드를 위한 상태 기반(stateful) CPU+GPU 토큰화 서비스로, 출력된 토큰 ID가 전체 참조 토큰화와 항상 동일하다는 단일 계약 하에 동작합니다. 세션 연속 호출의 경우 추가 부분 주변의 작은 윈도우만 다시 토큰화하고, 요청별 검사를 통해 안정적인 사전 토큰화 경계가 확인될 때만 이어 붙입니다(splice). 검사에 실패하면 윈도우를 넓히거나 전체 참조 토큰화로 폴백합니다. 재사용 가능한 접두 문맥(prefix)이 없는 호출의 경우, GPU에서 정확한 GPT 패밀리 정규표현식 사전 토큰화 및 BPE를 실행합니다. 표본화된 섀도 검증기는 실제 트래픽을 재검사합니다. 17개의 프로덕션 토크나이저 패밀리를 대상으로 한 차등 테스트는 1.5×10^10회의 분할 검사, 12.4TB의 실제 텍스트 말뭉치, 93,000회 이상의 재생된 에이전트 단계를 다루었으며 불일치는 전혀 발생하지 않았습니다. 증분 복구는 100K에서 3M 문자까지 0.5~1.1ms가 소요되어 HF 토큰화보다 최대 437배 빠르고, 완전히 사전 예열된 가장 강력한 캐시 기반 기준선(baseline, Gigatoken)보다 1M 문자에서 2.1배 빠릅니다. GPU 토큰화는 1M 문자 요청을 0.87ms 만에 인코딩하여, 동일한 프로토콜에서 HF보다 최대 491배, 발표된 가장 빠른 CPU 방식보다 23.4배 빠릅니다. vLLM 환경에서 기록된 버스트 상황 시 중앙값 TTFT는 16~34%, P99 TTFT는 23% 감소합니다. 50ms P99 목표 하에서 4코어 복구 풀과 1개의 GPU 구성은 1,821 requests/s를 유지하는 반면, 16코어 무상태(stateless) 프론트엔드는 40 requests/s에서 포화됩니다.

원문 초록

LLM serving caches prompt KV state, yet most front ends still re-tokenize the full request on every call. Coding agents pay most: sessions repeatedly submit a long transcript after a small append, which can shift token boundaries near the end of the prior sequence. Across 153,951 calls the median append is ~1.4K characters; only 1.0-3.6% of calls start or rebuild a session, yet those carrymulti-million-character contexts. Fleet prompt-cache hit rate is 94.1%, and as it approaches 0.99, tokenization grows from 10% to 64% of time to first token (TTFT) in component measurements. TokTier is a stateful CPU+GPU tokenization service for this two-mode workload, under one contract: emitted token IDs are always identical to full reference tokenization. For session continuations it re-tokenizes a small window around the append and splices only when a per-request check finds a stable pre-tokenization boundary; failed checks widen the window or fall back to full reference tokenization. For calls without a reusable prefix it runs exact GPT-family regex pre-tokenization and BPE on a GPU. A sampled shadow verifier re-checks live traffic. Across 17 production tokenizer families, differential campaigns cover 1.5x10^10 split checks, a 12.4 TB real-text corpus, and 93,000+ replayed agent steps, with zero divergence. Incremental repair takes 0.5-1.1 ms from 100K to 3M characters, up to 437x faster than HF tokenization and 2.1x faster at 1M characters than the strongest cache-based baseline (Gigatoken) fully prewarmed. GPU tokenization encodes a 1M-character request in 0.87 ms, up to 491x below HF and 23.4x below the fastest published CPU method on the same protocol. With vLLM, median TTFT drops 16-34% and P99 TTFT 23% under recorded bursts. Under a 50 ms P99 objective, a four-core repair pool plus one GPU sustains 1,821 requests/s, where a 16-core stateless front end saturates at 40 requests/s.

제출 이력

확인된 버전만 표시합니다. 전체 제출 이력은 arXiv 원문에서 확인하세요.

  1. arXiv:2607.29678v3제출 시각 미확인
  2. arXiv:2607.29678v1제출 시각 미확인

함께 살펴볼 논문

공통 태그를 근거로 연결했습니다. 실제 인용 관계나 논문의 우수성을 뜻하지 않습니다.

공통 태그로 연결된 공개 논문이 아직 없습니다.

토론

이 논문과 연결된 포럼 글이 아직 없습니다.