--- language: ace language_name: ACE language_family: austronesian_malay tags: - wikilangs - nlp - tokenizer - embeddings - n-gram - markov - wikipedia - monolingual - family-austronesian_malay license: mit library_name: wikilangs pipeline_tag: feature-extraction datasets: - omarkamali/wikipedia-monthly dataset_info: name: wikipedia-monthly description: Monthly snapshots of Wikipedia articles across 300+ languages metrics: - name: best_compression_ratio type: compression value: 4.925 - name: best_isotropy type: isotropy value: 0.5172 - name: vocabulary_size type: vocab value: 0 generated: 2026-01-03 --- # ACE - Wikilangs Models ## Comprehensive Research Report & Full Ablation Study This repository contains NLP models trained and evaluated by Wikilangs, specifically on **ACE** 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 ![Performance Dashboard](visualizations/performance_dashboard.png) ### Analysis and Evaluation - [1. Tokenizer Evaluation](#1-tokenizer-evaluation) - [2. N-gram Model Evaluation](#2-n-gram-model-evaluation) - [3. Markov Chain Evaluation](#3-markov-chain-evaluation) - [4. Vocabulary Analysis](#4-vocabulary-analysis) - [5. Word Embeddings Evaluation](#5-word-embeddings-evaluation) - [6. Morphological Analysis (Experimental)](#6-morphological-analysis) - [7. Summary & Recommendations](#7-summary--recommendations) - [Metrics Glossary](#appendix-metrics-glossary--interpretation-guide) - [Visualizations Index](#visualizations-index) --- ## 1. Tokenizer Evaluation ![Tokenizer Compression](visualizations/tokenizer_compression.png) ![Tokenizer Fertility](visualizations/tokenizer_fertility.png) ![Tokenizer OOV](visualizations/tokenizer_oov.png) ![Total Tokens](visualizations/tokenizer_total_tokens.png) ### Results | Vocab Size | Compression | Avg Token Len | UNK Rate | Total Tokens | |------------|-------------|---------------|----------|--------------| | **8k** | 4.119x | 4.13 | 0.2682% | 125,632 | | **16k** | 4.488x | 4.50 | 0.2923% | 115,301 | | **32k** | 4.727x | 4.74 | 0.3079% | 109,452 | | **64k** | 4.925x 馃弳 | 4.93 | 0.3208% | 105,066 | ### Tokenization Examples Below are sample sentences tokenized with each vocabulary size: **Sample 1:** `Mukim Sepakat nakeuh saboh mukim di keucamatan Lawe Sigala-Gala Kabupat猫n Ac猫h T...` | Vocab | Tokens | Count | |-------|--------|-------| | 8k | `鈻乵ukim 鈻乻epakat 鈻乶akeuh 鈻乻aboh 鈻乵ukim 鈻乨i 鈻乲eucamatan 鈻乴awe 鈻乻igala - ... (+12 more)` | 22 | | 16k | `鈻乵ukim 鈻乻epakat 鈻乶akeuh 鈻乻aboh 鈻乵ukim 鈻乨i 鈻乲eucamatan 鈻乴awe 鈻乻igala - ... (+12 more)` | 22 | | 32k | `鈻乵ukim 鈻乻epakat 鈻乶akeuh 鈻乻aboh 鈻乵ukim 鈻乨i 鈻乲eucamatan 鈻乴awe 鈻乻igala - ... (+12 more)` | 22 | | 64k | `鈻乵ukim 鈻乻epakat 鈻乶akeuh 鈻乻aboh 鈻乵ukim 鈻乨i 鈻乲eucamatan 鈻乴awe 鈻乻igala - ... (+12 more)` | 22 | **Sample 2:** `Propinsi Nakhon Ratchasima nakeuh saboh propinsi di timu baroh Muangthai. Nang n...` | Vocab | Tokens | Count | |-------|--------|-------| | 8k | `鈻乸ropinsi 鈻乶akhon 鈻乺atch asi ma 鈻乶akeuh 鈻乻aboh 鈻乸ropinsi 鈻乨i 鈻乼imu ... (+11 more)` | 21 | | 16k | `鈻乸ropinsi 鈻乶akhon 鈻乺atchasima 鈻乶akeuh 鈻乻aboh 鈻乸ropinsi 鈻乨i 鈻乼imu 鈻乥aroh 鈻乵uangthai ... (+7 more)` | 17 | | 32k | `鈻乸ropinsi 鈻乶akhon 鈻乺atchasima 鈻乶akeuh 鈻乻aboh 鈻乸ropinsi 鈻乨i 鈻乼imu 鈻乥aroh 鈻乵uangthai ... (+7 more)` | 17 | | 64k | `鈻乸ropinsi 鈻乶akhon 鈻乺atchasima 鈻乶akeuh 鈻乻aboh 鈻乸ropinsi 鈻乨i 鈻乼imu 鈻乥aroh 鈻乵uangthai ... (+7 more)` | 17 | **Sample 3:** `Kandang nakeuh gamp么ng di Keucamatan Samalanga, Kabupat猫n Bireuen, Ac猫h. Lumb么i ...` | Vocab | Tokens | Count | |-------|--------|-------| | 8k | `鈻乲andang 鈻乶akeuh 鈻乬amp么ng 鈻乨i 鈻乲eucamatan 鈻乻amalanga , 鈻乲abupat猫n 鈻乥ireuen , ... (+13 more)` | 23 | | 16k | `鈻乲andang 鈻乶akeuh 鈻乬amp么ng 鈻乨i 鈻乲eucamatan 鈻乻amalanga , 鈻乲abupat猫n 鈻乥ireuen , ... (+13 more)` | 23 | | 32k | `鈻乲andang 鈻乶akeuh 鈻乬amp么ng 鈻乨i 鈻乲eucamatan 鈻乻amalanga , 鈻乲abupat猫n 鈻乥ireuen , ... (+13 more)` | 23 | | 64k | `鈻乲andang 鈻乶akeuh 鈻乬amp么ng 鈻乨i 鈻乲eucamatan 鈻乻amalanga , 鈻乲abupat猫n 鈻乥ireuen , ... (+13 more)` | 23 | ### Key Findings - **Best Compression:** 64k achieves 4.925x compression - **Lowest UNK Rate:** 8k with 0.2682% 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 ![N-gram Perplexity](visualizations/ngram_perplexity.png) ![N-gram Unique](visualizations/ngram_unique.png) ![N-gram Coverage](visualizations/ngram_coverage.png) ### Results | N-gram | Variant | Perplexity | Entropy | Unique N-grams | Top-100 Coverage | Top-1000 Coverage | |--------|---------|------------|---------|----------------|------------------|-------------------| | **2-gram** | Word | 637 | 9.32 | 7,009 | 62.6% | 83.4% | | **2-gram** | Subword | 224 馃弳 | 7.80 | 2,204 | 71.8% | 99.5% | | **3-gram** | Word | 577 | 9.17 | 8,214 | 65.4% | 85.5% | | **3-gram** | Subword | 1,194 | 10.22 | 14,605 | 37.9% | 84.9% | | **4-gram** | Word | 673 | 9.39 | 12,805 | 64.5% | 83.7% | | **4-gram** | Subword | 3,551 | 11.79 | 59,251 | 26.2% | 67.5% | ### Top 5 N-grams by Size **2-grams (Word):** | Rank | N-gram | Count | |------|--------|-------| | 1 | `bak laman` | 7,389 | | 2 | `gunong nyoe` | 7,388 | | 3 | `nyoe bak` | 5,543 | | 4 | `nakeuh saboh` | 5,045 | | 5 | `di ac猫h` | 4,748 | **3-grams (Word):** | Rank | N-gram | Count | |------|--------|-------| | 1 | `gunong nyoe bak` | 5,541 | | 2 | `nyoe bak laman` | 3,694 | | 3 | `lumb么i gamp么ng nyoe` | 3,567 | | 4 | `ac猫h lumb么i gamp么ng` | 3,564 | | 5 | `nyoe lam data` | 3,499 | **4-grams (Word):** | Rank | N-gram | Count | |------|--------|-------| | 1 | `gunong nyoe bak laman` | 3,694 | | 2 | `ac猫h lumb么i gamp么ng nyoe` | 3,564 | | 3 | `nyoe lam data peumeur猫ntah` | 3,499 | | 4 | `gamp么ng nyoe lam data` | 3,499 | | 5 | `lam data peumeur猫ntah nakeuh` | 3,499 | **2-grams (Subword):** | Rank | N-gram | Count | |------|--------|-------| | 1 | `e u` | 117,818 | | 2 | `_ n` | 79,411 | | 3 | `a n` | 69,436 | | 4 | `h _` | 68,029 | | 5 | `n g` | 67,573 | **3-grams (Subword):** | Rank | N-gram | Count | |------|--------|-------| | 1 | `n g _` | 44,439 | | 2 | `_ n a` | 31,640 | | 3 | `_ b a` | 30,463 | | 4 | `k e u` | 30,322 | | 5 | `_ n y` | 26,537 | **4-grams (Subword):** | Rank | N-gram | Count | |------|--------|-------| | 1 | `e u h _` | 23,348 | | 2 | `b a k _` | 23,260 | | 3 | `_ d i _` | 21,144 | | 4 | `k e u h` | 21,117 | | 5 | `a k e u` | 20,691 | ### Key Findings - **Best Perplexity:** 2-gram (subword) with 224 - **Entropy Trend:** Decreases with larger n-grams (more predictable) - **Coverage:** Top-1000 patterns cover ~68% of corpus - **Recommendation:** 4-gram or 5-gram for best predictive performance --- ## 3. Markov Chain Evaluation ![Markov Entropy](visualizations/markov_entropy.png) ![Markov Contexts](visualizations/markov_contexts.png) ![Markov Branching](visualizations/markov_branching.png) ### Results | Context | Variant | Avg Entropy | Perplexity | Branching Factor | Unique Contexts | Predictability | |---------|---------|-------------|------------|------------------|-----------------|----------------| | **1** | Word | 0.7515 | 1.684 | 4.35 | 36,025 | 24.8% | | **1** | Subword | 0.8633 | 1.819 | 5.38 | 1,269 | 13.7% | | **2** | Word | 0.2148 | 1.161 | 1.44 | 155,224 | 78.5% | | **2** | Subword | 0.7739 | 1.710 | 4.50 | 6,822 | 22.6% | | **3** | Word | 0.0655 | 1.046 | 1.11 | 221,018 | 93.4% | | **3** | Subword | 0.7559 | 1.689 | 3.54 | 30,615 | 24.4% | | **4** | Word | 0.0242 馃弳 | 1.017 | 1.04 | 242,720 | 97.6% | | **4** | Subword | 0.5660 | 1.480 | 2.36 | 108,223 | 43.4% | ### Generated Text Samples (Word-based) Below are text samples generated from each word-based Markov chain model: **Context Size 1:** 1. `di pidie ac猫h timu ac猫h indonesia the colour of life seuneubeuet bak saboh sp猫si猫s nibak takson` 2. `nakeuh gunong nyoe geupeuteubiet bak wikidata data peumeur猫ntah nakeuh gunong di teungoh ngon geukeu...` 3. `bak wikidata data matauroe teubiet teunom di ateuh babah la 么t peunaw么t luwa data gunong nyoe` **Context Size 2:** 1. `bak laman sunrisesunset com di ac猫h seulatan ac猫h lumb么i gamp么ng nyoe lam data peumeur猫ntah nakeuh n...` 2. `gunong nyoe bak laman geonames data gunong nyoe bak laman sunrisesunset com di ac猫h nakeuh gamp么ng d...` 3. `nyoe bak wikidata data cuaca daerah gunong nyoe nakeuh kagoshima banda` **Context Size 3:** 1. `gunong nyoe bak laman geonames data gunong nyoe bak wikidata data cuaca daerah gunong nyoe bak wikid...` 2. `nyoe bak laman geonames data gunong nyoe bak laman geonames data gunong nyoe bak wikidata data cuaca...` 3. `lumb么i gamp么ng nyoe lam data peumeur猫ntah nakeuh n猫 di ac猫h rayek kawan ingin jaya ac猫h rayek nibak ...` **Context Size 4:** 1. `gunong nyoe bak laman nasa data matauroe teubiet teunom di da irah bak laman sunrisesunset com di ac...` 2. `ac猫h lumb么i gamp么ng nyoe lam data peumeur猫ntah nakeuh n猫 di ac猫h rayek ac猫h ac猫h rayek` 3. `nyoe lam data peumeur猫ntah nakeuh n猫 di bireuen bireuen` ### Generated Text Samples (Subword-based) Below are text samples generated from each subword-based Markov chain model: **Context Size 1:** 1. `_da_geri猫_kahara` 2. `ata_jeetabam_lab` 3. `ng_ngeung_teukeu` **Context Size 2:** 1. `euna_preunomyza_d` 2. `_nya_-_diet_lis_a` 3. `h_nak_lam_diversi` **Context Size 3:** 1. `ng_udeh_nyoe_lam_d` 2. `_nakeuh_sp猫si_ac猫h` 3. `_bagiang_bak_lag猫e` **Context Size 4:** 1. `euh_tar猫h_seu毛_deun` 2. `bak_encyclopedia_of` 3. `_di_surat_l茅_gosho_` ### Key Findings - **Best Predictability:** Context-4 (word) with 97.6% predictability - **Branching Factor:** Decreases with context size (more deterministic) - **Memory Trade-off:** Larger contexts require more storage (108,223 contexts) - **Recommendation:** Context-3 or Context-4 for text generation --- ## 4. Vocabulary Analysis ![Zipf's Law](visualizations/zipf_law.png) ![Top Words](visualizations/top20_words.png) ![Coverage Curve](visualizations/vocab_coverage.png) ### Statistics | Metric | Value | |--------|-------| | Vocabulary Size | 15,502 | | Total Tokens | 515,006 | | Mean Frequency | 33.22 | | Median Frequency | 3 | | Frequency Std Dev | 415.97 | ### Most Common Words | Rank | Word | Frequency | |------|------|-----------| | 1 | di | 21,196 | | 2 | nakeuh | 20,604 | | 3 | bak | 18,159 | | 4 | ac猫h | 17,511 | | 5 | nyoe | 13,184 | | 6 | data | 11,090 | | 7 | gunong | 10,023 | | 8 | nyang | 9,025 | | 9 | gamp么ng | 8,794 | | 10 | lam | 7,941 | ### Least Common Words (from vocabulary) | Rank | Word | Frequency | |------|------|-----------| | 1 | sa没dep | 2 | | 2 | teuleungah | 2 | | 3 | mutuskeun | 2 | | 4 | ekshumasi | 2 | | 5 | teukeuh | 2 | | 6 | dilegalisasikan | 2 | | 7 | jendela | 2 | | 8 | pros猫s | 2 | | 9 | piazza | 2 | | 10 | fontana | 2 | ### Zipf's Law Analysis | Metric | Value | |--------|-------| | Zipf Coefficient | 1.1704 | | R虏 (Goodness of Fit) | 0.995382 | | Adherence Quality | **excellent** | ### Coverage Analysis | Top N Words | Coverage | |-------------|----------| | Top 100 | 63.2% | | Top 1,000 | 84.2% | | Top 5,000 | 94.2% | | Top 10,000 | 97.8% | ### Key Findings - **Zipf Compliance:** R虏=0.9954 indicates excellent adherence to Zipf's law - **High Frequency Dominance:** Top 100 words cover 63.2% of corpus - **Long Tail:** 5,502 words needed for remaining 2.2% coverage --- ## 5. Word Embeddings Evaluation ![Embedding Isotropy](visualizations/embedding_isotropy.png) ![Similarity Matrix](visualizations/embedding_similarity.png) ![t-SNE Words](visualizations/tsne_words.png) ![t-SNE Sentences](visualizations/tsne_sentences.png) ### 5.1 Cross-Lingual Alignment > *Note: Multilingual alignment visualization not available for this language.* ### 5.2 Model Comparison | Model | Dimension | Isotropy | Semantic Density | Alignment R@1 | Alignment R@10 | |-------|-----------|----------|------------------|---------------|----------------| | **mono_32d** | 32 | 0.5172 馃弳 | 0.4104 | N/A | N/A | | **mono_64d** | 64 | 0.1209 | 0.4362 | N/A | N/A | | **mono_128d** | 128 | 0.0271 | 0.4092 | N/A | N/A | ### Key Findings - **Best Isotropy:** mono_32d with 0.5172 (more uniform distribution) - **Semantic Density:** Average pairwise similarity of 0.4186. Lower values indicate better semantic separation. - **Alignment Quality:** No aligned models evaluated in this run. - **Recommendation:** 128d aligned for best cross-lingual performance --- ## 6. Morphological Analysis (Experimental) > 鈿狅笍 **Warning:** This language shows low morphological productivity. The statistical signals used for this analysis may be noisy or less reliable than for morphologically rich languages. 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 | **0.000** | Low morphological productivity | 鈿狅笍 Likely unreliable | | Idiomaticity Gap | **-1.000** | 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 | |--------|----------| | `-me` | meulagu, meukeunong, meulab么h | | `-ge` | geumeuhoi, geupasoe, geupeuresmi | | `-geu` | geumeuhoi, geupasoe, geupeuresmi | | `-meu` | meulagu, meukeunong, meulab么h | | `-pe` | peunuman, peureudee, peumurah | #### Productive Suffixes | Suffix | Examples | |--------|----------| | `-ng` | meukeunong, gelampang, seberang | | `-an` | jonathan, peunuman, kyrgyzstan | | `-ah` | bawah, geupeujeulah, jumlah | ### 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 | |------|----------|------------------|----------| | `eung` | 1.41x | 64 contexts | reung, meung, jeung | | `uneu` | 1.70x | 28 contexts | runeu, uneun, seuneu | | `euen` | 1.54x | 38 contexts | eueng, meuen, leuen | | `euna` | 1.36x | 59 contexts | peuna, beuna, keuna | | `ubeu` | 1.47x | 22 contexts | ubeut, neubeu, ubeuet | | `umeu` | 1.44x | 23 contexts | jumeu, geumeu, jeumeu | | `meur` | 1.63x | 15 contexts | meuri, meur么, meur么n | | `anga` | 1.36x | 23 contexts | panga, manga, langa | | `teun` | 1.32x | 25 contexts | uteun, ateung, teunga | | `neub` | 1.57x | 14 contexts | neuba, neubeu, neub么k | | `eube` | 1.48x | 16 contexts | leube, teubee, leubeh | | `eune` | 1.63x | 12 contexts | seuneu, geuneu, keuneu | ### 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 | |--------|--------|-----------|----------| | `-ge` | `-ng` | 56 words | geupeutrang, geud么ng | | `-pe` | `-an` | 51 words | penyiaran, permukaan | | `-me` | `-ng` | 40 words | meulinteueng, meuhub么ng | | `-pe` | `-ng` | 22 words | perang, peukeumang | | `-pe` | `-ah` | 18 words | peujeunajah, peuleumah | | `-ge` | `-ah` | 17 words | geupeuglah, geupeuluwah | | `-me` | `-ah` | 16 words | meujumeulah, meurah | | `-me` | `-an` | 10 words | meridian, meukeujadian | | `-ge` | `-an` | 6 words | geurakan, geuritan | ### 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 | |------|-----------------|------------|------| | geumeudong | **`geu-meu-dong`** | 6.0 | `dong` | | geumeutut么 | **`geu-meu-tut么`** | 6.0 | `tut么` | | meubileueng | **`meu-bileue-ng`** | 6.0 | `bileue` | | geulumbang | **`geu-lumba-ng`** | 6.0 | `lumba` | | geumeupakat | **`geu-meu-pakat`** | 6.0 | `pakat` | | geumeuniaga | **`geu-meu-niaga`** | 6.0 | `niaga` | | geumeuturi | **`geu-meu-turi`** | 6.0 | `turi` | | geuseubar么 | **`geu-seubar么`** | 4.5 | `seubar么` | | geudapeuta | **`geu-dapeuta`** | 4.5 | `dapeuta` | | meusampoe | **`meu-sampoe`** | 4.5 | `sampoe` | | geubayeu毛 | **`geu-bayeu毛`** | 4.5 | `bayeu毛` | | meulingka | **`meu-lingka`** | 4.5 | `lingka` | | meusiyasat | **`meu-siyasat`** | 4.5 | `siyasat` | | meulaksana | **`meu-laksana`** | 4.5 | `laksana` | | geubayeue | **`geu-bayeue`** | 4.5 | `bayeue` | ### 6.6 Linguistic Interpretation > **Automated Insight:** The language ACE appears to be more isolating or has a highly fixed vocabulary. Word-level models perform nearly as well as subword models, indicating fewer productive morphological processes. --- ## 7. Summary & Recommendations ![Performance Dashboard](visualizations/performance_dashboard.png) ### Production Recommendations | Component | Recommended | Rationale | |-----------|-------------|-----------| | Tokenizer | **64k BPE** | Best compression (4.92x) | | N-gram | **2-gram** | Lowest perplexity (224) | | Markov | **Context-4** | Highest predictability (97.6%) | | 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 1. **Compare within model families:** Metrics are most meaningful when comparing models of the same type (e.g., 8k vs 64k tokenizer). 2. **Consider trade-offs:** Better performance on one metric often comes at the cost of another (e.g., compression vs. OOV rate). 3. **Context matters:** Optimal values depend on downstream tasks. Text generation may prioritize different metrics than classification. 4. **Corpus influence:** All metrics are influenced by corpus characteristics. Wikipedia text differs from social media or literature. 5. **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](https://huggingface.co/datasets/omarkamali/wikipedia-monthly) - a monthly snapshot of Wikipedia articles across 300+ languages. ### Project A project by **[Wikilangs](https://wikilangs.org)** - Open-source NLP models for every Wikipedia language. ### Maintainer [Omar Kamali](https://omarkamali.com) - [Omneity Labs](https://omneitylabs.com) ### Citation If you use these models in your research, please cite: ```bibtex @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](https://wikilangs.org) - 馃 Models: [huggingface.co/wikilangs](https://huggingface.co/wikilangs) - 馃搳 Data: [wikipedia-monthly](https://huggingface.co/datasets/omarkamali/wikipedia-monthly) - 馃懁 Author: [Omar Kamali](https://huggingface.co/omarkamali) - 馃 Sponsor: [Featherless AI](https://featherless.ai) --- *Generated by Wikilangs Models Pipeline* *Report Date: 2026-01-03 05:05:30*