Georgian - Wikilangs Models
Comprehensive Research Report & Full Ablation Study
This repository contains NLP models trained and evaluated by Wikilangs, specifically on Georgian Wikipedia data. We analyze tokenizers, n-gram models, Markov chains, vocabulary statistics, and word embeddings.
📋 Repository Contents
Models & Assets
- Tokenizers (8k, 16k, 32k, 64k)
- N-gram models (2, 3, 4, 5-gram)
- Markov chains (context of 1, 2, 3, 4 and 5)
- Subword N-gram and Markov chains
- Embeddings in various sizes and dimensions (aligned and unaligned)
- Language Vocabulary
- Language Statistics
Analysis and Evaluation
- 1. Tokenizer Evaluation
- 2. N-gram Model Evaluation
- 3. Markov Chain Evaluation
- 4. Vocabulary Analysis
- 5. Word Embeddings Evaluation
- 6. Morphological Analysis (Experimental)
- 7. Summary & Recommendations
- Metrics Glossary
- Visualizations Index
1. Tokenizer Evaluation
Results
| Vocab Size | Compression | Avg Token Len | UNK Rate | Total Tokens |
|---|---|---|---|---|
| 8k | 3.607x | 3.61 | 0.0743% | 1,129,507 |
| 16k | 4.126x | 4.13 | 0.0850% | 987,428 |
| 32k | 4.611x | 4.61 | 0.0950% | 883,432 |
| 64k | 5.034x 🏆 | 5.04 | 0.1037% | 809,192 |
Tokenization Examples
Below are sample sentences tokenized with each vocabulary size:
Sample 1: ბა () — მეორე ასო არაბულ დამწერლობაში. ბა არის არაბული ვარიანტი ებრაული ბეთისა. ...
| Vocab | Tokens | Count |
|---|---|---|
| 8k | ▁ბა ▁() ▁— ▁მეორე ▁ასო ▁არაბ ულ ▁დამწერ ლობაში . ... (+19 more) |
29 |
| 16k | ▁ბა ▁() ▁— ▁მეორე ▁ასო ▁არაბულ ▁დამწერ ლობაში . ▁ბა ... (+16 more) |
26 |
| 32k | ▁ბა ▁() ▁— ▁მეორე ▁ასო ▁არაბულ ▁დამწერ ლობაში . ▁ბა ... (+13 more) |
23 |
| 64k | ▁ბა ▁() ▁— ▁მეორე ▁ასო ▁არაბულ ▁დამწერლობაში . ▁ბა ▁არის ... (+12 more) |
22 |
Sample 2: ხათინბულაყი () — სოფელი აზერბაიჯანში, ფუზულის რაიონში. რესურსები ინტერნეტში რაიო...
| Vocab | Tokens | Count |
|---|---|---|
| 8k | ▁ხ ათინ ბ ულა ყ ი ▁() ▁— ▁სოფელი ▁აზერბაიჯანში ... (+10 more) |
20 |
| 16k | ▁ხ ათინ ბ ულა ყი ▁() ▁— ▁სოფელი ▁აზერბაიჯანში , ... (+9 more) |
19 |
| 32k | ▁ხ ათინ ბულა ყი ▁() ▁— ▁სოფელი ▁აზერბაიჯანში , ▁ფუზულის ... (+6 more) |
16 |
| 64k | ▁ხ ათინ ბულაყი ▁() ▁— ▁სოფელი ▁აზერბაიჯანში , ▁ფუზულის ▁რაიონში ... (+5 more) |
15 |
Sample 3: მერდინლი () — სოფელი აზერბაიჯანში, ფუზულის რაიონში. რესურსები ინტერნეტში რაიონის...
| Vocab | Tokens | Count |
|---|---|---|
| 8k | ▁მერ დინ ლი ▁() ▁— ▁სოფელი ▁აზერბაიჯანში , ▁ფ უზ ... (+7 more) |
17 |
| 16k | ▁მერ დინ ლი ▁() ▁— ▁სოფელი ▁აზერბაიჯანში , ▁ფ უზ ... (+7 more) |
17 |
| 32k | ▁მერ დინ ლი ▁() ▁— ▁სოფელი ▁აზერბაიჯანში , ▁ფუზულის ▁რაიონში ... (+5 more) |
15 |
| 64k | ▁მერ დინ ლი ▁() ▁— ▁სოფელი ▁აზერბაიჯანში , ▁ფუზულის ▁რაიონში ... (+5 more) |
15 |
Key Findings
- Best Compression: 64k achieves 5.034x compression
- Lowest UNK Rate: 8k with 0.0743% unknown tokens
- Trade-off: Larger vocabularies improve compression but increase model size
- Recommendation: 32k vocabulary provides optimal balance for production use
2. N-gram Model Evaluation
Results
| N-gram | Variant | Perplexity | Entropy | Unique N-grams | Top-100 Coverage | Top-1000 Coverage |
|---|---|---|---|---|---|---|
| 2-gram | Word | 211,247 | 17.69 | 839,931 | 5.0% | 14.8% |
| 2-gram | Subword | 423 🏆 | 8.73 | 18,881 | 58.4% | 96.6% |
| 3-gram | Word | 297,944 | 18.18 | 972,504 | 4.8% | 13.7% |
| 3-gram | Subword | 3,918 | 11.94 | 159,884 | 21.8% | 60.3% |
| 4-gram | Word | 509,839 | 18.96 | 1,548,052 | 4.2% | 12.7% |
| 4-gram | Subword | 22,811 | 14.48 | 936,455 | 10.0% | 32.5% |
| 5-gram | Word | 359,649 | 18.46 | 1,104,097 | 4.9% | 14.4% |
| 5-gram | Subword | 88,814 | 16.44 | 2,995,844 | 5.2% | 19.7% |
Top 5 N-grams by Size
2-grams (Word):
| Rank | N-gram | Count |
|---|---|---|
| 1 | რესურსები ინტერნეტში |
100,310 |
| 2 | იხილეთ აგრეთვე |
38,767 |
| 3 | ერთ ერთი |
38,192 |
| 4 | და სხვა |
20,983 |
| 5 | of the |
20,829 |
3-grams (Word):
| Rank | N-gram | Count |
|---|---|---|
| 1 | წლის მონაცემებით მოსახლეობა |
9,844 |
| 2 | რესურსები ინტერნეტში სქოლიო |
8,451 |
| 3 | მიუხედავად იმისა რომ |
8,239 |
| 4 | ოფიციალური საიტი სქოლიო |
7,888 |
| 5 | მდებარეობს ზღვის დონიდან |
7,694 |
4-grams (Word):
| Rank | N-gram | Count |
|---|---|---|
| 1 | კაცი წ იხილეთ აგრეთვე |
6,676 |
| 2 | მუნიციპალიტეტის ოფიციალური საიტი სქოლიო |
5,942 |
| 3 | ოფიციალური საიტი სქოლიო მუნიციპალიტეტები |
5,878 |
| 4 | კმ ია იხილეთ აგრეთვე |
5,763 |
| 5 | ჭიანჭველასებრთა ერთ ერთი ნაირსახეობა |
5,614 |
5-grams (Word):
| Rank | N-gram | Count |
|---|---|---|
| 1 | მუნიციპალიტეტის ოფიციალური საიტი სქოლიო მუნიციპალიტეტები |
5,860 |
| 2 | კლასის ჭიანჭველასებრთა ერთ ერთი ნაირსახეობა |
5,614 |
| 3 | მწერთა კლასის ჭიანჭველასებრთა ერთ ერთი |
5,614 |
| 4 | ფეხსახსრიანთა ტიპის მწერთა კლასის ჭიანჭველასებრთა |
5,614 |
| 5 | ტიპის მწერთა კლასის ჭიანჭველასებრთა ერთ |
5,614 |
2-grams (Subword):
| Rank | N-gram | Count |
|---|---|---|
| 1 | ს _ |
7,040,665 |
| 2 | ი ს |
7,006,427 |
| 3 | ი _ |
6,580,536 |
| 4 | ა _ |
4,984,758 |
| 5 | ე ბ |
4,979,269 |
3-grams (Subword):
| Rank | N-gram | Count |
|---|---|---|
| 1 | ი ს _ |
5,017,584 |
| 2 | ე ბ ი |
2,375,826 |
| 3 | _ დ ა |
2,051,321 |
| 4 | _ ს ა |
1,739,078 |
| 5 | დ ა _ |
1,650,928 |
4-grams (Subword):
| Rank | N-gram | Count |
|---|---|---|
| 1 | _ დ ა _ |
1,089,218 |
| 2 | ბ ი ს _ |
984,947 |
| 3 | ე ბ ი ს |
883,610 |
| 4 | ე ბ ი _ |
738,436 |
| 5 | ი ს _ მ |
733,039 |
5-grams (Subword):
| Rank | N-gram | Count |
|---|---|---|
| 1 | ე ბ ი ს _ |
734,333 |
| 2 | ა _ დ ა _ |
430,206 |
| 3 | , _ რ ო მ |
406,399 |
| 4 | ი ს _ ს ა |
350,334 |
| 5 | ე ბ უ ლ ი |
307,583 |
Key Findings
- Best Perplexity: 2-gram (subword) with 423
- Entropy Trend: Decreases with larger n-grams (more predictable)
- Coverage: Top-1000 patterns cover ~20% of corpus
- Recommendation: 4-gram or 5-gram for best predictive performance
3. Markov Chain Evaluation
Results
| Context | Variant | Avg Entropy | Perplexity | Branching Factor | Unique Contexts | Predictability |
|---|---|---|---|---|---|---|
| 1 | Word | 0.9133 | 1.883 | 9.96 | 1,644,802 | 8.7% |
| 1 | Subword | 1.0685 | 2.097 | 7.59 | 8,326 | 0.0% |
| 2 | Word | 0.2778 | 1.212 | 1.75 | 16,356,120 | 72.2% |
| 2 | Subword | 0.7948 | 1.735 | 5.53 | 63,087 | 20.5% |
| 3 | Word | 0.0801 | 1.057 | 1.15 | 28,502,543 | 92.0% |
| 3 | Subword | 0.7992 | 1.740 | 4.61 | 348,410 | 20.1% |
| 4 | Word | 0.0282 🏆 | 1.020 | 1.04 | 32,622,645 | 97.2% |
| 4 | Subword | 0.7081 | 1.634 | 3.48 | 1,604,353 | 29.2% |
Generated Text Samples (Word-based)
Below are text samples generated from each word-based Markov chain model:
Context Size 1:
და ფესტივალის roadburn festival at war chapter 8 6 7 489 ხელოვნებაში გაწაფული და დასავლური მარიულიწლის აპრილში ჟურნალ modern philology v საუკუნეებით ძეგლი ვატერტონ გლასიერის მშვიდობის განმტკიცებაში ...წელს ტაძრის კრამიტი ცემენტქვიშის ხსნარის სიმკვრივე 0 1 ნოემბერი დეკემბერი მუნიციპალიტეტში ჭალის მუხი...
Context Size 2:
რესურსები ინტერნეტში ოფიციალური საიტი სქოლიო მუნიციპალიტეტები ქალაქები და წელს ის მიიწვიეს პეტერბურგ...იხილეთ აგრეთვე მინას ჟერაისი ბრაზილიის შტატები რესურსები ინტერნეტში ოფიციალური საიტი ჰარპერი მუსიკოს...ერთ ერთი ინიციატორი სული და ამ დროიდან ციხესიმაგრემ შეწყვიტა მხოლოდ მაშინ ექვემდებარება თუ ოჯახს საკ...
Context Size 3:
წლის მონაცემებით მოსახლეობა 84 469 ადამიანს შეადგენდა ფართობი 358 კმ მოსახლეობა 61 418 ადამიანი წლის...მიუხედავად იმისა რომ მპა მედიკამენტურად ვერ იკურნება მედიკამენტები შეიძლება გამოვიყენოთ სიმპტომების ...რესურსები ინტერნეტში სქოლიო მომღერლები 25 აგვისტო records ის შემსრულებლები records ის შემსრულებლები ...
Context Size 4:
კაცი წ იხილეთ აგრეთვე სევილიის მუნიციპალიტეტები რესურსები ინტერნეტში ალანისის მუნიციპალიტეტის ოფიცია...მუნიციპალიტეტის ოფიციალური საიტი სქოლიო მუნიციპალიტეტები ქალაქები გვერდები გვარის შემცველი სიებით გვ...კმ ია იხილეთ აგრეთვე კოლუმბიის ქალაქების სია რესურსები ინტერნეტში ქალაქის მთავრობის საიტი ქალაქის სა...
Generated Text Samples (Subword-based)
Below are text samples generated from each subword-based Markov chain model:
Context Size 1:
_მეენა;_წლოგას_კა_მოს_მდისაღობულისა_ც_ბოჰას_სტჩი
Context Size 2:
ს_ნიერალიერგიერისის_ოქმნინის_მკვე_ი_ერთემელი,_nalos
Context Size 3:
ის_ჯვრია_დაში,_რომების_წარმოდის_კრებ_დაიქცა._კიდერილთა
Context Size 4:
_და_ამ_პროვი._თამაშბის_საჭირო._წელს._ხებისამე_სირიის_წყალ
Key Findings
- Best Predictability: Context-4 (word) with 97.2% predictability
- Branching Factor: Decreases with context size (more deterministic)
- Memory Trade-off: Larger contexts require more storage (1,604,353 contexts)
- Recommendation: Context-3 or Context-4 for text generation
4. Vocabulary Analysis
Statistics
| Metric | Value |
|---|---|
| Vocabulary Size | 715,127 |
| Total Tokens | 37,347,310 |
| Mean Frequency | 52.22 |
| Median Frequency | 4 |
| Frequency Std Dev | 1624.79 |
Most Common Words
| Rank | Word | Frequency |
|---|---|---|
| 1 | და | 1,097,500 |
| 2 | წლის | 288,743 |
| 3 | წელს | 254,559 |
| 4 | იყო | 188,838 |
| 5 | ის | 162,453 |
| 6 | რომელიც | 141,611 |
| 7 | the | 128,418 |
| 8 | რომ | 124,976 |
| 9 | 1 | 122,280 |
| 10 | მისი | 118,080 |
Least Common Words (from vocabulary)
| Rank | Word | Frequency |
|---|---|---|
| 1 | pbsuccess | 2 |
| 2 | მანგუსი | 2 |
| 3 | ბარნჰამი | 2 |
| 4 | რაჩაკის | 2 |
| 5 | peig | 2 |
| 6 | ლემსის | 2 |
| 7 | smap | 2 |
| 8 | კამიტის | 2 |
| 9 | ვილაკამპას | 2 |
| 10 | დევორეს | 2 |
Zipf's Law Analysis
| Metric | Value |
|---|---|
| Zipf Coefficient | 0.9374 |
| R² (Goodness of Fit) | 0.993145 |
| Adherence Quality | excellent |
Coverage Analysis
| Top N Words | Coverage |
|---|---|
| Top 100 | 19.3% |
| Top 1,000 | 42.2% |
| Top 5,000 | 62.0% |
| Top 10,000 | 70.3% |
Key Findings
- Zipf Compliance: R²=0.9931 indicates excellent adherence to Zipf's law
- High Frequency Dominance: Top 100 words cover 19.3% of corpus
- Long Tail: 705,127 words needed for remaining 29.7% coverage
5. Word Embeddings Evaluation
5.1 Cross-Lingual Alignment
5.2 Model Comparison
| Model | Dimension | Isotropy | Semantic Density | Alignment R@1 | Alignment R@10 |
|---|---|---|---|---|---|
| mono_32d | 32 | 0.7869 | 0.3479 | N/A | N/A |
| mono_64d | 64 | 0.7389 | 0.2989 | N/A | N/A |
| mono_128d | 128 | 0.6243 | 0.2604 | N/A | N/A |
| aligned_32d | 32 | 0.7869 🏆 | 0.3607 | 0.1100 | 0.4300 |
| aligned_64d | 64 | 0.7389 | 0.3031 | 0.2300 | 0.6300 |
| aligned_128d | 128 | 0.6243 | 0.2636 | 0.2980 | 0.7120 |
Key Findings
- Best Isotropy: aligned_32d with 0.7869 (more uniform distribution)
- Semantic Density: Average pairwise similarity of 0.3057. Lower values indicate better semantic separation.
- Alignment Quality: Aligned models achieve up to 29.8% R@1 in cross-lingual retrieval.
- Recommendation: 128d aligned for best cross-lingual performance
6. Morphological Analysis (Experimental)
This section presents an automated morphological analysis derived from the statistical divergence between word-level and subword-level models. By analyzing where subword predictability spikes and where word-level coverage fails, we can infer linguistic structures without supervised data.
6.1 Productivity & Complexity
| Metric | Value | Interpretation | Recommendation |
|---|---|---|---|
| Productivity Index | 5.000 | High morphological productivity | Reliable analysis |
| Idiomaticity Gap | -0.271 | Low formulaic content | - |
6.2 Affix Inventory (Productive Units)
These are the most productive prefixes and suffixes identified by sampling the vocabulary for global substitutability patterns. A unit is considered an affix if stripping it leaves a valid stem that appears in other contexts.
Productive Prefixes
| Prefix | Examples |
|---|---|
-სა |
სატომთაშორისო, საგანძურისა, სამართლიანი |
-ა |
ავტომატიზირებულ, აგროტექნიკის, აცაურას |
-გა |
გამოვლინებებამდე, გამაცალკევებელი, გათხრებისთვის |
-და |
დაგვანებეთ, დაკრძალულ, დაპყრობლი |
-მ |
მოკავშირეობაზე, მავრიკიოსს, მანიშნებელ |
-მა |
მავრიკიოსს, მანიშნებელ, მარჯანიშვილი |
-მო |
მოკავშირეობაზე, მომქნევი, მომლოცველთაგან |
-ს |
სატომთაშორისო, საგანძურისა, სამართლიანი |
Productive Suffixes
| Suffix | Examples |
|---|---|
-ს |
დრეიკს, მავრიკიოსს, დრაჩას |
-ი |
ბანიშევსკი, ეგზემპლარში, სამართლიანი |
-ის |
პარმელის, იასარის, ყუსარის |
-ა |
კირქვისაა, ზედამიოცენისა, საგანძურისა |
-ან |
დიაკონთან, ერდმან, ბრიტანელებისაგან |
-ნ |
დიაკონთან, ერდმან, ბრიტანელებისაგან |
-ლი |
მარჯანიშვილი, ჩამოშორებული, დაპყრობლი |
-სა |
ზედამიოცენისა, საგანძურისა, ტყვიავისა |
6.3 Bound Stems (Lexical Roots)
Bound stems are high-frequency subword units that are semantically cohesive but rarely appear as standalone words. These often correspond to the 'core' of a word that requires inflection or derivation to be valid.
| Stem | Cohesion | Substitutability | Examples |
|---|---|---|---|
ეთის |
1.85x | 194 contexts | ჩეთის, შეთის, ბეთის |
ელებ |
1.48x | 550 contexts | ელები, კელებ, ჯელებ |
მდეგ |
2.33x | 52 contexts | ემდეგ, შამდეგ, დამდეგ |
ენებ |
1.41x | 544 contexts | ენება, ენები, ენებს |
ებულ |
1.59x | 250 contexts | ქებულ, კრებულ, ქებული |
დგენ |
1.75x | 134 contexts | ადგენს, ვადგენ, უდგენს |
ართვ |
1.68x | 147 contexts | ქართვ, მართვე, ჩართვა |
რთვე |
1.81x | 96 contexts | მართვე, რთველს, ქართვე |
ომელ |
1.63x | 118 contexts | ტომელ, რომელ, დომელი |
ნტერ |
1.51x | 148 contexts | უნტერ, ინტერ, ენტერ |
ავლე |
1.43x | 180 contexts | სავლე, ავლენ, პავლე |
ალაქ |
1.58x | 106 contexts | ქალაქ, მალაქ, დალაქს |
6.4 Affix Compatibility (Co-occurrence)
This table shows which prefixes and suffixes most frequently co-occur on the same stems, revealing the 'stacking' rules of the language's morphology.
| Prefix | Suffix | Frequency | Examples |
|---|---|---|---|
-მ |
-ს |
186 words | მონოტონურობის, მოსულიშვილს |
-მ |
-ი |
167 words | მხატვრებში, მელანქოლიკური |
-მ |
-ა |
129 words | მღებავთა, მანდილოსნებმა |
-ა |
-ი |
124 words | ალტენბურგში, ატკინი |
-ა |
-ს |
120 words | ალდეს, ანდერსონის |
-გა |
-ა |
111 words | გამეგზავრა, გაკრიტიკება |
-მ |
-ის |
104 words | მონოტონურობის, მუსანდამის |
-ა |
-ა |
93 words | აბრევიაცია, აიუთაია |
-ს |
-ს |
88 words | სისლეის, სკიარას |
-ს |
-ი |
82 words | საფრთხეში, სტერეოსკოპული |
6.5 Recursive Morpheme Segmentation
Using Recursive Hierarchical Substitutability, we decompose complex words into their constituent morphemes. This approach handles nested affixes (e.g., prefix-prefix-root-suffix).
| Word | Suggested Split | Confidence | Stem |
|---|---|---|---|
| დაკარგვასა | დაკარგვა-ს-ა |
7.5 | ს |
| პედიატრიასა | პედიატრია-ს-ა |
7.5 | ს |
| ინდიკატორებია | ინდიკატორებ-ი-ა |
7.5 | ი |
| კარნახობდათ | კარნახობდ-ა-თ |
7.5 | ა |
| ნაციონალიზმსა | ნაციონალიზმ-ს-ა |
7.5 | ს |
| მიმოხილვაზე | მიმოხილვ-ა-ზე |
7.5 | ა |
| მეტყევეობაში | მეტყევეობ-ა-ში |
7.5 | ა |
| არისტოკრატია | არისტოკრატ-ი-ა |
7.5 | ი |
| გადაუხდელობას | გადაუხდელობ-ა-ს |
7.5 | ა |
| провинцииოსო | провинцииო-ს-ო |
7.5 | ს |
| ძეგლებსაც | ძეგლებ-ს-აც |
7.5 | ს |
| კონფისკაციასა | კონფისკაცია-ს-ა |
7.5 | ს |
| არაკატაკაში | არაკატაკ-ა-ში |
7.5 | ა |
| მონოკრისტალი | მონოკრისტ-ა-ლი |
7.5 | ა |
| ჰოლანდიას | ჰოლანდი-ა-ს |
7.5 | ა |
6.6 Linguistic Interpretation
Automated Insight: The language Georgian shows high morphological productivity. The subword models are significantly more efficient than word models, suggesting a rich system of affixation or compounding.
7. Summary & Recommendations
Production Recommendations
| Component | Recommended | Rationale |
|---|---|---|
| Tokenizer | 64k BPE | Best compression (5.03x) |
| N-gram | 2-gram | Lowest perplexity (423) |
| Markov | Context-4 | Highest predictability (97.2%) |
| Embeddings | 100d | Balanced semantic capture and isotropy |
Appendix: Metrics Glossary & Interpretation Guide
This section provides definitions, intuitions, and guidance for interpreting the metrics used throughout this report.
Tokenizer Metrics
Compression Ratio
Definition: The ratio of characters to tokens (chars/token). Measures how efficiently the tokenizer represents text.
Intuition: Higher compression means fewer tokens needed to represent the same text, reducing sequence lengths for downstream models. A 3x compression means ~3 characters per token on average.
What to seek: Higher is generally better for efficiency, but extremely high compression may indicate overly aggressive merging that loses morphological information.
Average Token Length (Fertility)
Definition: Mean number of characters per token produced by the tokenizer.
Intuition: Reflects the granularity of tokenization. Longer tokens capture more context but may struggle with rare words; shorter tokens are more flexible but increase sequence length.
What to seek: Balance between 2-5 characters for most languages. Arabic/morphologically-rich languages may benefit from slightly longer tokens.
Unknown Token Rate (OOV Rate)
Definition: Percentage of tokens that map to the unknown/UNK token, indicating words the tokenizer cannot represent.
Intuition: Lower OOV means better vocabulary coverage. High OOV indicates the tokenizer encounters many unseen character sequences.
What to seek: Below 1% is excellent; below 5% is acceptable. BPE tokenizers typically achieve very low OOV due to subword fallback.
N-gram Model Metrics
Perplexity
Definition: Measures how "surprised" the model is by test data. Mathematically: 2^(cross-entropy). Lower values indicate better prediction.
Intuition: If perplexity is 100, the model is as uncertain as if choosing uniformly among 100 options at each step. A perplexity of 10 means effectively choosing among 10 equally likely options.
What to seek: Lower is better. Perplexity decreases with larger n-grams (more context). Values vary widely by language and corpus size.
Entropy
Definition: Average information content (in bits) needed to encode the next token given the context. Related to perplexity: perplexity = 2^entropy.
Intuition: High entropy means high uncertainty/randomness; low entropy means predictable patterns. Natural language typically has entropy between 1-4 bits per character.
What to seek: Lower entropy indicates more predictable text patterns. Entropy should decrease as n-gram size increases.
Coverage (Top-K)
Definition: Percentage of corpus occurrences explained by the top K most frequent n-grams.
Intuition: High coverage with few patterns indicates repetitive/formulaic text; low coverage suggests diverse vocabulary usage.
What to seek: Depends on use case. For language modeling, moderate coverage (40-60% with top-1000) is typical for natural text.
Markov Chain Metrics
Average Entropy
Definition: Mean entropy across all contexts, measuring average uncertainty in next-word prediction.
Intuition: Lower entropy means the model is more confident about what comes next. Context-1 has high entropy (many possible next words); Context-4 has low entropy (few likely continuations).
What to seek: Decreasing entropy with larger context sizes. Very low entropy (<0.1) indicates highly deterministic transitions.
Branching Factor
Definition: Average number of unique next tokens observed for each context.
Intuition: High branching = many possible continuations (flexible but uncertain); low branching = few options (predictable but potentially repetitive).
What to seek: Branching factor should decrease with context size. Values near 1.0 indicate nearly deterministic chains.
Predictability
Definition: Derived metric: (1 - normalized_entropy) × 100%. Indicates how deterministic the model's predictions are.
Intuition: 100% predictability means the next word is always certain; 0% means completely random. Real text falls between these extremes.
What to seek: Higher predictability for text generation quality, but too high (>98%) may produce repetitive output.
Vocabulary & Zipf's Law Metrics
Zipf's Coefficient
Definition: The slope of the log-log plot of word frequency vs. rank. Zipf's law predicts this should be approximately -1.
Intuition: A coefficient near -1 indicates the corpus follows natural language patterns where a few words are very common and most words are rare.
What to seek: Values between -0.8 and -1.2 indicate healthy natural language distribution. Deviations may suggest domain-specific or artificial text.
R² (Coefficient of Determination)
Definition: Measures how well the linear fit explains the frequency-rank relationship. Ranges from 0 to 1.
Intuition: R² near 1.0 means the data closely follows Zipf's law; lower values indicate deviation from expected word frequency patterns.
What to seek: R² > 0.95 is excellent; > 0.99 indicates near-perfect Zipf adherence typical of large natural corpora.
Vocabulary Coverage
Definition: Cumulative percentage of corpus tokens accounted for by the top N words.
Intuition: Shows how concentrated word usage is. If top-100 words cover 50% of text, the corpus relies heavily on common words.
What to seek: Top-100 covering 30-50% is typical. Higher coverage indicates more repetitive text; lower suggests richer vocabulary.
Word Embedding Metrics
Isotropy
Definition: Measures how uniformly distributed vectors are in the embedding space. Computed as the ratio of minimum to maximum singular values.
Intuition: High isotropy (near 1.0) means vectors spread evenly in all directions; low isotropy means vectors cluster in certain directions, reducing expressiveness.
What to seek: Higher isotropy generally indicates better-quality embeddings. Values > 0.1 are reasonable; > 0.3 is good. Lower-dimensional embeddings tend to have higher isotropy.
Average Norm
Definition: Mean magnitude (L2 norm) of word vectors in the embedding space.
Intuition: Indicates the typical "length" of vectors. Consistent norms suggest stable training; high variance may indicate some words are undertrained.
What to seek: Relatively consistent norms across models. The absolute value matters less than consistency (low std deviation).
Cosine Similarity
Definition: Measures angular similarity between vectors, ranging from -1 (opposite) to 1 (identical direction).
Intuition: Words with similar meanings should have high cosine similarity. This is the standard metric for semantic relatedness in embeddings.
What to seek: Semantically related words should score > 0.5; unrelated words should be near 0. Synonyms often score > 0.7.
t-SNE Visualization
Definition: t-Distributed Stochastic Neighbor Embedding - a dimensionality reduction technique that preserves local structure for visualization.
Intuition: Clusters in t-SNE plots indicate groups of semantically related words. Spread indicates vocabulary diversity; tight clusters suggest semantic coherence.
What to seek: Meaningful clusters (e.g., numbers together, verbs together). Avoid over-interpreting distances - t-SNE preserves local, not global, structure.
General Interpretation Guidelines
- Compare within model families: Metrics are most meaningful when comparing models of the same type (e.g., 8k vs 64k tokenizer).
- Consider trade-offs: Better performance on one metric often comes at the cost of another (e.g., compression vs. OOV rate).
- Context matters: Optimal values depend on downstream tasks. Text generation may prioritize different metrics than classification.
- Corpus influence: All metrics are influenced by corpus characteristics. Wikipedia text differs from social media or literature.
- Language-specific patterns: Morphologically rich languages (like Arabic) may show different optimal ranges than analytic languages.
Visualizations Index
| Visualization | Description |
|---|---|
| Tokenizer Compression | Compression ratios by vocabulary size |
| Tokenizer Fertility | Average token length by vocabulary |
| Tokenizer OOV | Unknown token rates |
| Tokenizer Total Tokens | Total tokens by vocabulary |
| N-gram Perplexity | Perplexity by n-gram size |
| N-gram Entropy | Entropy by n-gram size |
| N-gram Coverage | Top pattern coverage |
| N-gram Unique | Unique n-gram counts |
| Markov Entropy | Entropy by context size |
| Markov Branching | Branching factor by context |
| Markov Contexts | Unique context counts |
| Zipf's Law | Frequency-rank distribution with fit |
| Vocab Frequency | Word frequency distribution |
| Top 20 Words | Most frequent words |
| Vocab Coverage | Cumulative coverage curve |
| Embedding Isotropy | Vector space uniformity |
| Embedding Norms | Vector magnitude distribution |
| Embedding Similarity | Word similarity heatmap |
| Nearest Neighbors | Similar words for key terms |
| t-SNE Words | 2D word embedding visualization |
| t-SNE Sentences | 2D sentence embedding visualization |
| Position Encoding | Encoding method comparison |
| Model Sizes | Storage requirements |
| Performance Dashboard | Comprehensive performance overview |
About This Project
Data Source
Models trained on wikipedia-monthly - a monthly snapshot of Wikipedia articles across 300+ languages.
Project
A project by Wikilangs - Open-source NLP models for every Wikipedia language.
Maintainer
Citation
If you use these models in your research, please cite:
@misc{wikilangs2025,
author = {Kamali, Omar},
title = {Wikilangs: Open NLP Models for Wikipedia Languages},
year = {2025},
doi = {10.5281/zenodo.18073153},
publisher = {Zenodo},
url = {https://huggingface.co/wikilangs}
institution = {Omneity Labs}
}
License
MIT License - Free for academic and commercial use.
Links
- 🌐 Website: wikilangs.org
- 🤗 Models: huggingface.co/wikilangs
- 📊 Data: wikipedia-monthly
- 👤 Author: Omar Kamali
- 🤝 Sponsor: Featherless AI
Generated by Wikilangs Models Pipeline
Report Date: 2026-01-10 11:10:47



















