Pith. sign in

REVIEW 2 cited by

Fast WordPiece Tokenization

Not yet reviewed by Pith; the record is open.

This paper has not been read by Pith yet. Machine review is queued; the pith claim, tier, and objections will appear here once it completes.

SPECIMEN: schema-true, not a live event

T0 review · schema-true

One-sentence machine reading of the paper's core claim.

pith:XXXXXXXX · record.json · timestamp

arxiv 2012.15524 v3 pith:YQXA5CKT submitted 2020-12-31 cs.CL

classification cs.CL
keywords tokenizationtextwordpiecealgorithmgeneralmethodproposealgorithms
verification ladder T0 review T1 audit T2 compute T3 formal
0 comments
read the original abstract

Tokenization is a fundamental preprocessing step for almost all NLP tasks. In this paper, we propose efficient algorithms for the WordPiece tokenization used in BERT, from single-word tokenization to general text (e.g., sentence) tokenization. When tokenizing a single word, WordPiece uses a longest-match-first strategy, known as maximum matching. The best known algorithms so far are O(n^2) (where n is the input length) or O(nm) (where m is the maximum vocabulary token length). We propose a novel algorithm whose tokenization complexity is strictly O(n). 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 WordPiece 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.

Discussion (0). Continue with ORCID to comment.

Forward citations

Cited by 2 Pith papers

Reviewed papers in the Pith corpus that reference this work. Sorted by Pith novelty score. Full citation record

  1. 1 bit is all we need: binary normalized neural networks

    cs.LG 2025-09 conditional novelty 4.0 of 10

    Binary normalized layers with all parameters in {0,1} reach near-32-bit accuracy on Food-101 and WikiText-103, with some caveats.

  2. Comparative analysis of subword tokenization approaches for Indian languages

    cs.CL 2025-05 conditional novelty 4.0 of 10

    Across SMT and NMT models for 11 Indian languages, SentencePiece gives the highest BLEU for most language pairs, while BPE wins in the multilingual model.

Pith tools