Elamur Research

Tokenization efficiency of current foundational large language models for the Ukrainian language

Paper · 2025 · Daniil Maksymenko and Oleksii Turuta

Summary

The same text can take up very different amounts of space depending on how a tokenizer divides it. Before a language model processes or produces text, it represents the text as tokens, which can correspond to words, word fragments, or even individual bytes. A tokenizer that breaks Ukrainian words into more pieces than English words uses more of the available context for comparable material. It can also increase the work of generating an answer and the cost of services that charge by the token. Maksymenko and Turuta measure this difference directly, using the average number of tokens per word, a metric called fertility. Their study focuses on tokenization.

The authors compare existing tokenizers on general Ukrainian and English writing from the Brown corpora, then on laws, scientific abstracts, and VueJS documentation. On Ukrainian Brown, the Ukrainian-specific GPT-2 tokenizer uses 1.30 tokens per word, Llama 3.1 uses 1.88, and GPT-4o/4o-mini uses 1.98. On English Brown, the corresponding figures are 1.96, 1.08, and 1.07. The Ukrainian specialist reverses the usual language advantage in this comparison. It also leads on Ukrainian laws and abstracts, while Llama 3.1 uses the fewest tokens per word on the Ukrainian documentation sample. A tokenizer’s advantage therefore depends on what the text contains as well as which language it is written in.

The study also asks what happens when the input changes. Correcting spelling and grammar produces very small shifts in aggregate fertility for the selected pairs, which have the same word counts before and after correction. The grammatical case experiment shows a clearer effect. Forms outside the nominative generally take more tokens in the tested word sample. Writing Ukrainian in Latin letters helps some tokenizers that fragment Cyrillic heavily, including standard GPT-2 and GPT-3.5/4. The strongest multilingual tokenizers on native-script Ukrainian Brown use more tokens after transliteration.

The benchmark can be run on existing tokenizers without training a new system. It combines corpus counts with checks of vocabulary entries, isolated Ukrainian letters, and changes to the same underlying texts or words. Those checks reveal different kinds of coverage. A tokenizer can handle every letter in the alphabet test and still divide running text relatively finely. The results establish how compactly the tested tokenizers represent these inputs. The quality of generated Ukrainian, the ability to understand specialized content, and the actual time or price of serving a request require separate measurements.

Deep dive: Tokenization efficiency of current foundational large language models for the Ukrainian language

A benchmark of Ukrainian tokenization compares general and specialized text with English and tests the effects of spelling, script, and word forms. · about 31 minutes to read

The problem and its context

A tokenizer can represent a language and still fragment it

Consider a Ukrainian word a tokenizer has never encountered in full. It can still encode that word if it knows some of the letter sequences inside it. A system with weaker coverage may split the same word into smaller pieces, and a fallback can represent an unfamiliar character through the bytes that encode it. Each of these routes produces a usable sequence of token identifiers. The length of that sequence depends on which pieces the tokenizer has available and which combinations its rules allow. The paper treats this as a question about the resources used to represent a language. The relevant mechanism is subword tokenization.

That distinction matters in an autoregressive system, which generates each successive token using the input and what it has already produced. If the desired output occupies more tokens under a particular tokenizer, the decoder has more output positions to fill. On the input side, token counts determine how much room a passage takes in a context window, the space available for the sequence the system can process. And where service pricing is based on input and output token counts, segmentation can affect billing. The paper groups these consequences under inference cost. Its experiments count tokens, which are relevant to each consequence even though the connection to time, compute, or price depends on the system in use. This is the setting in which the authors evaluate tokenizers for large language models.

Training composition offers an explanation for why such differences arise. The paper quotes the Llama 3 training report as describing a mix of 95% English and code and 5% other languages. A system trained in such a setting can still handle Ukrainian. The tokenizer may nonetheless have a richer supply of reusable pieces for the material that occurs more frequently in training. The authors point out that the same principle could favor Ukrainian or Georgian if the training material emphasized one of those languages. The study treats English as a useful comparison because of its prominence in the systems under discussion. The Llama 3 Herd of Models

The paper places byte pair encoding, or BPE, and SentencePiece-style tokenizers among the common approaches. In the account the authors give, these systems learn from recurring sequences in text. That helps them construct a vocabulary that can cover many words using a finite set of entries. Fallback mechanisms supply a way to represent material that preferred entries fail to cover. The tradeoff is that broad representability can coexist with expensive segmentation. Counting encodable words would miss the difference between a word that takes a compact sequence and a word that requires several fallback pieces.

Script, word structure, and subject matter pose different problems

Ukrainian is a useful case because alphabet coverage and word coverage are distinct. Having an entry for a Cyrillic letter can prevent a byte split for that letter. To encode a word compactly, the tokenizer also needs entries for combinations that occur in Ukrainian. Even a large pool of Cyrillic entries can contain sequences frequent in other languages that use the script. The authors therefore distinguish a count of script-compatible entries from evidence that those entries help on Ukrainian text.

Word formation adds another dimension. A stem can appear with different endings, and affixes can alter a word’s grammatical role or meaning. The paper describes a desirable segmentation in which recurrent parts of words remain available as reusable units. A frequency-driven tokenizer can discover a piece that happens to match a stem or affix. It can also put the boundary inside a meaningful unit or join part of a stem to an ending. The authors recognize that the relationship between these boundaries and downstream performance remains a research question. They cite both work on alternative segmentation schemes and a comparison reporting comparable performance on Spanish number agreement across different schemes. The broader linguistic issue is morphology. Relevant earlier studies include Subword Regularization and Different Tokenization Schemes Lead to Comparable Performance in Spanish Number Agreement.

The vocabulary must also serve different kinds of writing within a language. The authors contrast ordinary prose with text that uses a specialized lexicon. A legal provision or an abstract can contain longer words and recurring expressions that differ from those in more general writing. Software documentation adds a different mixture, with source code and formatting alongside prose. If these ingredients are covered unevenly, an average measured on a general corpus may be a poor guide to the amount of context that a particular application needs. The paper makes this distinction part of the benchmark by preserving separate measurements for each domain.

Earlier studies supplied metrics for different questions

As the authors describe it, prior work had already established that multilingual tokenizers can use different numbers of tokens for comparable content across languages. They discuss a broad cross-language comparison that included Latin, Cyrillic, Arabic, and other scripts. That work motivates the concept of a tokenizer premium, an excess relative to an optimal comparison point, expressed in compute or in a performance measure. The paper also situates token counts in the discussion of commercial costs, where a particular input or output can be more expensive because of how it is split. Language Model Tokenizers Introduce Unfairness Between Languages and Do All Languages Cost the Same?

The authors also describe earlier uses of fertility. Dividing a tokenizer’s output count by the word count provides an immediate measure of how finely a corpus is divided. Earlier evaluations used fertility in comparing a target language with English or in evaluating a proposed bilingual tokenizer against standard GPT-2. Other work adapted pretrained systems to particular languages or extended the vocabulary and the associated embeddings, the learned representations attached to token identifiers. These studies gave researchers ways to measure or improve language coverage. Maksymenko and Turuta use fertility to ask a wider set of questions about the same target language and the same tokenizers. How Good Is Your Tokenizer? and Efficiently Adapting Pretrained Language Models to New Languages

Another earlier framework discussed in the paper measures vocabulary allocation, reuse of entries across languages, and character length, then relates those properties to performance after training systems on different tokenizers. Its comparisons distinguish tasks that assign a label to particular words or spans from tasks that classify, retrieve, or rank larger pieces of text. An allocation pattern can be helpful for one type of task and less helpful for another. Maksymenko and Turuta pursue a more direct measurement. They hold the tokenizer fixed for each run, vary the text it receives, and ask how many positions that text occupies. This places their study between a static inspection of the vocabulary and a downstream benchmark of an entire language system.

The method, step by step

Count the units the tokenizer actually emits

The method begins by giving an existing tokenizer a prepared text sample and counting the emitted tokens. The word count comes from the text, separately from the token sequence under evaluation. A common word denominator lets the authors compare tokenizers on a corpus even when their segment boundaries look very different. Fertility is the main reported measure.

F = T ÷ W

F is tokenization fertility for the evaluated sample. T is the total number of tokens emitted when the tokenizer processes that sample. W is the sample’s word count. ÷ indicates division, and = equates the resulting ratio with fertility. The unit is tokens per word.

The authors retain the text’s original case and keep function words and endings. They apply neither stemming nor lemmatization, which would replace inflected forms with reduced or dictionary forms. They also pass text through the tokenizer in sequence rather than sending each word through in isolation. Consequently, the numerator reflects how the tokenizer processes surrounding spaces, punctuation, and formatting. The letter test is a deliberate exception because it is designed to inspect each character by itself.

The authors use 1.0 as the ideal of a token for every word. They pair the goal of approaching that value with a second goal, consistency when the language or domain changes. This accommodates the fact that a complex word can reasonably receive multiple pieces. A single corpus ratio leaves the distribution of those pieces unobserved. A tokenizer might handle common words very economically while repeatedly splitting a small group of terms. That is one reason the study accompanies whole-corpus fertility with narrower checks.

The paper gives two formulas for premiums in its discussion of earlier evaluation methods. The compute version expresses the excess relative to an optimal reference in floating-point operations.

P꜀ = (Cₑ − Cₒ) ÷ Cₒ

P꜀ is the compute-based tokenizer premium. Cₑ is the estimated number of floating-point operations for the setting under evaluation, and Cₒ is the corresponding count for the optimal reference. The subtraction sign − forms the excess in operations. The parentheses group that excess before ÷ divides it by the reference count, and = defines the premium.

The paper gives an analogous expression for a performance measure and mentions validation loss as a possible quantity to compare.

Pₘ = (Mₑ − Mₒ) ÷ Mₒ

Pₘ is the performance-based tokenizer premium. Mₑ is the value of the chosen metric for the evaluated setting, and Mₒ is its value for the optimal reference. The sign − subtracts the reference value. The parentheses group the difference, ÷ expresses it relative to the reference, and = gives the resulting premium. Its interpretation depends on what the chosen metric measures.

These premium formulas require a defensible reference and, for comparisons based on validation performance, training or evaluating systems with different segmentation schemes. The Ukrainian benchmark uses the fertility formula for its own corpus comparisons. It needs the tokenizers and the evaluation texts, so a new training run or a new set of training hyper-parameters is unnecessary.

How the Ukrainian tokenization benchmark works

The steps in order.

How the Ukrainian tokenization benchmark worksStep 1: Classify vocabulary entries by script1. Classify vocabulary entries by scriptStep 2: Measure entry lengths and isolated alphabet coverage2. Measure entry lengths and isolated alphabet coverageStep 3: Count tokens in general Ukrainian and English text3. Count tokens in general Ukrainian and English textStep 4: Compare laws, abstracts, and software documentation4. Compare laws, abstracts, and software documentationStep 5: Test paired original and corrected Ukrainian texts5. Test paired original and corrected Ukrainian textsStep 6: Retokenize Ukrainian Brown in Latin script6. Retokenize Ukrainian Brown in Latin scriptStep 7: Compare Ukrainian forms across grammatical cases7. Compare Ukrainian forms across grammatical cases

Choose baselines that make the language preference visible

The standard GPT-2 tokenizer provides a historical comparison. The Ukrainian GPT-2 tokenizer is the language-specialist control. Its vocabulary was trained from scratch using Wikimedia dumps and OSCAR data. It helps distinguish the capacity of a tokenizer designed for Ukrainian from what is achieved when Ukrainian shares the vocabulary with other languages. Evaluating both on English as well as Ukrainian makes the preference of each visible. The authors identify Ukrainian GPT-2 as a monolingual system and still count how its tokenizer segments English. The English count measures representational compactness on that sample regardless of the system’s intended use.

To observe changes within families, the authors include Llama 2 and Llama 3.1, whose tokenizers differ. They likewise compare Phi 2 with Phi 3.5. A Mistral group covers 7B, Large, and Mixtral through their shared tokenizer, while Mistral Nemo is evaluated separately because it uses a different tokenizer designed with multilingual use in mind. This gives the benchmark both comparisons between generations and comparisons between families. Relevant background includes Llama 2, Textbooks Are All You Need, and the Phi-3 Technical Report.

The authors treat Gemma, Gemma 2, and Gemini 1.5 as a shared tokenizer group for the benchmark. They also group Qwen 1.5 with Qwen 2 VL. The two OpenAI groupings are GPT-3.5/4 and GPT-4o/4o-mini, each with its own tokenizer. A grouped row therefore represents a single segmentation measurement. It carries no information about differences in generation quality among the systems using that tokenizer. The system reports provide the background for Gemma, Gemma 2, and Gemini. The earlier OpenAI family is represented in the GPT-4 Technical Report.

Finally, the panel includes Mamba, whose sequence architecture differs from the attention-based systems discussed in the paper. The authors nonetheless apply the same counting procedure to its tokenizer. Claude 3 enters through Xenova’s approximation because the official tokenizer was unavailable to the authors. That makes its measurements properties of the approximation. In a comparison concerned with exactly which substrings become tokens, access to the actual tokenizer matters even when a substitute seems close.

Examine the vocabulary and test its smallest visible units

The authors record vocabulary size from each implementation and inspect its entries. To count English entries, they select tokens made up of English letters and permitted punctuation or underscores, with an English letter required. They use a Cyrillic rule that allows Ukrainian-compatible Cyrillic characters and underscores and excludes selected letters absent from Ukrainian. An entry can pass that rule while being common chiefly in another language. The authors accordingly call the resulting group Cyrillic and use it as an approximation to coverage that could be relevant for Ukrainian.

They describe each group with characters per token and bytes per token, reported through means and medians. Character length counts the written symbols in an entry. Byte length counts the space those symbols require in the encoding used in the experiment. Cyrillic characters can take 2 bytes in UTF-8, so byte and character averages can differ even when the token spans an ordinary sequence of letters. The authors use entry length as a clue to how much written material a token can cover. They give it a stronger interpretation for scripts where letters encode sounds, while cautioning that a single character in a logographic writing system may already carry substantial information.

The alphabet test then gives every tokenizer the same set of 66 individual Ukrainian characters. The set comprises 33 lower-case letters, 32 upper-case forms with upper-case soft sign omitted, and the apostrophe. The aim is to find characters that receive multiple tokens when tested individually. Since a Cyrillic character can be represented using its component bytes, this reveals the kind of fragmentation that can happen before a word’s lexical or grammatical structure even comes into play. The resulting average is over tested characters. The fertility in the running-text experiments is over words.

The distinction also gives the authors a way to explain concrete cases. Their illustration uses the city name Kharkiv in English and its Ukrainian spelling. With GPT-3.5, the Ukrainian initial capital is represented by byte pieces. Consequently, a single visible letter occupies multiple positions before the rest of the name has been encoded. The example links an alphabet-level failure to a word-level count. The general corpus test then shows how much segmentation occurs across actual text, where letter combinations and their contexts recur at unequal frequencies.

Use a general baseline and keep the specialized corpora apart

The English and Ukrainian Brown corpora establish baselines across multiple genres. The authors obtain the English data through NLTK and merge material by genre, producing 15 larger texts from 500 documents. They expect this organization to preserve the fertility measurement because the analysis centers on the overall number of tokens relative to words. They record total tokens, the average token count per text, and fertility. The last measure is the main basis of comparison because the grouping and typical size of the text units differ between corpora.

For the specialized comparisons, the authors use English and Ukrainian material assembled in their earlier work. The laws are sentence samples from texts published on the Ukrainian Parliament website. The scientific material comprises abstracts, mainly in economics and physics. The documentation is from the VueJS framework and contains code alongside natural language. The authors compute the same metrics for each domain and compare it with that language’s Brown baseline. A comparison between languages within a domain addresses a different question from a comparison between domains within one language. The first concerns the burden associated with the language versions. The second concerns how a change in the text’s subject and composition affects that tokenizer.

Change the input while retaining a reference

For the correction experiment, the authors draw from Grammarly’s Ukrainian grammatical error correction corpus, also called UA-GEC. They use NLTK’s word tokenizer to count words in each original version and its correction. A pair is retained when those counts agree. The filter leaves 443 texts for analysis and favors localized edits, such as spelling changes and corrections to forms. A correction that joins or separates words, or substantially rewrites a sentence and changes its word count, falls outside the selected comparison. Equal word counts give both versions the same denominator, making fertility responsive to changes in the number of emitted tokens.

For the script experiment, the authors apply the Ukrainian government’s standard Latin transliteration to Ukrainian Brown. The tokenizer processes the Cyrillic corpus and the Latin rendering of the same material. English Brown remains a separate reference that shows how the tokenizer performs on English writing. This matters because high coverage of English letter combinations does not guarantee high coverage of the sequences produced by transliterating Ukrainian. The comparison measures the result of changing the spelling system while retaining the underlying Ukrainian corpus.

The authors also collect 19,000 words for a comparison of grammatical cases. They use the nominative as the reference and measure fertility for genitive, dative, accusative, instrumental, locative, and vocative forms as well. Case changes can alter the ending or other parts of a form, giving the tokenizer a different character sequence for the same lexical item. The case measurements and the reported mean difference from nominative expose how sensitive a tokenizer is to those changes. This experiment uses its own word sample, so its absolute scores belong to that sample rather than to the running text in Brown.

Experiments and results

Vocabulary size and alphabet coverage capture different properties

In the vocabulary comparison, Gemma/Gemma 2/Gemini has 256,000 entries, of which 12,009 pass the Cyrillic filter. Those entries have a mean length of 5.20 characters. Ukrainian GPT-2 has 50,304 entries, with 11,248 passing the Cyrillic filter and a mean of 4.68 characters in that group. These are inventory figures. Every qualifying entry contributes to the length statistic even if it rarely appears in the Ukrainian evaluation corpora. Corpus fertility later reflects how the tokenizer uses its vocabulary on actual input.

The Llama comparison illustrates why the inventory needs to be read alongside the corpus results. Llama 2 has 32,000 entries and 2,768 qualifying Cyrillic entries, with a Cyrillic mean of 4.11 characters. Llama 3.1 has 128,262 entries but 2,558 qualifying Cyrillic entries and a corresponding mean of 3.61 characters. The larger vocabulary devotes room to more entries overall while the particular Cyrillic count and average tracked here fall. It is possible for coverage of useful Ukrainian strings to improve in this configuration. The counts alone leave that question open.

On the isolated alphabet test, Ukrainian GPT-2, Qwen 1.5/2 VL, and Gemma/Gemma 2/Gemini cover the tested symbols without resorting to bytes. Llama 3.1 and GPT-4o/4o-mini cover all but the upper-case Ukrainian Ґ. Standard GPT-2 and Phi 2 are the weakest on this check, resorting to bytes for 74% of the tested characters. Each has a reported alphabet-test fertility of 1.74 tokens per tested character. Llama 3.1 has 1.02. These measurements describe how the tokenizers handle the same set of short, isolated inputs, giving a direct view of fallback behavior.

The Kharkiv illustration carries the connection one step further. The authors report that GPT-3.5 and GPT-4o each use three tokens for the English spelling. GPT-4o also uses three for the Ukrainian spelling. GPT-3.5 uses six in Ukrainian, with two needed for the initial capital. The resulting sequence difference matters for this particular name. Since the example was chosen to show a byte split, the corpus experiments are needed to establish how broad the difference is in ordinary prose.

General Ukrainian text favors a specialized vocabulary

The Ukrainian Brown corpus contains 1,373,811 words, while the English Brown corpus contains 1,173,714. Standard GPT-2 reaches 6.31 tokens per word on Ukrainian Brown and 1.08 on English Brown. Phi 2 also reaches 6.31 on Ukrainian Brown. The Ukrainian-trained GPT-2 has the lowest fertility on Ukrainian Brown at 1.30, with 1,779,807 emitted tokens on that corpus. Its English Brown fertility is 1.96. The comparison exposes the effect of shifting the target of vocabulary training even when the two systems share the familiar GPT-2 name.

Selected tokenizers on Ukrainian Brown by tokens per word

The Ukrainian specialist has the lowest fertility, followed by Llama among the multilingual entries shown.

Selected tokenizers on Ukrainian Brown by tokens per wordUkrainian GPT-2 (this paper): 1.30Ukrainian GPT-2 (this paper)1.30Llama 3.1: 1.88Llama 3.11.88Gemma/Gemma 2/Gemini: 1.92Gemma/Gemma 2/Gemini1.92GPT-4o/4o-mini: 1.98GPT-4o/4o-mini1.98Mistral Nemo: 2.04Mistral Nemo2.04Llama 2: 2.29Llama 22.29Qwen 1.5/2 VL: 2.83Qwen 1.5/2 VL2.83GPT-3.5/4: 3.32GPT-3.5/43.32Claude 3 approximation: 3.45Claude 3 approximation3.45Standard GPT-2: 6.31Standard GPT-26.31
The numbers
System or settingtokens per word
Ukrainian GPT-2 (this paper)1.30
Llama 3.11.88
Gemma/Gemma 2/Gemini1.92
GPT-4o/4o-mini1.98
Mistral Nemo2.04
Llama 22.29
Qwen 1.5/2 VL2.83
GPT-3.5/43.32
Claude 3 approximation3.45
Standard GPT-26.31

Llama 3.1 leads the multilingual entries on Ukrainian Brown, with 2,578,473 emitted tokens and a fertility of 1.88. Gemma/Gemma 2/Gemini follows at 1.92, and GPT-4o/4o-mini at 1.98. Their English Brown values are 1.08, 1.07, and 1.07, respectively. English remains more compact even for the multilingual tokenizers with the strongest Ukrainian results. The Ukrainian specialist offers a different tradeoff, with a better Ukrainian result and higher English fertility than the other tokenizers.

For Qwen 1.5/2 VL, the Ukrainian Brown table gives 2.83 tokens per word, alongside 1.09 on English Brown. Its full coverage in the alphabet test therefore coexists with relatively fine segmentation of Ukrainian words. GPT-3.5/4 has 3.32 on Ukrainian Brown, Mamba has 3.35, and the Claude 3 approximation has 3.45. Those results occupy a similar range in the Ukrainian count, though the systems differ in architecture or in how the authors obtained the tokenizer. The Mamba comparison counts emitted tokens. Any difference in processing cost per token would need a different measurement.

There are clear improvements between several earlier and later tokenizer releases. Ukrainian Brown fertility moves from 2.29 with Llama 2 to 1.88 with Llama 3.1, and from 3.32 with GPT-3.5/4 to 1.98 with GPT-4o/4o-mini. Mistral Nemo has 2.04, compared with 2.48 for the shared earlier Mistral tokenizer. Phi 3.5 reaches 2.29 while replacing the weaker Phi 2 tokenizer with a smaller vocabulary. The broad association with newer, often larger vocabularies is visible across these results. The Phi comparison demonstrates that differences in what the vocabulary covers can outweigh its total size.

Laws and abstracts show a strong language-by-domain effect

The specialized data make corpus composition especially important. The Ukrainian laws sample contains 120,883 words and averages 7.55 characters per word. The English version has 162,156 words and averages 6.10 characters per word. Ukrainian Brown averages 5.67 characters per word, while English Brown averages 5.12. The laws samples therefore contain longer words on average in both languages, while the two language versions also differ in how many words they use. Fertility describes segmentation relative to each version’s word count. The token budget for an entire passage also depends on the length of the passage in words.

On English laws, Llama 3.1 uses 1.10 tokens per word, compared with 1.08 on English Brown. Its Ukrainian values are 2.00 on laws and 1.88 on Brown. Gemma/Gemma 2/Gemini records 1.12 on English laws and 2.28 on Ukrainian laws. GPT-4o/4o-mini is at 1.10 for English laws and 2.29 for Ukrainian laws. These results show a relatively small change from general English and a larger absolute segmentation burden in Ukrainian. The specialized comparison also distinguishes systems that had relatively close results on Ukrainian Brown.

Selected tokenizers on Ukrainian laws by tokens per word

The Ukrainian specialist remains the most compact, and the multilingual entries span a wide range.

Selected tokenizers on Ukrainian laws by tokens per wordUkrainian GPT-2 (this paper): 1.17Ukrainian GPT-2 (this paper)1.17Llama 3.1: 2.00Llama 3.12.00Gemma/Gemma 2/Gemini: 2.28Gemma/Gemma 2/Gemini2.28GPT-4o/4o-mini: 2.29GPT-4o/4o-mini2.29Mistral Nemo: 2.45Mistral Nemo2.45Qwen 1.5/2 VL: 3.64Qwen 1.5/2 VL3.64GPT-3.5/4: 4.40GPT-3.5/44.40Claude 3 approximation: 4.46Claude 3 approximation4.46Standard GPT-2: 8.75Standard GPT-28.75
The numbers
System or settingtokens per word
Ukrainian GPT-2 (this paper)1.17
Llama 3.12.00
Gemma/Gemma 2/Gemini2.28
GPT-4o/4o-mini2.29
Mistral Nemo2.45
Qwen 1.5/2 VL3.64
GPT-3.5/44.40
Claude 3 approximation4.46
Standard GPT-28.75

For scientific abstracts, Ukrainian GPT-2 records 1.45 on Ukrainian and 2.17 on English. Llama 3.1 and Gemma/Gemma 2/Gemini both record 2.23 on Ukrainian abstracts. On their English counterparts, Llama 3.1 has 1.15 and the Gemma group has 1.12. GPT-4o/4o-mini has 2.35 on Ukrainian abstracts and 1.14 on English. The convergence of the Llama and Gemma Ukrainian results in this domain is informative because Llama leads on Ukrainian laws and on Ukrainian Brown. The tokenizer ranking has some continuity, with room for ties and reversals depending on the text.

The weaker Ukrainian tokenizers show larger domain effects. Qwen 1.5/2 VL records 3.64 on Ukrainian laws and 3.40 on Ukrainian abstracts. GPT-3.5/4 reaches 4.40 on Ukrainian laws and 4.02 on Ukrainian abstracts. The Claude 3 approximation reaches 4.46 on Ukrainian laws and 4.17 on Ukrainian abstracts. Standard GPT-2 has 8.75 on the laws and 7.99 on the abstracts, both above its Ukrainian Brown fertility. The Ukrainian specialist moves in the other direction on laws, from 1.30 on Ukrainian Brown to 1.17. A narrow domain can thus be especially economical when its repeated sequences are well served by a particular vocabulary.

Documentation changes what the tokenizer has to cover

The English code documentation produces higher fertility than English Brown for the main multilingual comparisons. Llama 3.1 moves from 1.08 on Brown to 1.25 on documentation. Gemma/Gemma 2/Gemini moves from 1.07 to 1.35. GPT-4o/4o-mini moves from 1.07 to 1.25. The authors associate this increase with the formatting and source code included in the material. Because fertility counts all emitted tokens against words, indentation, line breaks, operators, and identifiers can contribute to the numerator alongside the surrounding prose.

In Ukrainian documentation, Llama 3.1 records 1.69 tokens per word and GPT-4o/4o-mini records 1.74. Both are below their respective values on Ukrainian Brown. Ukrainian GPT-2 has 1.79 on the documentation, above its scores on Ukrainian Brown, laws, and abstracts. Gemma/Gemma 2/Gemini records 1.80 and Mistral Nemo 1.81. The range at the top is close, and the Ukrainian specialist remains competitive. The leading result in this domain nonetheless goes to a multilingual tokenizer.

The authors connect this ordering to the presence of code in training and the vocabulary space available for familiar code strings. Code inclusions can use English-like identifiers and special sequences with little dependence on the language of the accompanying explanation. They can therefore change how much a Ukrainian-focused vocabulary helps on the document as a whole. The experiment measures that whole document mixture. Its domain label describes the kind of material sampled and carries no separate estimate for prose, inline identifiers, or complete code blocks.

Local corrections barely change the aggregate counts

In the error experiment, the original and corrected collections each have 74,200 words. Llama 3.1 emits 133,584 tokens on the original versions and 133,485 on the corrected versions. The reported fertility values are 1.800 and 1.799, respectively. Ukrainian GPT-2 records 1.295 on the original versions and 1.293 after correction. GPT-4o/4o-mini records 1.874 and 1.873. These changes are small relative to the differences among tokenizers on either version of the corpus.

The direction varies. Qwen 1.5/2 VL goes from 2.601 on the original versions to 2.603 on the corrected versions. GPT-3.5/4 goes from 3.034 to 3.037. Standard GPT-2 also uses slightly more tokens on the corrected texts, with fertility of 5.796 for the originals and 5.799 for the corrections. A correction can replace a string the tokenizer encodes compactly with a form its vocabulary divides more finely. The useful result across the table is the small size of the aggregate change.

The authors quantify how far apart the versions are by reporting Levenshtein distance, the number of character edits needed to transform one string into another. In 90% of versions, the distance is fewer than 27 characters, and the reported median is 9. The minimum is 1 and the maximum is 107. The distribution places the fertility result in context. Much of the retained material differs by relatively localized edits, so most of the text contributing to either corpus total is shared between the versions.

Transliteration helps when the original script is poorly covered

For standard GPT-2, native-script Ukrainian Brown has a fertility of 6.31, while the Latin rendering has 2.74. GPT-3.5/4 goes from 3.32 on the original to 2.49 on the Latin version. The Qwen group improves from 2.83 to 2.50. The Claude 3 approximation moves from 3.45 to 2.63. In these settings, the Latin spelling gives the tokenizer combinations it can encode in a shorter sequence than the original Cyrillic. The English Brown scores remain lower for these tokenizers, so the benefit is specific to the comparison between the two representations of Ukrainian.

Original and transliterated Ukrainian Brown by tokens per word

The script change helps the heavily fragmenting tokenizers shown, while the stronger native-script entries use more tokens after transliteration.

Original and transliterated Ukrainian Brown by tokens per wordStandard GPT-2, Cyrillic: 6.31Standard GPT-2, Cyrillic6.31Standard GPT-2, Latin: 2.74Standard GPT-2, Latin2.74GPT-3.5/4, Cyrillic: 3.32GPT-3.5/4, Cyrillic3.32GPT-3.5/4, Latin: 2.49GPT-3.5/4, Latin2.49Llama 3.1, Cyrillic: 1.88Llama 3.1, Cyrillic1.88Llama 3.1, Latin: 2.40Llama 3.1, Latin2.40Ukrainian GPT-2, Cyrillic (this paper): 1.30Ukrainian GPT-2, Cyrillic (this paper)1.30Ukrainian GPT-2, Latin: 3.16Ukrainian GPT-2, Latin3.16
The numbers
System or settingtokens per word
Standard GPT-2, Cyrillic6.31
Standard GPT-2, Latin2.74
GPT-3.5/4, Cyrillic3.32
GPT-3.5/4, Latin2.49
Llama 3.1, Cyrillic1.88
Llama 3.1, Latin2.40
Ukrainian GPT-2, Cyrillic (this paper)1.30
Ukrainian GPT-2, Latin3.16

GPT-4o/4o-mini records 1.98 on Cyrillic and 2.26 on Latin, and Gemma/Gemma 2/Gemini records 1.92 and 2.28. Mistral Nemo also favors the original writing, at 2.04 on Cyrillic and 2.36 after transliteration. Ukrainian GPT-2 gives the strongest native-script score and the weakest transliterated score in the table. The result depends on the fit between a vocabulary and the actual strings the script conversion produces. A tokenizer trained on a great deal of Latin-script text can still process native Ukrainian more economically if it has sufficiently good coverage of the original Cyrillic patterns.

Inflected forms generally use more tokens in the case sample

Ukrainian GPT-2 reports 3.46 tokens per word for nominative forms, 3.85 for dative forms, and 3.86 for locative forms. Its reported mean difference from nominative is 0.266, the lowest in the comparison. Mistral Nemo is the most stable multilingual tokenizer by that measure, at 0.299. Its nominative fertility is 4.39, and its dative fertility is 4.95. Llama 2 and Llama 3.1 each have a reported mean difference of 0.304, though Llama 3.1 has the lower nominative fertility at 4.46 compared with 4.68 for Llama 2. These are measurements within the grammatical case sample.

A low starting fertility and stability across cases describe different properties. Gemma/Gemma 2/Gemini has a nominative fertility of 4.01, with 4.64 in the dative and 4.55 in the locative. Its reported mean difference from nominative is 0.339. It starts with a more compact nominative representation than Mistral Nemo, while Mistral Nemo has the smaller reported average change across forms. The study also reports individual exceptions to a general rise. Mamba has 6.53 in the nominative and 6.51 in the instrumental, while the Claude 3 approximation has 6.64 and 6.54 in those cases. Case affects segmentation, with the size and direction of a particular change depending on the tokenizer and the form.

What the ablations show

The paper reports no training ablations. Its controlled comparisons change the text supplied to a fixed tokenizer, and its cross-tokenizer analyses relate measured coverage to performance on the same corpus. These two forms of evidence have different strengths. Running a tokenizer on the original and modified versions of an input gives a direct comparison of those versions. Comparing releases can identify a useful improvement, while leaving the contribution of each design or training choice open.

Vocabulary inventory and alphabet coverage are incomplete predictors

Llama 3.1 reaches lower fertility than Llama 2 on Ukrainian Brown in spite of having fewer entries classified as Cyrillic and a shorter average entry in that group. Gemma/Gemma 2/Gemini has the longest Cyrillic entries on average and a substantially larger Cyrillic group, while Llama 3.1 uses fewer tokens per word on Ukrainian Brown and laws. The observations are consistent with the idea that entries frequent in Ukrainian matter more than script compatibility alone. The authors consider differences in the mix of Ukrainian and other Cyrillic languages in training as a possible explanation. They lack the training details required to verify that explanation.

The alphabet and Brown experiments provide a complementary comparison. Qwen’s ability to encode every tested character without a byte split gives it good coverage of the elementary symbols. Its Ukrainian Brown fertility still places it behind multilingual tokenizers with incomplete coverage in the isolated alphabet test. The discrepancy shows why the ability to encode an isolated character compactly is an insufficient predictor of how a system segments ordinary words. Some gaps concern individual letters, while others concern the combinations of letters that would let the tokenizer reuse a larger piece.

Changing the script tests an interaction with the vocabulary

Transliteration compares two representations of the same Ukrainian Brown material with the tokenizer held fixed. This removes a source of ambiguity present when comparing separate Ukrainian and English corpora, where the content and the lexical choices can change together with the language. The original and transliterated comparison shows directly whether a tokenizer gets a shorter sequence when this corpus is written according to the chosen Latin convention.

The improvement for standard GPT-2 and the deterioration for Ukrainian GPT-2 point in opposite directions under the same conversion. Llama 3.1 and GPT-4o/4o-mini also favor the original script. This pattern makes the potential benefit conditional on the tokenizer’s existing coverage. A useful Latin spelling for one vocabulary can be a sequence of unfamiliar fragments for another. The trial measures the resulting encoding lengths directly. It does not isolate how much of the change comes from avoiding byte splits versus gaining or losing longer, reusable letter combinations.

Text correction and grammatical case probe different sources of variation

The correction experiment holds the word count steady within pairs. This design makes a change in total tokens interpretable as a change in segmentation under a fixed word denominator. The small movements in both directions show that, at corpus scale, the retained edits have little effect on processing length. Because the metric pools tokens across versions, larger effects on particular words can be diluted by unchanged material or offset by edits with the opposite effect. The reported results characterize the collection as a whole.

The case experiment focuses more specifically on altered word forms and measures each case separately. Fertility generally rises outside the nominative in that sample, and the extent of the rise differs between tokenizers. This result can coexist with the small correction effect. Correcting a document frequently changes only a small part of the input, whereas the grammatical case comparison deliberately replaces the word forms whose segmentation it measures. The case experiment addresses sensitivity to variation in the tested forms. The correction experiment addresses the aggregate burden of edits drawn from a particular corpus.

Genre comparisons expose a useful trade-off without isolating its cause

Comparing Brown, laws, abstracts, and software documentation reveals whether a result on broad prose transfers to a particular application. The Ukrainian specialist’s lead on laws and its loss of the lead on documentation show that its advantage depends on the input mix. The larger multilingual vocabularies can serve code and natural language together, while the specialist is particularly economical for Ukrainian prose. That interpretation fits the observed corpora. The comparison changes vocabulary demands, average word length, formatting, and code content together, so it cannot assign the outcome to any one of them.

Taken jointly, the comparisons support the benchmark’s decision to measure fertility on actual target material. Vocabulary inspection can flag a potential coverage problem, and an alphabet check can locate fallback for particular symbols. The corpus count then determines how frequently the tokenizer’s segmentation behavior matters on the texts of interest. This also explains why the authors treat a high-level inventory statistic as a diagnostic and a count on the target corpus as the relevant direct result.

Limitations

Limits the authors state

The authors limit their method to the efficiency of segmentation. It can measure the positions a passage occupies in a token sequence. It does not test whether a system understands a Ukrainian question, answers it accurately, follows case agreement, or writes in an appropriate legal or scientific style. A tokenizer may represent a set of legal provisions compactly even if the system using it performs poorly on a legal task. The authors position fertility as one component of an evaluation for a language or domain and as a possible way to assess vocabulary coverage before training.

Access is a second stated limitation. A proprietary tokenizer may be unavailable for direct inspection, as in the Claude 3 comparison. The authors use an approximation and identify the possibility of remeasuring with the official tokenizer if it becomes available. They also describe an API-based alternative in which a service reports the number of input tokens for a supplied test string. That procedure can add testing costs and require changes to the evaluation pipeline for a particular service. It also provides a different level of access from having a vocabulary and tokenizer implementation available for the alphabet and inventory checks.

The correction experiment has narrower coverage than the range of errors found in everyday writing. The authors exclude word fusions from the study and discuss extending the work to stylistic or structural errors. The equal-word-count filter makes the comparison more focused, and the low edit distances show that the retained versions are frequently similar. The authors therefore propose expanding the samples and error types before making broader claims about how mistakes affect tokenization. The existing finding concerns the mistakes and corrections that survive the filter.

For transliteration, the authors distinguish savings on input from generating an answer in Latin-script Ukrainian and converting it back. They caution that generated text may fail to follow the conversion rules consistently and discuss fine-tuning or training on transliterated text as future work. The Latin rendering is evaluated through fertility. Its ability to preserve the information needed for a particular downstream task or to support reliable restoration of the original text is outside the results of the benchmark.

Limits that follow from the setup

The English and Ukrainian Brown corpora provide genre-spanning baselines. They are separate collections, so their fertility comparison can reflect differences in their contents as well as the languages and tokenizers. The specialized datasets supply English and Ukrainian versions in the same domains, but even corresponding material can be expressed using different numbers of words. The laws counts illustrate this directly. Fertility answers how many tokens a tokenizer uses per counted word in each corpus. A comparison of total tokens for corresponding material would answer how much context the complete versions consume. The two measures should retain their separate units.

Aggregation further limits what a fertility score can show. For a given dataset, a small change in the overall ratio can coexist with large changes on individual items. Conversely, a high average could stem from pervasive fragmentation or from particularly difficult chunks that account for a large share of emitted tokens. The paper reports total counts and, in some tests, averages per text. Its measurements leave open how the burden is distributed among rare names, forms, code blocks, or individual prompts. This matters especially for the correction experiment, where aggregate counts summarize pairs whose local edits differ in kind and size.

The case experiment demonstrates variation associated with grammatical forms in the collected word sample. The reported setup does not characterize that sample in enough detail to estimate how frequently each result would arise in continuous writing. Grammatical cases occur in particular constructions and with different frequencies, and surrounding text can affect the token sequence. The mean difference from nominative therefore describes the benchmark’s case comparison. It should not be applied directly to predict an increase for prose that contains a mixture of cases.

Similarly, the inventory rule for Cyrillic does not identify the language to which a piece belongs or test whether its boundaries correspond to a stem or affix. Character length can indicate a vocabulary’s capacity to store longer strings, but semantic usefulness depends on where those strings occur and how the tokenizer employs them. The authors’ explanations involving Ukrainian and Russian vocabulary coverage are hypotheses about the measured pattern. The benchmark does not trace training examples or establish which language supplied particular pieces to a vocabulary.

Comparisons across tokenizer generations also change several factors together. Vocabulary size, entry allocation, and the data or procedures used to construct the tokenizer can all differ. The Phi comparison shows that improvement can occur with a smaller vocabulary, while Ukrainian GPT-2 shows that a focused vocabulary can beat much larger multilingual ones on some domains. The results support a role for size and allocation. They do not establish that vocabulary expansion is the only route to more consistent multilingual performance, or give an estimate of what expansion would achieve with all other choices held constant.

The tabulated results sometimes warrant more weight than a broad description in the discussion. The paper gives 2.83 for Qwen on Ukrainian Brown in the general-corpus and transliteration tables, while the running discussion gives 2.89. The comparison here uses the tabulated value. The transliteration table also shows improvements for standard GPT-2 and Phi 2, so the benefit shown by the individual rows extends beyond the large-vocabulary systems emphasized in one passage. The strongest supported script conclusions come from the paired corpus results for each tokenizer.

Finally, a difference in fertility is an indication of token demand, with the most direct implication for context occupancy. Speed, compute, and API fees depend on additional factors. An architecture can have a different cost for processing each token, and a vendor can charge different rates for input and output. The study neither times generation nor prices a common set of requests. Even under token-based billing, the length and quality of the answer the system actually generates remain empirical questions. The benchmark supplies a concrete property to measure before those larger evaluations.

What came after

Two later works cite the Ukrainian benchmark and point in different directions. One concerns the treatment of Northeast Indian languages in generated text. Its title identifies omission and orthographic corruption, which concerns damage to the written form of a language, as the phenomena under study. That places the work at the output level. The Ukrainian benchmark examined how writing is divided before it enters the system or as it is represented for generation. A connection between the two is the treatment of written forms in multilingual systems. The citation alone does not establish that the later work used the Ukrainian benchmark’s fertility protocol or attributed its cases of corruption to tokenization. Stereotyped by Silence

The other citing work makes multilingual tokenizer design its subject. Where Maksymenko and Turuta compare the behavior of existing vocabularies across languages, domains, and input variants, this work frames the construction of multilingual tokenizers as the problem. The Ukrainian comparisons help make the design problem concrete. Total vocabulary size, coverage of individual symbols, and compact encoding of actual passages can point to different rankings. The citation connects that evaluation problem to work on design, while leaving the later paper’s specific design choices and use of the benchmark unspecified. MUTANT: A Recipe for Multilingual Tokenizer Design

These directions bracket the scope of the Ukrainian study. Tokenizer design concerns which pieces a multilingual system has available. Analysis of omissions and orthographic corruption concerns what readers ultimately receive. Fertility measures an intermediate property with a clear unit and a narrow interpretation. It can show when representing Ukrainian text consumes more of the sequence and which input changes affect that burden. Establishing what causes errors in generated text, or what a training or design intervention would improve, requires evidence at those respective stages.

Cite

Cite as Daniil Maksymenko and Oleksii Turuta. 2025. Tokenization efficiency of current foundational large language models for the Ukrainian language. Frontiers in Artificial Intelligence.

The paper itself, not this page. BibTeX from the library's record of the work. DOI 10.3389/frai.2025.1538165

@inproceedings{maksymenko2025tokenization,
  title = {{Tokenization efficiency of current foundational large language models for the Ukrainian language}},
  author = {Daniil Maksymenko and Oleksii Turuta},
  booktitle = {Frontiers in Artificial Intelligence},
  year = {2025},
  doi = {10.3389/frai.2025.1538165},
  url = {https://doi.org/10.3389/frai.2025.1538165}
}

↑ back to top

This page in Markdown https://md.research.elamur.ai/free/en/papers/maksymenko-2025-tokenization-efficiency-current-foundational-large/