➗ Type–token ratio
Type–token ratio (TTR) is a measure of lexical diversity: the number of distinct word forms (types) in a text divided by the total number of running words (tokens). Higher values mean less repetition. Because the ratio falls as texts grow longer, length-corrected variants are widely used.
What it is
Take any text and count its words in two ways. Counting every occurrence gives the tokens. Counting each different word only once gives the types. The type–token ratio compares the two. A text that keeps reusing the same few words scores low. A text that rarely repeats itself scores high.
TTR = V / N
Here V is the number of types (the size of the text's vocabulary) and N is the number of tokens (the text's length in words). For any non-empty text, 0 < TTR ≤ 1, and the ratio reaches 1 only when no word repeats.
A worked example: in the sentence "the cat sat on the mat", N = 6 tokens. Only "the" repeats, so V = 5 types, and TTR = 5 / 6 ≈ 0.83. Make it "the cat sat on the mat and the dog sat on the cat". Now N = 13 and V = 7 (the, cat, sat, on, mat, and, dog), so TTR ≈ 0.54. The second sentence is not poorer in any real sense. It is just longer, and the repetitions accumulate.
What counts as a type depends on preprocessing choices. These include tokenization, lowercasing, and whether one counts each inflected word form or reduces forms to a lemma. Spelling matters too. A learner who misspells because in three different ways adds three spurious types, and this inflates TTR (Nagata et al. 2018).
The key idea
Why the ratio falls with length
Word frequencies follow Zipf's law. A few words are extremely common, and a long tail of words is rare. As a text grows, new tokens are more and more often repeats of words already seen, so V grows more slowly than N. The empirical form of this growth is Heaps' law (Herdan 1960; Heaps 1978):
V ≈ K · N^β, 0 < β < 1
K is a corpus-dependent constant and β is the growth exponent. Since β is below 1, V / N ≈ K · N^(β−1) shrinks steadily as N grows. The vocabulary keeps expanding even at very large scale. For example, one English Wikipedia dump of 60M sentences holds roughly 20M distinct types after lowercasing and tokenization (Ling et al. 2015). The same skew means that rare types are seen very few times, a problem that also shapes vocabulary design in neural translation (Gowda & May 2020).
Many of these rare types are hapax legomena, words that occur exactly once in a text. They are numerous in most samples, so they weigh heavily in what TTR registers. They are also where spelling noise tends to sit, because common words are seldom misspelt (Nagata et al. 2018).
Remedies for length dependence
Raw TTR can only compare texts of equal length. Several corrections exist.
| Measure | Idea | Classic source |
|---|---|---|
| Standardised TTR (STTR) | average TTR over consecutive fixed-size segments | long implemented in corpus software |
| Moving-average type–token ratio (MATTR) | average TTR over a window moved one word at a time | Covington & McFall (2010) |
| Guiraud's index | R = V / √N | Guiraud (1954) |
| Herdan's C | C = log V / log N | Herdan (1960) |
| Measure of textual lexical diversity (MTLD) | mean length of stretches over which TTR stays above a threshold | McCarthy & Jarvis (2010) |
| HD-D (hypergeometric distribution D) | expected types in a random fixed-size sample, from the hypergeometric distribution | McCarthy & Jarvis (2007, 2010), after Malvern & Richards' vocd-D (1997) |
R = V / √N
C = log V / log N
In both formulas V and N are types and tokens as before. Guiraud's R divides by the square root of the length, and Herdan's C compares growth on a logarithmic scale. Both assume a particular growth curve, and neither is fully length-invariant. Window-based methods such as MATTR avoid the assumption by holding the window size fixed. MTLD and HD-D build the correction into their design. Yule's K (Yule 1944) is a related index. It is based on squared frequencies, so it depends mainly on common words rather than on the tail.
Try it: Zipf’s law in this library, language by language
Every text of this library counted word by word: the words ranked by how often they occur, rank against frequency on log–log axes. A straight line of slope −s is Zipf’s law, f(r) ∝ 1 / rs. Pick a language to redraw the curve, compare it with another one behind it, and read its ten most frequent words. The dashed line is the fit on ranks 10–10,000.
In the English texts, the most frequent word occurs 9,372,513 times; the exponent fitted on ranks 10–10,000 is 1.22, close to Zipf’s 1.
| language | texts | words | different words | exponent s | the five most frequent |
|---|---|---|---|---|---|
| English | 23,318 | 194,618,171 | 847,377 | 1.22 | the, and, of, a, in |
| French | 143 | 1,047,118 | 43,078 | 1.15 | de, la, et, les, l |
| Spanish | 14 | 89,874 | 11,725 | 1.08 | de, en, la, y, el |
Counts from the paper texts of this library (2026-10-24), words as runs of letters, lower-cased; a text’s language told by its most frequent function words. Ranks shown on a logarithmic grid.
History and founding papers
Counting types against tokens is older than computing. Johnson (1944) and Templin (1957) used TTR to describe children's speech. It became a standard tool of early psycholinguistics and language-acquisition research, and it was also used to compare adult language with child-directed speech.
Yule (1944) proposed his characteristic K for stylometry and authorship questions. Guiraud (1954) and Herdan (1960) then gave the first algebraic length corrections, and the Herdan–Heaps growth law placed the length problem on a formal basis.
From the 1990s onward, work on learner language turned this into a research programme. Malvern and Richards (1997) proposed vocd-D. McCarthy and Jarvis introduced HD-D (2007) and later validated MTLD and HD-D against earlier indices (2010). In natural language generation, Li et al. (2016) popularised distinct-n, a TTR computed over n-grams, as a diversity score for system output.
How it is used today
Learner language and proficiency
Lexical diversity indices are a standard feature family in automatic proficiency assessment (see grammatical error correction). One study predicted Common European Framework of Reference (CEFR) levels of English essays written by French learners. It combined TTR variants such as MATTR, along with MTLD, HD-D and Yule's K, with syntactic and readability measures. All essays on one prompt topic were kept on the same side of the train/test split. Gradient-boosted trees on these metrics reached an area under the ROC curve (AUC) of 0.916 for separating A1 from A2 essays. Raw token and type counts ranked among the most important features (Arnold et al. 2018).
Such metrics mostly reflect vocabulary size, not depth of word knowledge. This gap has motivated embedding-based comparisons of learner and native usage (Aoyama 2022). Vocabulary-size testing also continues by other means, such as automatically generated lexical recognition tests for Arabic (Hamed et al. 2022).
Noise is a practical concern. One study used essays by Japanese learners at three school levels and compared the original text with a hand-corrected version. Correcting spelling changed TTR by at least 16% in every group, while Yule's K changed by no more than 1% (Nagata et al. 2018).
CorSpell, a tool for Brazilian Portuguese learner and exam texts, normalises spelling partly because variant forms skew diversity counts (Schoffen et al. 2026). For informal written Luxembourgish, by contrast, spelling variation has been treated as linguistic information to be studied rather than removed. The authors of that work see their method as less suited to highly standardised languages (Lutgen et al. 2026).
Style, genre and diachrony
MATTR and MTLD serve as style descriptors in corpus studies. In German pop lyrics since 1970, lexical diversity declines, while first- and second-person pronouns rise slightly (Schneider 2026).
Low lexical variation can also expose weak benchmarks. In the ECB corpus for event coreference resolution, mentions within chains varied so little that a lemma-matching baseline came close to published systems. To remedy this, the authors built ECB+. It adds 502 news texts, each describing a second event of a type already covered, so that systems must tell such events apart (Cybulska & Vossen 2014).
Morphology and language modelling
Corpus TTR is a rough proxy for richness in morphology. Languages with heavy inflection produce many distinct forms, and therefore high ratios.
In language modelling across 50 languages, gains from character-aware output embeddings tracked corpus TTR more closely than corpus size. In a controlled German experiment, raising TTR from 0.13 to 0.18 enlarged the benefit. Perplexity fell only from 225 to 217 at the lower ratio, but from 681 to 598 at the higher one (Gerz et al. 2018).
In subword tokenization research, the ratio of vocabulary size to data size has been named a confound in cross-language comparisons. New token-bigram measures were proposed instead. They are computed over fixed-size windows, analogous to MATTR (Poelman et al. 2025).
Diversity of model output and training data
For large language models, TTR-style metrics characterise both generations and datasets. One study described Arabic, Chinese and Japanese fine-tuning sets with Distinct-1/2, Self-BLEU, TTR, MATTR, MTLD and HD-D, plus semantic measures, on 1,000 sampled examples per dataset. It related the principal components of these features to cultural-awareness benchmarks, but no single component predicted performance everywhere (Masoud et al. 2026).
Open questions
- Unit of counting. When text is cut into subwords rather than words, "type" changes meaning. Tokens-per-word ratios fall steeply as the vocabulary of a byte-pair encoding (BPE) tokenizer grows (Nguyen & Arehalli 2026). It follows, as an inference rather than a tested result, that diversity scores computed on model tokens are unlikely to be comparable across tokenizers.
- Length invariance. Every correction assumes some growth model or window size, so comparing texts of very different lengths remains delicate. One example is Japanese learners' essays in the EFCAMDAT corpus, averaging about 75 words, set against native argumentative essays in LOCNESS, averaging about 850 (Aoyama 2022).
- Noise and variation. Robust indices such as Yule's K resist misspellings (Nagata et al. 2018). Whether variant spellings should be merged, or counted as real diversity, depends on the language and the research question (Lutgen et al. 2026).
- Validity. A high TTR signals variety, not appropriateness or depth of word knowledge (Aoyama 2022). For generated text, surface diversity alone says nothing about quality or coherence. Choosing among the many indices, and interpreting them across languages with different morphology (Poelman et al. 2025), is still unsettled.
Key papers
Related concepts
- Zipf's law — Zipf's law is the empirical regularity that, when the items of a collection such as the words of a text are ranked by frequency, each…
- Lemma — A lemma is the citation form of a word: the single form, such as a dictionary headword, chosen to stand for every inflected form of one…
- Word form — A word form is one concrete written or spoken shape of a word as it appears in text, such as walks or walked. Each form realises a lexeme…
- Corpus linguistics — Corpus linguistics is the empirical study of language through large, principled collections of naturally occurring text or transcribed…
More papers
Topics: ⏳ Historical linguistics & language change · 🧒 Psycholinguistics & language acquisition
Shelves: 🗣️ Language and Linguistics
Updated
This page in Markdown → https://md.research.elamur.ai/free/en/concepts/type-token-ratio/