Source-linked AI summary

Contextual Tamil Spelling and Grammar Correction Using Progressively Fine-Tuned Sequence-to-Sequence Transformers

Karthikeyan A, Jaya Nirmala S, Sangeetha Sivanesan, Indhu R, Pranav Kumar, Bharat Jude Johnson, Vishnu Ram

arXiv:2609.03273v1cs.CL

TL;DR

Tamil correction remains difficult because existing approaches do not reliably handle sentence-level agreement, tense, and cross-word sandhi in a low-resource, agglutinative setting. The paper fine-tunes multilingual sequence-to-sequence transformers with staged synthetic supervision, and mBART-50 v5 reaches 69.3% top-1 exact-match accuracy on a disjoint diagnostic set.

  • Problem

    Tamil is a low-resource agglutinative language whose correction challenges extend beyond surface errors, while existing approaches do not reliably handle subject–verb agreement, tense consistency, or cross-word sandhi at sentence level.

  • Method

    The paper fine-tunes mT5-small and mBART-50 end to end to map noisy Tamil sentences directly to clean ones, using synthetic data and staged sandhi-specific augmentation.

  • Results

    69.3% top-1 exact-match accuracy is achieved by mBART-50 v5 on a 1,000-sentence balanced diagnostic set verified disjoint from training data, including 87.5% on cross-word sandhi.

  • Takeaways & Limitations

    The staged ablation shows subject–verb agreement becomes learnable with contextual supervision, rising from 1.0% to 52.5%.

  • Takeaways & Limitations

    Reported sandhi coverage is limited to vallinam sites because rarer phenomena such as nasal assimilation are absent from the data.

Abstract

from arXiv · show

Tamil spell and grammar correction is challenging because Tamil is an agglutinative low-resource language with rich verbal morphology, complex sandhi (phonetic transformation) rules at word boundaries, and a script of 247 distinct letters. Prior work targets word-level surface errors with rule-based methods, statistical n-gram models, Minimum Edit Distance, or hybrid pipelines with a transformer re-ranker; such methods cannot reliably handle contextual errors - subject-verb agreement, tense consistency, or cross-word sandhi - which require sentence-level understanding. We propose an end-to-end sequence-to-sequence formulation and fine-tune mT5-small and mBART-50 on a synthetic corpus of up to 657,720 noisy-clean Tamil sentence pairs spanning ten error categories. Both backbones follow the same four-stage progressive schedule, each stage targeting one weakness: surface noise (v2), contextual grammar (v3), single-site sandhi (v4), and multi-site cross-word sandhi (v5). On a 1,000-sentence balanced diagnostic set verified disjoint from all training data, our best model, mBART-50 v5, reaches 69.3% top-1 exact-match accuracy, with 87.5% on sandhi and 43.5% on subject-verb agreement. The schedule is what produces these gains: subject-verb accuracy rises from 1.0% to 52.5% once contextual pairs are introduced, and sandhi from 0% to 87.5% once multi-site sandhi pairs are. We additionally quantify a precision-recall trade-off this literature has not reported: sandhi recall is paid for monotonically in identity accuracy. Finally, Tamil-LLaMA-7B-Instruct reaches 19.0% zero-shot and 24.7% with three demonstrations against a 20.0% copy baseline, showing that a Tamil-adapted instruction model does not transfer to specialised sentence-level correction without task-specific supervision.

1 Introduction

Tamil correction must address intertwined morphology, contextual grammar, and cross-word sandhi in a low-resource setting. The work proposes end-to-end sequence-to-sequence correction with a shared progressive curriculum for two multilingual backbones.

  • Tamil’s agglutinative morphology intertwines spelling and grammatical correctness, while sandhi creates additional word-boundary transformations.The language uses 247 distinct letters and packs tense, person, gender, number, and honorific information into verb endings.
  • Existing approaches usually focus on narrow surface errors, return ranked candidates, or use transformers only as re-rankers.These limitations leave generative sentence-level correction underused.
  • Subject–verb agreement, tense consistency, and cross-word sandhi remain unreliable for existing systems at sentence level.
  • The proposed formulation fine-tunes mT5-small and mBART-50 to map noisy Tamil sentences directly to clean ones.
  • Both backbones use the same four-stage progressive schedule, separating curriculum effects from architecture effects.
  • The study trains on up to 657,720 synthetic pairs across ten error categories and evaluates top-1 exact match on a disjoint 1,000-sentence diagnostic set.

2 Previous Work

Earlier Tamil correction systems rely on rules, statistical context, edit distance, or hybrid ranking and generally cover narrower error settings. This work instead emphasizes end-to-end generation, broader error coverage, disjoint balanced evaluation, and comparison with a Tamil-adapted LLM.

  • Rule-based and statistical approaches: Earlier rule-based and statistical systems report high accuracy in restricted settings but rely on narrow context windows or assumptions about valid words.
  • Deep-learning and hybrid approaches: Hybrid systems combine edit distance, phonetic matching, rules, n-grams, embeddings, or LSTM scoring rather than directly generating corrections.
  • Multilingual transformers for seq2seq correction: Multilingual seq2seq models have been applied to Tamil correction, but prior work described here does not combine the full error coverage and curriculum used here.
  • Mayangoli-specific correction: TamilMayangoliSpell reports 93.50% exact match for one phonetic-confusion class while excluding sandhi and several other error types.
  • Tamil-adapted large language models: The study evaluates Tamil-LLaMA directly because focused spell-correction performance had not previously been measured for that Tamil-adapted model.
  • Contributions over prior work: Compared with prior Tamil-specific work, the approach combines end-to-end generation, ten error categories, verified disjoint evaluation, an identity slice, and direct LLM comparison.

3 Dataset Creation

The dataset is built by injecting controlled noise into clean Tamil Wikipedia sentences because authentic large-scale annotated error corpora are unavailable. Its staged construction covers surface, contextual, sandhi, and identity phenomena, with leakage-controlled splits and a balanced diagnostic set.

  • Large-scale annotated Tamil error corpora are unavailable, so the study constructs synthetic noisy-clean pairs from clean Tamil text.
  • After preprocessing and filtering approximately 1.2 million Tamil Wikipedia sentences, the corpus provides the clean source for noise generation.
  • The taxonomy separates surface errors from contextual errors, while treating sandhi as a distinct word-boundary phenomenon.
  • The first two phases generate 500,000 surface pairs and 75,000 contextual pairs using weighted perturbations, corpus mining, and templates.
  • The sandhi datasets contain 30,000 single-site pairs for v4 and 40,000 multi-site pairs for v5, including sentences with up to three removed sites.
  • The v3 composition yields 657,720 effective training pairs, and each stage uses a hashed 70/20/10 split to prevent noisy variants from crossing partitions.
  • The balanced diagnostic set contains 1,000 sentences across ten categories and is checked against training data using exact-match hashes and 5-gram overlap.
  • The 200 identity items make the unchanged-input copy baseline exactly 20.0% by construction.

4 Proposed Work

The proposed system fine-tunes mT5-small and mBART-50 through progressive stages that add surface, contextual, and sandhi capabilities while replaying earlier data. Inference produces one correction through a single forward pass.

  • The system applies one four-stage progressive pipeline to two multilingual seq2seq architectures, enabling curriculum and architecture effects to be compared.
  • Backbones: mT5-small receives a correction instruction and generates the corrected Tamil sentence from the noisy input.
  • Backbones: mBART-50 uses Tamil language-ID tokens and a denoising pretraining objective suited to monolingual corrupted-to-clean transformations.
  • Progressive schedule: v2 establishes surface correction, while v3 adds contextual augmentation and replay to limit forgetting, reaching 657,720 training pairs.
  • Progressive schedule: v4 adds single-site vallinam sandhi examples with replay, whereas v5 adds sentences containing one to three sandhi sites.
  • Inference: At inference, beam search and generation controls produce one correction per sentence in a single forward pass.
  • Inference: Single-pass generation provides one deterministic output suitable for real-time use, but can also alter words that did not require correction.

5 Results and Discussion

The balanced diagnostic evaluation shows that progressive supervision enables contextual agreement and cross-word sandhi, while increasing sandhi recall creates an identity-accuracy trade-off. mBART-50 v5 achieves the strongest overall and sandhi results, but deployment must choose between correction recall and restraint.

  • Headline comparison: 69.3% top-1 exact-match accuracy makes mBART-50 v5 the strongest overall model, 6.2 percentage points ahead of mT5-small v5.Evaluation uses sentence-level exact match on the 1,000-sentence balanced diagnostic set.
  • What each stage contributes: 52.5% subject–verb accuracy at v3 rises from 1.0% at v2 after contextual augmentation, without changing the architecture.The increase reflects introducing agreement supervision rather than merely adding more surface-noise pairs.
  • The sandhi–identity trade-off: Sandhi accuracy rises as identity accuracy falls monotonically, with mBART-50 v5 reaching 87.5% sandhi and 74.0% identity.Failures commonly apply preferred suffixed forms to sentences labelled correct under a convention allowing optional sandhi.
  • Deployment implications: For deployment, v5 suits suggestion-based writing assistance, whereas v3 better suits silent auto-correction because it avoids sandhi-driven edits to correct sentences.The appropriate stage depends on whether recall or restraint is more important.
  • Per-category analysis: The phonetic-confusion category reaches 69.5% with mBART-50 v5, while subject–verb agreement is higher for mT5 v3 at 52.5% than for mBART-50 v5 at 43.5%.Pulli omission remains comparatively stable, peaking at 72.0% for mBART-50 v5.
  • Prompted baseline: Tamil-LLaMA reaches 19.0% zero-shot and 24.7% with three demonstrations against a 20.0% copy baseline, far below mBART-50 v5.Few-shot prompting improves identity accuracy but increases uncorrected errors, indicating restraint rather than specialised correction skill.

6 Conclusion

The paper presents an end-to-end Tamil spell and grammar correction system using progressively fine-tuned multilingual sequence-to-sequence transformers. Its best model achieves strong sandhi performance, while future work targets remaining coverage, data, and deployment limitations.

  • Conclusion: The system fine-tunes multilingual sequence-to-sequence transformers end to end rather than using transformers only as candidate re-rankers.
  • Conclusion: mBART-50 v5 reaches 69.3% top-1 exact-match accuracy on a balanced 1,000-sentence diagnostic set verified disjoint from training data.The model achieves 87.5% on cross-word sandhi and 43.5% on subject–verb agreement.
  • Conclusion: The four-stage progressive schedule makes subject–verb agreement learnable, raising accuracy from 1.0% to 52.5% with contextual supervision.
  • Conclusion: Tamil-LLaMA-7B-Instruct trails mBART-50 v5 by 44.6 points, indicating that task-specific supervision remains necessary for this correction problem.
  • Future scope: Future work includes broader sandhi contexts, genre-balanced and authentic-error data, native-speaker adjudication, and confidence thresholds for deployment.

Limitations

The reported sandhi results cover only part of the phenomenon. Failures cluster in difficult syntactic patterns, while rarer phenomena such as nasal assimilation are absent from the evaluation.

  • Partial sandhi coverage: Sandhi failures cluster in specific syntactic patterns, especially dative-marked nouns followed by certain verbs.
  • Partial sandhi coverage: The multi-site generator undersamples these difficult patterns relative to their difficulty.
  • Partial sandhi coverage: 87.5% sandhi accuracy covers vallinam sites alone because rarer phenomena such as nasal assimilation are absent entirely.
Loading 2609.03273v1…