NIRVLab β MorpheL Tokenizer for Russian XNLI
MorpheL: MI-Guided Stochastic Segmentation tokenizer for morphologically rich low-resource languages (Proposal: MorpheL: Morphology-Aware Tokenizer Adaptation for Pretrained Models in Low-Resource Languages).
Trained on the Russian (ru) subset of
facebook/xnli β all splits.
Algorithm
MorpheL scores candidate intra-word boundaries via pointwise mutual information (MI) between prefix and suffix substrings, then stochastically selects the number of cuts via Gumbel perturbation (Eq. 6β8). Key distinctions from BPE-Dropout:
- Randomness is MI-informed β only high-MI boundaries enter the candidate pool
- Vowel-consonant transition heuristic pre-filters linguistically implausible positions
- Global MI table aggregated over full corpus (not per-sentence) for stability
Training Config
| Parameter | Value |
|---|---|
| Algorithm | MorpheL (MI + Gumbel) |
| Vocabulary size | 32,083 |
| top_k | 4 |
| temperature (T) | 1.0 (vocab induction: T=0) |
| mi_threshold | 0.0 (keep MI > 0) |
| min_frequency | 2 |
| Special tokens | <s>, <pad>, </s>, <unk>, <mask> |
| Corpus | facebook/xnli/ru β all splits (800,404 sentences) |
| Vowel set | Russian Cyrillic (Π° Π΅ Ρ ΠΈ ΠΎ Ρ Ρ Ρ Ρ Ρ β 10 vowel letters; ΠΉ/Ρ/Ρ excluded) |
Evaluation Metrics (vs Baselines, vocab_size=32000, same corpus)
| Metric | BPE | WordPiece | Unigram | MorpheL |
|---|---|---|---|---|
| Fertility β | β | β | β | 1.4282 |
| Tokens/char β | β | β | β | 0.2076 |
| Avg seq len β | β | β | β | 19.27 |
| Vocab coverage β | β | β | β | 1.0000 |
| OOV rate β | β | β | β | 0.0000 |
Fill baseline columns after running baseline notebooks.
Usage
from transformers import AutoTokenizer
tokenizer = AutoTokenizer.from_pretrained("NIRVLab/xnli-morphel-ru-32k")
Note: MorpheL segments words before passing to the tokenizer. At downstream training time, use
temperature=1.0for stochastic segmentation. For inference, usetemperature=0(deterministic).