arXiv:2609.03273cs.CLSep 2026

Manuscript Offprint

arXiv:2609.03273

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

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Abstract

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 is one of the oldest classical languages in the world, spoken by over 75 million people, with a literary tradition spanning more than 2,000 years. It uses 12 vowels (uyir ezhuthukal), 18 consonants (mei ezhuthukal), and 216 compound characters (uyirmei ezhuthukal) — a total of 247 distinct letters. Its agglutinative morphology packs tense, person, gender, number and honorific information into single verb endings, which means that spelling and grammatical correctness are deeply intertwined and context-dependent.

While spell correction has been studied extensively for English and Hindi, Tamil has received comparatively limited attention. In English, errors are largely surface-level and can be corrected by edit-distance models trained on large datasets. In Tamil, errors extend far beyond character-level mistakes. The words லுஞுல ("fruit") and லுஞுல ("strength") differ by one letter but mean entirely different things. Tamil also follows strict sandhi rules: the phrase அு஠ு஠ ஞகா஠஠஠ (஠஠஠) should be written அு஠ு஠க ஞகா஠஠஠ ஠஠஠, with the consonant ஂ஠ inserted because of the vallinam-triggered transformation. The agglutinative nature of Tamil and the low-resource setting together make Tamil spell correction substantially harder than for high-resource languages.

Existing Tamil spell-correction approaches struggle along three dimensions. First, they typically address only a narrow set of error types (usually surface-level phonetic substitution) and ignore contextual errors. Second, they often produce a ranked list of candidates rather than a single correction, which is unsuitable for real-time applications. Third, recent hybrid work that combines transformer re-ranking with statistical retrieval treats the transformer only as a scoring function, leaving its generative capacity unused.

None of these approaches reliably handles subject-verb agreement, tense consistency or cross-word sandhi at the sentence level.

To address these challenges, this work:

  1. an end-to-end sequence-to-sequence formulation that fine-tunes mT5-small and mBART-50 to map noisy Tamil sentences directly to clean ones, rather than using transformers as candidate re-rankers;

  2. the same four-stage progressive schedule (v2 → v5) applied to both backbones, separating the contribution of curriculum from that of architecture;

  3. a noise-generation pipeline producing 657,720 training pairs over ten error categories, including corpus-mined agreement errors and multi-site cross-word sandhi violations, with a 70/20/10 split per stage;

  4. evaluation on a 1,000-sentence balanced diagnostic set verified disjoint from training data, reporting top-1 exact-match accuracy rather than the top-k accuracy used in prior context-blind work; and

  5. a controlled comparison against Tamil-LLaMA (Balachandran, 2023) under prompt selection, and against a trivial copy baseline that establishes the floor.

Figure 1 gives the overall picture: dataset construction, progressive fine-tuning, and single-pass inference.