ICS 582Lecture 02Part 07
Tokenizers in practice and sentence segmentation
Pre-tokenizers, byte-level BPE, multilingual fairness, SuperBPE, the design checklist for a real tokenizer, and the related problem of finding sentence boundaries.
- Concepts
- 4
- Slides
- 49-55
- Reading
- 24 min
Why this part matters
Part 06 gave you the BPE algorithm on a toy corpus. This part shows what happens between that algorithm and the tokenizer inside GPT-4o or Llama 3, and why the answer matters for an Arabic NLP researcher more than for most people. An English-centric tokenizer can double or triple the cost of Arabic input and shortens the context window a model can spend on it, and every choice that causes that was made by a designer before training started.
We start from one real sentence and account for every split. That takes us through the pre-tokenizer, byte-level BPE and the reason a token can cut an Arabic letter in half. We then measure who pays for a shared vocabulary, look at SuperBPE, which lets merges cross spaces, and compress the whole design space into a checklist. The part closes with sentence segmentation, the first step of any parsing or translation pipeline, where one glyph, the period, can end a sentence, close an abbreviation or sit inside a number.
By the end you can
- Read a real tokenization such as the slide sentence and explain every split by a pre-tokenizer rule or a BPE merge.
- State the pros and the con of byte-level BPE with a concrete byte split of an Arabic letter.
- Compute a tokenization premium and name three costs of over-segmenting a low-resource language.
- Explain what SuperBPE changes in the BPE curriculum and what it trades away.
- Walk the tokenizer design checklist and give one consequence for each choice.
- Disambiguate a period with rule-based, statistical and Punkt-style evidence.
Type the sentence Anyhow, she's seen Jane's 224123 flowers anyhow! into the tiktokenizer web app and pick GPT-4o. You get thirteen tokens, and Jurafsky and Martin use exactly this figure in SLP3 to introduce tokenizers in practice. Three of those tokens are worth staring at before any theory: Anyhow at the start is two tokens, Any and how, while the same word at the end is one token, ·anyhow. Jane's becomes ·Jane plus 's, but she's stays whole. And 224123 becomes 224 and 123, with a lone space token in front of it.
| Tokenizer | Vocabulary | Tokens | Pieces |
|---|---|---|---|
| o200k (GPT-4o) | 200K | 13 | Any | how | , | ·she's | ·seen | ·Jane | 's | · | 224 | 123 | ·flowers | ·anyhow | ! |
| cl100k (GPT-4) | ~100K | 14 | Any | how | , | ·she | 's | ·seen | ·Jane | 's | · | 224 | 123 | ·flowers | ·anyhow | ! |
| gpt2 | 50,257 | 14 | Any | how | , | ·she | 's | ·seen | ·Jane | 's | ·224 | 123 | ·flowers | ·any | how | ! |
Every one of these splits has a mechanical explanation, and none of it is in the BPE trainer from part 06. A shipping BPE tokenizer is a pipeline. Hugging Face documents it as four stages: normalization, pre-tokenization, the model (BPE, unigram or WordPiece), and post-processing that adds special tokens. The slide lists the families: most modern tokenizers are BPE-like, with unigram (Kudo 2018) and WordPiece (Schuster and Nakajima 2012) as the variants, and almost all of them sit behind a regex-based Pre-tokenizer.
The pre-tokenizer sets the fences
The pre-tokenizer is a Regular expression that cuts the text into pieces before any merge is counted. GPT-2 uses one pattern, and cl100k and o200k are tightened variants of it. Its alternatives are tried left to right at every position, which is why the order in the table below matters.
The six alternatives of the GPT-2 pre-tokenizer regex, in order
- 's|'t|'re|'ve|'m|'ll|'d
- A clitic contraction becomes its own piece, so 's is split off Jane
- ?\p{L}+
- An optional space followed by letters: a word, with its leading space glued on
- ?\p{N}+
- An optional space followed by any run of digits, unbounded in GPT-2; cl100k and o200k replace it with \p{N}{1,3}, three digits and no space
- ?[^\s\p{L}\p{N}]+
- An optional space followed by punctuation or symbols, so ! and , are pieces
- \s+(?!\S)
- Runs of whitespace that are not followed by a non-space, which keeps one space for the next word
- \s+
- Any remaining whitespace, such as newlines
On We're 350 dogs! Um, lunch? this regex yields We, 're, ·350, ·dogs, !, ·Um, ,, ·lunch, ?, the example SLP3 prints asFigure 2.15. The consequence for BPE is the single most useful rule of this part. Pair counts during training and merges during encoding are computed inside each piece. A pair whose two halves sit in different pieces is never a candidate, so the pre-tokenizer sets an upper bound: the final tokens are always parts of its pieces, never unions of them.
Now the three observations explain themselves. The leading space is part of the word piece, so ·anyhow and Anyhow are different byte strings. The lowercase, space-prefixed form is common in running text and earned a merge up to a whole token; the capitalized, sentence-initial form is rarer and stops at Any plus how. Position matters because the space marker is inside the piece. Second, the Clitic 's: under GPT-2 and cl100k the first regex alternative cuts every contraction into its own piece, so ·she and 's can never merge. o200k attaches the contraction to the word alternative, so the piece is ·she's, and since she's is a very frequent English word it has a token of its own, while ·Jane's does not and falls back to ·Jane plus 's. SLP3 states the same asymmetry: clitics are segmented off proper nouns like Jane but counted as part of frequent words like she's. Third, the digits: cl100k and o200k replace ·?\p{N}+ with \p{N}{1,3}, which caps any digit run at three per piece and, because the new alternative has no optional space, leaves the space before 224123 as a piece of its own (token id 220 in both vocabularies).
Recall
What does a pre-tokenizer do, and why do BPE merges normally not cross its pieces?
Vocabulary size is a parameter, not a result
The Vocabulary of a BPE tokenizer is its base symbols plus one entry per merge, and the trainer stops after k merges. Nothing in the algorithm chooses k. The slide gives a typical range of 30k to 100k; real systems now go further, and SLP3 quotes 50,000, 100,000 or even 200,000.
Vocabulary sizes shipped with well-known models
- GPT-2 (byte-level BPE)
- 50,257
- BERT base (WordPiece)
- 30,522
- Llama 3 (BPE)
- 128K
- GPT-4o, o200k (byte-level BPE)
- 200K
A larger vocabulary buys shorter sequences and more whole-word tokens, at the cost of a bigger embedding table and rarer training examples per token. The number is chosen, and the next concept shows that who benefits from that budget is also chosen.
Byte-level BPE: 256 symbols and no unknown character
The base symbols of the toy BPE in part 06 were characters. Radford et al. (2019) explain why GPT-2 did not do that: a base vocabulary of Unicode code points would exceed 130,000 entries before a single merge, while a byte-level version needs only 256. So GPT-2 runs merges over the UTF-8 bytes of the text. That is Byte-level tokenization, and its three advantages on the slide follow from one fact: every string in every script is a sequence of bytes from a set of 256, so there is no OOV character, any script works, and noisy text with typos or stray symbols still tokenizes. GPT-2 also adds a rule that prevents merges across character categories, with an exception for spaces, so that dog., dog! and dog? do not each become a token.
The con on the slide, that tokens may be less interpretable, is not abstract for Arabic. Arabic letters live in U+0600 to U+06FF, inside the two-byte range of UTF-8, so every letter is two bytes and a merge boundary can fall between them.
Worked example
One Arabic word through three byte-level tokenizers
Code points
كتاب is four code points: U+0643 kaf, U+062A ta, U+0627 alif, U+0628 ba.UTF-8 bytes
Each is two bytes: D9 83, D8 AA, D8 A7, D8 A8. Eight bytes, so the base encoding is eight symbols.Apply each vocabulary's merges
Tokenizer Tokens Byte groups What a human sees gpt2 5 D9 | 83 | D8 AA | D8 A7 D8 | A8 Kaf split in two, fourth token straddles alif and the lead byte of ba cl100k 3 D9 83 | D8 AA | D8 A7 D8 A8 Every token is whole letters o200k 1 D9 83 D8 AA D8 A7 D8 A8 The whole word is one token Interpretability is repaired by merges, not by the base
Under gpt2 the letter kaf is D9 in one token and 83 in another, and the fourth token holds alif plus half of ba. The larger vocabularies had enough Arabic in training to merge whole letters and then the whole word. The base alphabet never changed; the merge budget did.
Try both ideas yourself. The playground below runs the GPT-2 regex on any sentence, replays a small merge list inside each piece and reports which merges the fences blocked, and shows the UTF-8 bytes with the token brackets measured above.
GPT-2 rules: digits unbounded, with the leading space attached, contractions split into their own piece. Vocabulary about 50,257 tokens.
The regex is the GPT-2 pattern with the digit and contraction rules switched per preset. Non-ASCII characters enter the merge stage as their UTF-8 bytes, exactly as in byte-level BPE. The merge list is a short illustrative one, not the real vocabulary, so token counts in the Pieces and Merges views can differ from tiktoken by a token or two. The byte brackets and the token count shown with them are real measurements.
Quick check
Why do BPE merges normally stop at the boundaries a pre-tokenizer produces?
Quick check
In byte-level BPE, what can happen to a two-byte character such as Arabic kaf?
Recall
Give two pros and one con of byte-level BPE, with a concrete example of the con.
Take one meaning and write it twice. The book is on the table. is six words and a period, and its Arabic translation الكتاب على الطاولة. is three words and a period. Run both through cl100k and the English costs seven tokens while the Arabic costs twelve. Same meaning, half the words, nearly twice the tokens.
| Text | Words | cl100k tokens | o200k tokens | Tokens per word (cl100k) |
|---|---|---|---|---|
| The book is on the table. | 6 | 7 | 7 | 1.17 |
| الكتاب على الطاولة. | 3 | 12 | 6 | 4.0 |
The o200k column shows the fix: a 200K vocabulary trained on more multilingual text spent merges on Arabic, so كتاب became one token and the Arabic sentence dropped to 6 tokens. The premium comes from how the budget was spent, not from the script.
The cause is the merge budget of the previous concept. BPE spends its k merges where the frequencies are, and English dominates the training text of most large models. English words therefore become single tokens while Arabic words fragment into letter-sized byte tokens. SLP3 puts it plainly: multilingual tokenizers tend to use most of their tokens for English, and other languages get poorer representations. The shared Vocabulary is a budget, and a shared budget favors whoever was most frequent when it was allocated. That is the slide's first two bullets in one sentence: shared vocabularies favor high-resource languages, so low-resource languages are over-segmented into longer sequences.
Petrov et al. (2023) turn this into a number. Take parallel sentences, tokenize both, and divide the length for language A by the length for language B. They call the ratio the tokenization premium of A relative to B.
| Language | GPT-2 / RoBERTa tokenizer | ChatGPT / GPT-4 (cl100k) | ByT5 (bytes) |
|---|---|---|---|
| Portuguese | 1.94 | 1.48 | n/a |
| German | 2.14 | 1.58 | n/a |
| Chinese (Simplified) | 3.21 | 1.91 | 0.93 |
| Standard Arabic | 4.40 | 3.04 | 1.60 |
| Burmese | 16.89 | 11.70 | 3.51 |
| Shan | 18.76 | 15.05 | 3.94 |
Arabic pays 4.40 times the English token count under the GPT-2 vocabulary and 3.04 under cl100k. Shan and Burmese pay over fifteen and eleven times. The ByT5 column shows that even byte and character models, which have no merges at all, are unequal because scripts differ in bytes per character: Petrov et al. report up to fifteen times difference for subword models and over four times between the byte encodings of Burmese or Tibetan and Chinese. Ahia et al. (2023) measured the same effect on ChatGPT across 22 languages, with some needing five times as many tokens as others, and name two causes: how much of the language was in the pretraining data, and inherent properties of the language and its script. In their analysis of the BLOOMZ tokenizer they flag Arabic as an outlier with more tokens than some other mid-resourced languages.
Three bills for one over-segmented sentence
- Compute. Every layer processes every token, so three times the tokens is at least three times the work, and self-attention, whose cost grows with the square of sequence length, makes long inputs worse still.
- Context. A window of fixed token length holds a third as many Arabic words as English words. Ahia et al. note that fewer in-context examples fit, which directly lowers few-shot quality.
- Money and quality. APIs bill per token, so Ahia et al. conclude that speakers of many languages are overcharged while obtaining poorer results, and SLP3 adds that fragmented tokens give poorer representations of meaning.
Premium under ArabicBERT, relative to Arabic (Petrov et al. 2023, Table 2)
- Kanuri (Arabic script)
- 1.27
- Acehnese (Arabic script)
- 1.73
- English
- 1.82
The slide's third bullet, that tokenizer design affects fairness and performance, is an engineering decision you can make differently.
Quick check
Under an English-heavy vocabulary, why does Arabic text become more tokens than its English translation?
Recall
Why does a low-resource language get longer token sequences under a shared vocabulary, and what are two consequences?
SuperBPE: letting merges cross the space
If fences limit how much a vocabulary can compress, one way to compress more is to remove a fence late in training. Liu et al. (2025) call this SuperBPE: a pretokenization curriculum for BPE that first learns subwords under the ordinary whitespace fences, then continues with merges that are allowed to bridge whitespace and produce superwords. The figure on the slide is their example. Ordinary BPE gives By | the | way | , | I | am | a | fan | of | the | Milky | Way | ., thirteen tokens. SuperBPE gives By the way | , I am | a | fan | of the | Milky Way | ., seven.
The gain is the slide's stated goal, efficiency. At a 200K vocabulary SuperBPE beats ordinary BPE on every measure the authors report, so the extra training stage pays for itself.
SuperBPE at 200K vs BPE (Liu et al. 2025)
- Token reduction vs BPE
- 33%
- Average over 30 downstream tasks
- +4.0 points
- MMLU
- +8.2 points
- Inference compute
- -27%
SLP3 mentions BoundlessBPE (Schmidt et al. 2025) as a sibling method with the same idea.
The tradeoff is the slide's third bullet, Compositionality. Under ordinary BPE, Way in Milky Way and way in By the way share visible structure with every other use of the word. Once Milky Way is one token, the model must learn its relation to way from scratch, and a rare phrase that almost matches a superword is split in an unfamiliar way. Fewer tokens means less shared structure across tokens.
Every surprise in this part came from a switch someone set before training: whether the space belongs to the next word, whether digits are capped, whether contractions split, how many merges to make, which languages got the budget. The slide collects those switches into a checklist. Treat each line as a question with a consequence, because that is how an exam or a design review will ask it.
The tokenizer design checklist, each choice with its consequence
- Pre-tokenization
- Split on whitespace, and what happens to the space? Drop it (BERT), glue it onto the next piece (·world in GPT-2) or keep it as an explicit symbol (▁ in SentencePiece). The answer decides whether ·anyhow and anyhow can ever share a token, fixes the fences that merges cannot cross, and decides whether detokenization can restore the original text exactly. SuperBPE removes the fence in its second stage.
- Normalization
- NFC or NFD, lowercasing, accent stripping? BERT uncased runs NFD, lowercase and strip-accents, so Héllò becomes hello and case and diacritics are gone for good. GPT-style tokenizers keep them, at the cost of separate entries for Apple and apple.
- Special tokens
- <BOS>, <EOS>, <UNK>, <PAD>. A byte-level tokenizer never needs <UNK>. GPT-2 has one special token, <|endoftext|> at id 50256; BERT adds [CLS] and [SEP] in post-processing.
- Numbers
- Cap digit runs (\p{N}{1,3}) or split every digit? Decides whether 224123 is two tokens or six, and shapes how well the model does arithmetic on numbers it has never seen whole.
- URLs and emoji
- Byte fallback keeps them representable: gpt2 encodes 😀 (F0 9F 98 80) as F0 9F 98 plus 80. A URL becomes a long run of punctuation and word pieces unless a rule keeps it whole.
- Multilingual coverage and bias
- How much of the vocabulary budget each language gets. An English-heavy budget gives Arabic a premium of 3.04 under cl100k and Shan 15.05, which is the fairness cost of the previous concept.
Three answers to the spaces question
The slide's pre-tokenization line asks one question with three real answers. Once the text is split on whitespace, what happens to the space? The choice fixes the Space marker (end-of-word marker) convention the model will live with, and it decides whether detokenization can recover the original string.
| Tokenizer | Pieces | Where the space goes | Detokenization |
|---|---|---|---|
| BERT | Hello | world | Space discarded | Not reversible: detokenization cannot say where the spaces were |
| GPT-2 | Hello | ·world | Space glued onto the next piece | Reversible: every piece carries its leading space |
| SentencePiece | ▁Hello | ▁world | Space kept as an explicit ▁ symbol | Losslessly reversible: replace ▁ by a space and the original text is restored |
BERT throws the space away, which keeps the alphabet small but makes the token stream lossy: don't and the three tokens don, ', t cannot be told apart from a hyphenless spelling once the spaces are gone. GPT-2 glues the space onto the following piece, so ·world and world are different entries and the original spacing is recoverable. SentencePiece keeps the space as an explicit ▁ symbol, which is exactly reversible: swapping ▁ back to a space restores the input byte for byte. It also means the regex fences from the first concept apply to a text where spaces are ordinary symbols, so SentencePiece can in principle learn a merge that crosses what used to be a word boundary.
Quick check
Which checklist choice makes Héllò and hello identical?
The rule that ties the list together is that all of it is frozen with the model. The Unicode normalization form, the case folding decision, the Special tokens and the Pre-tokenizer regex are recorded in the tokenizer file, and Hugging Face's pipeline documentation warns that changing the normalizer or the pre-tokenizer requires retraining the tokenizer, which in turn means the embeddings of the language model no longer match. You cannot fix an English-centric tokenizer after the fact; you choose it before the first gradient step.
Recall
Name four items of the tokenizer design checklist and one consequence for any one of them.
Here is a passage with six periods, one question mark and one exclamation mark: Dr. Ahmad arrived at 5 p.m. on Monday. He paid 3.50 riyals. Was it enough? Yes! It contains four sentences. A splitter that cuts at every period would produce seven fragments and would glue the last two sentences together. Decide for yourself which marks end a sentence before reading the rules.
Click a punctuation mark to cycle it through sentence boundary, not a boundary, and undecided. Then check. Each verdict names the rule and the feature that decided it.
Dr Ahmad arrived at 5 pm on Monday He paid 350 riyals Was it enough Yes
A double bar marks a sentence boundary, a middle dot marks a period that belongs to its word or number. After checking, an accent ring means correct and a teal ring with strikethrough means wrong or undecided.
Sentence segmentation is the task of finding sentence boundaries, and the slide names its usual customers: parsing and machine translation, both of which take one sentence at a time. SLP3 states the difficulty exactly. Question marks and exclamation points are relatively unambiguous markers of sentence boundaries. The period is ambiguous between a sentence boundary and an abbreviation marker such as Dr. or Inc., and it can even do both at once: when a sentence ends in Inc., one period marks the abbreviation and the boundary. Kiss and Strunk (2006) list the period's other jobs too: initials, ordinal numbers and ellipses, and in their corpora abbreviations account for up to 30% of the candidate boundaries.
Rules, lexicons and the joint solution
The slide's rule-based heuristics combine punctuation with capitalization patterns, an abbreviation list and quote or bracket balancing. Each rule is a feature that votes on one candidate mark.
Rule-based features and what they decide
- Punctuation plus capitalization
- A period followed by whitespace and a capitalized token suggests a boundary; a lowercase next token argues against one
- Abbreviation list
- If the token before the period is Dr, Inc, p.m. or another listed abbreviation, the period belongs to the word
- Quote and bracket balancing
- A closing quote or bracket after the mark still belongs to the sentence that is ending
- Digit on both sides
- 3.50 and 3.14 are numbers, so a word tokenizer keeps them whole and the segmenter never sees the period
Notice the conflict in the exercise. After Dr. comes Ahmad, capitalized, so the capitalization rule votes for a boundary and only the abbreviation lexicon overrules it. After p.m. comes on, lowercase, so both rules agree. This is why the slide says segmentation is often done jointly with Tokenization and abbreviation lexicons: if the tokenizer has already kept Dr., p.m. and 3.50 as single tokens, the segmenter never has to look at those periods. Stanford CoreNLP states its rule in exactly that form: a sentence ends when a sentence-ending punctuation mark is not already grouped with other characters into a token, optionally followed by closing quotes or brackets. SLP3 notes the abbreviation dictionary can be hand-built or machine-learned.
Learning the boundary
The statistical approach on the slide replaces hand-tuned votes with a classifier that learns the probability of a boundary from annotated data. Its features are the same evidence the rules used: the token before the mark, whether it is in an abbreviation list, its length, whether the next token is capitalized, whether the next token is a frequent sentence starter, and, in neural models, the surrounding context as a whole. Kiss and Strunk (2006) went one step further and removed the annotation. Their Punkt system, the default sentence tokenizer in NLTK, is unsupervised and language independent. It treats an abbreviation as a very tight collocation of a truncated word and a final period, which can be detected from raw text by asking whether the word occurs with a period far more often than chance, helped by the facts that abbreviations are usually short and sometimes contain internal periods. It also learns frequent sentence starters and collocations across a period. Its measured results on newspaper text are in the table.
Punkt boundary detection results (Kiss and Strunk 2006)
- Mean accuracy, 11 languages
- 98.74%
- Boundary error, English
- 1.65%
- Boundary error, German
- 0.35%
| Approach | How it decides | Needs | Strengths and limits |
|---|---|---|---|
| Rule-based | Hand-written heuristics and a hand-built abbreviation list | None | Fast and transparent; brittle on new domains and languages |
| Statistical (supervised) | P(boundary | context) | Annotated sentence boundaries | Adapts to a domain; needs labeled data per language |
| Punkt (unsupervised) | Abbreviations as tight collocations of a truncated word and a period, plus sentence starters | Raw text only | Language independent; 98.74% mean accuracy over eleven languages |
Quick check
Which punctuation mark is hardest for sentence segmentation, and why?
Recall
Why is the period harder than the question mark for sentence segmentation, and what are two features a classifier would use?
Recall
What does Punkt learn without any labeled data?
Recap
If you remember nothing else
- A production tokenizer is a pipeline: normalization, regex pre-tokenization, a BPE, unigram or WordPiece model, then special-token post-processing.
- Merges live inside pre-tokenizer pieces. The leading space belongs to the piece, so Any|how at the start and ·anyhow later are different byte strings.
- cl100k and o200k cap digit runs at three per piece, and vocabulary size is a design parameter: 50,257 for GPT-2, 30,522 for BERT, 128K for Llama 3, 200K for GPT-4o.
- Byte-level BPE starts from 256 symbols, so nothing is out of vocabulary, but a token may cut a multi-byte character: gpt2 splits kaf into D9 and 83.
- Shared vocabularies favor English. Under cl100k Arabic pays a premium of 3.04 and Shan 15.05 (Petrov et al. 2023); longer sequences cost compute, context and money.
- SuperBPE adds a second stage whose merges cross spaces: up to 33% fewer tokens at 200K, at the price of compositionality.
- Every checklist switch is frozen with the model: pre-tokenization, normalization, special tokens, numbers and URLs, multilingual coverage.
- The period is ambiguous and the question mark and exclamation mark mostly are not. Abbreviation lexicons, capitalization, decimal checks or Punkt's collocation test decide.
Sources
- Speech and Language Processing, 3rd edition draft, chapter 2: Words and TokensBookJurafsky and Martin, StanfordGPT-4o tokenization of the slide sentence (2.4.3), the GPT-2 regex output (2.6.9), sentence segmentation (2.8.1)(opens in a new tab)
- Language Models are Unsupervised Multitask LearnersPaperRadford et al., OpenAI, 2019Section 2.2: byte-level BPE, 130,000 code points versus 256 bytes, the character-category merge rule(opens in a new tab)
- tiktoken encoding definitionsDocsOpenAI, GitHubPre-tokenizer regexes and vocabulary sizes of gpt2, cl100k_base and o200k_base(opens in a new tab)
- TiktokenizerDocstiktokenizer.vercel.appVisualizes tokenizations, the tool named on slide 49(opens in a new tab)
- Neural Machine Translation of Rare Words with Subword UnitsPaperSennrich, Haddow and Birch, ACL 2016BPE for subword tokenization(opens in a new tab)
- Subword Regularization: Improving Neural Network Translation Models with Multiple Subword CandidatesPaperKudo, ACL 2018The unigram language model tokenizer(opens in a new tab)
- Japanese and Korean Voice SearchPaperSchuster and Nakajima, ICASSP 2012WordPiece(opens in a new tab)
- Language Model Tokenizers Introduce Unfairness Between LanguagesPaperPetrov, La Malfa, Torr and Bibi, NeurIPS 2023Tokenization premium definition and Table 1 numbers; ByT5 and ArabicBERT premiums(opens in a new tab)
- Do All Languages Cost the Same? Tokenization in the Era of Commercial Language ModelsPaperAhia et al., EMNLP 202322 languages on ChatGPT and BLOOMZ; overcharged while obtaining poorer results; Arabic as an outlier under the BLOOMZ tokenizer(opens in a new tab)
- SuperBPE: Space Travel for Language ModelsPaperLiu et al., 2025Two-stage pretokenization curriculum; 33% fewer tokens at 200K; +4.0% average, +8.2% MMLU, 27% less inference compute(opens in a new tab)
- The tokenization pipelineDocsHugging Face tokenizers documentationNormalization, pre-tokenization, model, post-processing; BERT vocabulary of 30,522; retraining after changing components(opens in a new tab)
- Introducing Meta Llama 3DocsMeta AI128K token vocabulary(opens in a new tab)
- Unsupervised Multilingual Sentence Boundary DetectionPaperKiss and Strunk, Computational Linguistics 32(4), 2006Punkt: abbreviations as collocations; 98.74% mean accuracy over eleven languages(opens in a new tab)
- nltk.tokenize.punktDocsNLTK documentationThe unsupervised Punkt sentence tokenizer shipped with NLTK(opens in a new tab)