Lune

摘要

Tokenization is a fundamental preprocessing step for almost all NLP tasks. In this paper, we propose efficient algorithms for the Word-Piece tokenization used in BERT, from singleword tokenization to general text (e.g., sentence) tokenization. When tokenizing a single word, WordPiece uses a longest-matchfirst strategy, known as maximum matching. The best known algorithms so far are ( 2 ) (where is the input length) or ( ) (where is the maximum vocabulary token length). We propose a novel algorithm whose tokenization complexity is strictly ( ). Our method is inspired by the Aho-Corasick algorithm. We introduce additional linkages on top of the trie built from the vocabulary, allowing smart transitions when the trie matching cannot continue. For general text, we further propose an algorithm that combines pre-tokenization (splitting the text into words) and our linear-time Word-Piece method into a single pass. Experimental results show that our method is 8.2x faster than HuggingFace Tokenizers and 5.1x faster than TensorFlow Text on average for general text tokenization. * Research conducted while working at Google.

问 Lune

几分钟读透这篇 Paper,不用再花一下午。

Lune 能读完全文,也能读引用它的顶会 Paper,讲清它的结论、证据和局限,每一点都注明出自哪篇 Paper。不用硬啃,也不靠猜。

已有 19 篇顶会 Paper 引用了它。别等审稿人问起,先弄清它们发现了什么。

可以从这些问题问起

Lune 可以查阅

全文 · 引用它的顶会 Paper · 相关的 Paper

获取答案

免费开始,无需绑卡

脉络

  • Is Your LLM Overcharging You? Tokenization, Transparency, and Incentives 引用了 Do All Languages Cost the Same? Tokenization in the Era of Commercial Language Models
  • MAGNET: Improving the Multilingual Fairness of Language Models with Adaptive Gradient-Based Tokenization 引用了 Do All Languages Cost the Same? Tokenization in the Era of Commercial Language Models
它引用的引用它的从左到右按年份排列,引用越多,位置越高。

引用它的顶会 Paper19

  1. MAGNET: Improving the Multilingual Fairness of Language Models with Adaptive Gradient-Based TokenizationOrevaoghene Ahia, Sachin Kumar, Hila Gonen, Valentin Hofmann 等NeurIPS 2024 · 37 次引用
  2. Do All Languages Cost the Same? Tokenization in the Era of Commercial Language ModelsOrevaoghene Ahia, Sachin Kumar, Hila Gonen, Jungo Kasai 等EMNLP 2023 · 24 次引用
  3. StrucTexTv2: Masked Visual-Textual Prediction for Document Image Pre-trainingYuechen Yu, Yulin Li, Chengquan Zhang, Xiaoqiang Zhang 等ICLR 2023 · 18 次引用
  4. Is Your LLM Overcharging You? Tokenization, Transparency, and IncentivesAnder Artola Velasco, Stratis Tsirtsis, Nastaran Okati, Manuel Gomez-RodriguezICML 2026 · 16 次引用
  5. ScanDL: A Diffusion Model for Generating Synthetic Scanpaths on TextsLena S. Bolliger, David R. Reich, Patrick Haller, Deborah N. Jakobi 等EMNLP 2023 · 6 次引用

它引用的 Paper1

  1. Language Models are Few-Shot LearnersTom B. Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah 等NeurIPS 2020 · 64,255 次引用

相关 Paper

  1. Tokenization Is More Than CompressionCraig W. Schmidt, Varshini Reddy, Haoran Zhang, Alec Alameddine 等EMNLP 2024 · 16 次引用
  2. A Partition Cover Approach to TokenizationJia Peng Lim, Shawn Tan, Davin Choo, Hady W. LauwNeurIPS 2025 · 6 次引用
  3. Incremental BPE TokenizationShenghu Jiang, Ruihao GongICML 2026 · 12 次引用
  4. ImagePiece: Content-aware Re-tokenization for Efficient Image RecognitionSeungdong Yoa, Seungjun Lee, Hye-Seung Cho, Bumsoo Kim 等AAAI 2025 · 1 次引用
  5. Byte Pair Encoding is Suboptimal for Language Model PretrainingKaj Bostrom, Greg DurrettEMNLP Findings 2020 · 180 次引用
黄昏的海面,两侧是细线勾勒的悬崖