arXiv:2609.40016v2 cs.DS

정확한 증분 BPE를 위한 성분 가중 중심점 탐색

Component-Weighted Centroid Search for Exact Incremental BPE

Harshit Verma, Rex Ying

제출 2026-11-03

한국어 초록

정확한 증분 토크나이저는 커지는 텍스트의 토큰화를 최신 상태로 유지하여, 긴 프롬프트나 에이전트 트레이스가 길어질 때마다 다시 토큰화되지 않도록 한다. Jiang과 Gong의 알고리즘은 바이트 쌍 인코딩(BPE)에 대해 바이트당 최악의 경우 $O(\log^2 t)$ 시간에 이를 수행하며, 여기서 $t$는 가장 긴 토큰의 길이이다. 이 탐색은 $O(\log t)$개의 중첩된 하위 문제를 거치며 각 단계에서 가능한 분기들에 대해 이진 탐색을 수행한다. 우리는 각 분기를 그것이 이끄는 하위 문제의 크기로 가중한다. 그러면 각 단계는 남은 후보가 절반이 될 때마다 약 한 번의 탐침 비용이 들고, 전체 갱신은 모든 후보에 대한 단일 이진 탐색과 같은 $O(\log t)$의 비용이 든다. 출력과 점근적 메모리는 변하지 않는다. 또한 원래의 탐색은 $\Theta(\log^2 t)$번, 우리의 탐색은 $\Theta(\log t)$번의 탐침이 필요함이 증명되는 유효한 BPE 어휘를 구성하며, Rust 구현은 두 횟수를 정확히 재현한다. 실제 어휘 여섯 개에서 두 탐색은 일반 텍스트에서 거의 같은 속도로 실행되지만, 공백이나 하이픈이 길게 이어지는 경우 가중 탐색이 최대 2.5$\times$ 더 빠르다.

원문 초록

Exact incremental tokenizers keep the tokenization of a growing text up to date, so a long prompt or agent trace is not retokenized each time it grows. Jiang and Gong's algorithm does this for byte-pair encoding (BPE) in $O(\log^2 t)$ worst-case time per byte, where $t$ is the length of the longest token. Its search passes through $O(\log t)$ nested subproblems and runs a binary search over the possible branches at each one. We weight each branch by the size of the subproblem it leads to. Each step then costs about one probe for every halving of the remaining candidates, and a whole update costs $O(\log t)$, as much as one binary search over all candidates. Output and asymptotic memory are unchanged. We also construct valid BPE vocabularies on which the original search provably needs $\Theta(\log^2 t)$ probes and ours $\Theta(\log t)$, and a Rust implementation reproduces both counts exactly. On six real vocabularies the two searches run at about the same speed on ordinary text, while on long runs of spaces or hyphens the weighted search is up to 2.5$\times$ faster.

제출 이력

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

  1. arXiv:2609.40016v2제출 시각 미확인

함께 살펴볼 논문

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

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

토론

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