Lune

ASPLOS2026Top-tier venue

Static Analysis for Efficient Streaming Tokenization

Angela W. Li, Yudi Yang, Konstantinos Mamouras

Abstract

Tokenization, also referred to as lexing or scanning, is the computational task of partitioning an input text into a sequence of substrings called tokens. Tokenization is one of the first stages of program compilation, it is used in natural language processing, and it is also useful for processing unstructured text or semi-structured data such as JSON, CSV, and XML. A tokenizer is typically specified as a list of regular expressions, which is called a tokenization grammar. Each regular expression describes a class of tokens (e.g., integer, floating-point number, variable identifier, string literal). The semantics of tokenization employs the longest match policy to disambiguate among the possible choices. This policy says that we should prefer a longer token over a shorter one. It is also known as the maximal munch policy.

Tokenization is an important computational task when processing semi-structured data, as it often precedes parsing, querying, or data transformations. Due to the abundance of large-scale semi-structured data, which can be too large to load in memory, it is desirable to perform tokenization in a streaming fashion with a small memory footprint. First, we observe that some tokenization grammars are inherently more difficult to deal with than others, and we provide a static analysis algorithm for recognizing them. We continue to propose the StreamTok algorithm, which relies on this analysis to enable efficient tokenization. StreamTok is asymptotically better than the standard algorithm of flex. Our experimental results show that our implementation of StreamTok outperforms state-of-the-art tools for tokenization.

Ask Lune

Know this paper in minutes, not an afternoon.

Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.

Questions to start from

Lune can draw on

the full paper · related work

Get the answer

Free to start. No credit card required.

Lineage

  • BVAP: Energy and Memory Efficient Automata Processing for Regular Expressions with Bounded Repetitions cites Software-hardware codesign for efficient in-memory regular pattern matching
  • BVAP: Energy and Memory Efficient Automata Processing for Regular Expressions with Bounded Repetitions cites Regular Expression Matching using Bit Vector Automata
  • BVAP: Energy and Memory Efficient Automata Processing for Regular Expressions with Bounded Repetitions cites Efficient Matching of Regular Expressions with Lookaround Assertions
  • Regular Expression Matching using Bit Vector Automata cites Software-hardware codesign for efficient in-memory regular pattern matching
  • Efficient Matching of Regular Expressions with Lookaround Assertions cites Software-hardware codesign for efficient in-memory regular pattern matching
  • Efficient Matching of Regular Expressions with Lookaround Assertions cites Regular Expression Matching using Bit Vector Automata
Builds onCited byLeft to right by year; the more cited, the higher.

Builds on11

  1. Software-hardware codesign for efficient in-memory regular pattern matchingLingkun Kong, Qixuan Yu, Agnishom Chattopadhyay, Alexis Le Glaunec et al.PLDI 2022 · 23 citations
  2. Regular Expression Matching using Bit Vector AutomataAlexis Le Glaunec, Lingkun Kong, Konstantinos MamourasOOPSLA 2023 · 22 citations
  3. Efficient Matching of Regular Expressions with Lookaround AssertionsKonstantinos Mamouras, Agnishom ChattopadhyayPOPL 2024 · 19 citations
  4. BVAP: Energy and Memory Efficient Automata Processing for Regular Expressions with Bounded RepetitionsZiyuan Wen, Lingkun Kong, Alexis Le Glaunec, Konstantinos Mamouras et al.ASPLOS 2024 · 11 citations
  5. ngAP: Non-blocking Large-scale Automata Processing on GPUsTianao Ge, Tong Zhang, Hongyuan LiuASPLOS 2024 · 11 citations

Related papers

  1. Efficient Algorithms for the Uniform Tokenization ProblemAngela W. Li, Konstantinos MamourasOOPSLA 2025 · 3 citations
  2. A Partition Cover Approach to TokenizationJia Peng Lim, Shawn Tan, Davin Choo, Hady W. LauwNeurIPS 2025 · 6 citations
  3. PinTok: Tokenizers Deserve Dedicated Pinned CPU-Compute and MemorySean Choi, Myungheon Chin, Ernest RyuICML 2026
  4. Tokenization Is More Than CompressionCraig W. Schmidt, Varshini Reddy, Haoran Zhang, Alec Alameddine et al.EMNLP 2024 · 16 citations
  5. Incremental BPE TokenizationShenghu Jiang, Ruihao GongICML 2026 · 12 citations
Dusk over the sea between two cliffs drawn in fine vertical lines