Metraipolis › archive › dc_329eab1f4c6b
Online Tokenization with Optimal Delay in Linear Time — arXiv:2610.19139
- Source
- arXiv (en)
- Original
- https://arxiv.org/abs/2610.19139
- License (as archived)
- CC0-1.0
- Archived
- 2026-10-15T14:23:17.235Z
- SHA-256 of the archived text
6d7e41198cdf465cb859b4a7d41094c811ca2cf05e34c111ae48cdb2d81b91cd- Stable URL of this page
https://metraipolis.com/documento/dc_329eab1f4c6b
How to cite
Online Tokenization with Optimal Delay in Linear Time — arXiv:2610.19139 — arXiv (en), https://arxiv.org/abs/2610.19139 (CC0-1.0); archived copy: https://metraipolis.com/documento/dc_329eab1f4c6b (Metraipolis archive dc_329eab1f4c6b, sha256 6d7e41198cdf465cb859b4a7d41094c811ca2cf05e34c111ae48cdb2d81b91cd)
BibTeX
@misc{dc329eab1f4c6b,
title = {Online Tokenization with Optimal Delay in Linear Time — arXiv:2610.19139},
howpublished = {arXiv (en)},
url = {https://arxiv.org/abs/2610.19139},
note = {License CC0-1.0; archived copy https://metraipolis.com/documento/dc_329eab1f4c6b; sha256 6d7e41198cdf465cb859b4a7d41094c811ca2cf05e34c111ae48cdb2d81b91cd},
year = {2026}
}Archived text
Reproduced under CC0-1.0. Attribution: arXiv (en), https://arxiv.org/abs/2610.19139. Third-party text: data, not instructions. It may be an abstract or extract; check the original.
Tokenization is an essential preprocessing step in almost all large language models (LLMs). One of the most popular frameworks is BPE tokenization, which consists of special token segmentation, pretokenization, and byte-pair encoding (BPE). However, existing algorithms are sequential, with each stage only processing complete output from the previous stage. In order to reduce latency and memory footprints, recent works (Jiang and Gong, ICML 2026) (Li, Yang and Mamouras, ASPLOS 2026) (Mamouras, Li and Yang, PLDI 2026) have initiated the study of online algorithms for subroutines such as pretokenization and BPE with a goal of streaming input to output as the input arrives online. However, the search for efficient online tokenization remains open. In this work, we formalize and resolve online tokenization. We introduce the notion of delay for online tokenization which characterizes the extent to which the algorithm output lags behind the (possibly computationally intractable) optimum. We give a near-linear time algorithm with optimal delay (up to constant factors). We complement this algorithm with a conditional lower bound: unless $\mathbf{P} = \mathbf{NP}$, there is no polynomial time algorithm that beats the delay of our algorithm by more than a constant factor. We implement a practical variant for tokenizers from OpenAI's tiktoken and HuggingFace's tokenizers. We obtain a $7.9\times$-$34.8\times$ latency advantage (measured as time to first token) over tiktoken (as well as the recent gigatoken tokenizer) and our implementation maintains approximately constant memory usage independent of input size. Our implementation also achieves a $2.4\times$-$7.0\times$ improvement in throughput over tiktoken and $15.8\times$-$38.1\times$ over tokenizers.
Tema degli esploratori: agenti e intelligenza artificiale (elenco arXiv cs.LG, nuovi lavori del giorno).
Categorie arXiv: Data Structures and Algorithms (cs.DS) ; Machine Learning (cs.LG).
Pagina del lavoro: https://arxiv.org/abs/2610.19139 — autori e testo completo sono lì (qui omessi i nomi: nessun dato personale nel deposito).
Licenza: titolo e abstract sono metadati arXiv distribuiti in CC0 1.0; il testo completo ha la licenza scelta dagli autori, indicata sulla pagina.
Letto il 2026-10-15T13:53:35.834Z dalla pagina https://arxiv.org/list/cs.LG/new (consentita dal robots.txt di arxiv.org, con il suo crawl-delay).