Evaluating In-Context Learning and Retrieval Strategies for Devanagari Post-OCR Correction
Not on the map. Why?
Abstract (arXiv)
In-context learning using Large Language Models (LLMs) offers a compelling path to training-free post-OCR correction, yet its effectiveness for Devanagari script remains entirely unexplored. We present the first systematic evaluation of LLMs (3B-32B) for post-OCR correction in Hindi and Marathi, comparing three in-context example retrieval strategies: domain-random selection, dense semantic retrieval, and our proposed CharBM25, which retrieves examples by character n-gram BM25 similarity over OCR inputs to target shared error patterns with the test sentence. Across a 20,000-sentence benchmark spanning five news domains, retrieval strategy is the decisive factor in correction quality: CharBM25 outperforms domain-random selection by 2.8-4.0pp absolute WER on Hindi and 2.9-3.8pp on Marathi, using character trigrams, which consistently outperform bigrams and unigrams. Scale dominates performance: Gemma-3-27B achieves WER reductions of 55.0% for Hindi and 33.3% for Marathi under CharBM25-5. Few-shot gains are capacity-gated: models below 8B do not reliably improve over the OCR baseline, and on Marathi the smallest models (3B) degrade more sentences than they improve. Marathi is persistently harder to correct than Hindi across all scales, reflecting its greater morphological complexity. These findings establish CharBM25 as an effective, GPU-free retrieval strategy that matches or exceeds dense retrieval at negligible computational cost, and show that combining it with a general-purpose LLM of 12B+ parameters delivers reliable, training-free Devanagari post-OCR correction without task-specific fine-tuning. Dataset: https://huggingface.co/datasets/AbhishekBhandari/Devanagari-OCR-ICL-Benchmark
Key facts. No citing papers in the map yet (data through 14 Oct 2026). Builds on 12 of its 29 references that are in the map. First posted on arXiv 18 Sep 2026.
Builds on
12 of 29 references.
References · 12
- 2021What Makes Good In-Context Examples for GPT-3?cited by 1,195
- 2021Learning To Retrieve Prompts for In-Context Learningcited by 648
- 2024Aya Model: An Instruction Finetuned Open-Access Multilingual Language Modelcited by 295
- 2022Selective Annotation Makes Language Models Better Few-Shot Learnerscited by 243
- 2023Compositional Exemplars for In-context Learningcited by 144
- 2022Augraphy: A Data Augmentation Library for Document Imagescited by 14
- 2025Multimodal LLMs for OCR, OCR Post-Correction, and Named Entity Recognition in Historical Documentscited by 12
- 2025OCR Error Post-Correction with LLMs in Historical Documents: No Free Lunchescited by 11
- 2022A Benchmark and Dataset for Post-OCR text correction in Sanskritcited by 10
- 2024Advancing Post-OCR Correction: A Comparative Study of Synthetic Datacited by 8
- 2018Upcycle Your OCR: Reusing OCRs for Post-OCR Text Correction in Romanised Sanskritcited by 7
- 2024RoundTripOCR: A Data Generation Technique for Enhancing Post-OCR Error Correction in Low-Resource Devanagari Languagescited by 3
Built on by
Not cited yet.