TL;DR
This paper introduces MorphTok, a novel approach to tokenization for Indic languages that grounds subword segmentation in linguistic morphology. By incorporating morphology-aware pre-tokenization and a constrained Byte-Pair Encoding (BPE) variant (CBPE) that respects script-specific features like dependent vowels, MorphTok significantly improves downstream NLP tasks like machine translation and language modeling, while also offering a more linguistically coherent tokenization.
What Problem Does This Paper Address?
Tokenization, the process of breaking text into smaller units (tokens), is a foundational step in Natural Language Processing (NLP). Current dominant methods, like Byte-Pair Encoding (BPE), are greedy and based on character frequency. While effective for handling out-of-vocabulary words and controlling vocabulary size, BPE often produces subword segments that don't align with linguistic units (morphemes). This is particularly problematic for morphologically rich languages like those in India, where word structures are complex and sandhi (sound changes at word boundaries) can lead to unnatural segmentations. These linguistically incoherent tokens can negatively impact the performance of downstream NLP models, especially for languages with complex writing systems like abugidas, which use diacritics for vowels.
Methods
The paper proposes a two-pronged approach:
- Morphologically Grounded Pre-tokenization: Before applying BPE, the text is pre-processed to align segments with morpheme boundaries. This is achieved through two methods:
- Lookup-Based: A curated dictionary of Hindi and Marathi words is created with language experts, mapping words to their linguistically grounded segments. This dictionary is used to replace words in the training corpus with their segmented forms.
- Model-Driven: To overcome the limitations of manual lookup tables, a fine-tuned mT5 model is used to perform word segmentation, aiming for broader coverage.
- Constrained BPE (CBPE): To address specific challenges in Indic scripts, particularly the handling of dependent vowels (diacritics), a modified BPE algorithm called CBPE is introduced. Standard BPE can incorrectly segment dependent vowels as separate tokens. CBPE modifies the initialization step to ensure dependent vowels are attached to their preceding characters, forming cohesive units and reducing undesirable segmentations.
Additionally, the authors introduce EvalTok, a human-centric evaluation metric designed to assess the morphological and semantic quality of tokenizations, complementing traditional automatic metrics.
Datasets
- Hindi and Marathi Segmentation Dataset: A novel dataset of morphological segmentations for Hindi (54,395 entries) and Marathi (58,333 entries) was created to facilitate morphology-aware segmentation.
- Machine Translation Datasets: The paper uses the In22-Gen test set for Hindi-Marathi and Marathi-Hindi machine translation experiments.
- Language Modeling Datasets: The Sangraha corpus is used for Hindi and Marathi language modeling experiments.
- Multilingual Translation Datasets: For multilingual experiments, datasets for Hindi to Dogri, Konkani, Maithili, Marathi, Nepali, and Sanskrit are used.
Key Insights and Ideas
- Linguistic grounding matters: Simply relying on statistical frequency (like BPE) can lead to linguistically nonsensical segmentations, especially for morphologically rich languages. Incorporating linguistic knowledge before statistical tokenization significantly improves performance.
- Dependent vowels are a specific challenge: Indic scripts' use of dependent vowels as diacritics poses a unique problem for standard tokenizers, leading to fragmentation. CBPE effectively addresses this by treating these as part of the consonant-vowel unit.
- Human evaluation is crucial: Automatic metrics like fertility don't fully capture the quality of tokenization. EvalTok provides a valuable human-grounded perspective on morphological and semantic correctness.
- Model-driven segmentation complements lookup: While lookup tables offer precise linguistic segmentation, they are limited in coverage. Model-driven approaches can extend this coverage, though they might introduce some noise.
Key Results
- Improved Downstream Performance: Morphologically grounded tokenization (Lookup + BPE) consistently outperformed standard BPE in machine translation (higher COMET and chrF2 scores) and language modeling (lower perplexity and loss).
- CBPE Benefits: CBPE reduced fertility scores by up to 1.68% compared to BPE, indicating fewer subword fragments per word, while maintaining or improving downstream performance.
- Human Evaluation Wins: The proposed methods (Lookup + BPE and Lookup + CBPE) received significantly higher scores in human evaluations (EvalTok) compared to standard BPE, indicating more linguistically coherent segmentations. For example, one evaluation showed an average score of 3.16 for pre-tokenization + BPE versus 2.56 for default BPE.
- Multilingual Performance: While BPE performed slightly better than Lookup+BPE in some multilingual settings, the paper suggests this might be due to only applying pre-tokenization to the source language.
Limitations and Future Work
- Multilingual Transfer: The paper notes that applying lookup-based pre-tokenization only to the source language in multilingual settings might not fully leverage cross-lingual transfer. Future work could explore applying it to both source and target languages.
- Model-Driven Noise: While model-driven segmentation improves coverage, it can introduce errors. Further verification and refinement of these models are suggested.
- Larger Models: The current work focuses on smaller and base models. Future work will explore the impact of MorphTok on larger language models.
- Broader Language Coverage: The methods are designed for Indo-Aryan and Dravidian languages and can be extended to other languages with similar morphological or script-based characteristics.
Summary updated