Abstract
This study evaluates the efficacy of open-weight Large Language Models (LLMs) in post-correcting Optical Character Recognition (OCR) errors within historical English and Finnish archives. While high-parameter models like Llama-3.1-70B demonstrate significant potential for English text, achieving up to a 38.7% reduction in Character Error Rate (CER), they consistently fail to improve—and often degrade—historical Finnish text. Our findings highlight a substantial performance gap in non-English historical document processing and underscore the necessity of specialized post-processing techniques, such as overgeneration removal, to make LLM outputs viable for archival research.
Introduction
Digitizing historical archives is essential for modern humanities research, yet the process is frequently marred by imperfect OCR. Aged paper, archaic fonts, and complex layouts result in "noisy" text characterized by frequent misreadings. While re-scanning with state-of-the-art OCR engines is often cost-prohibitive for massive collections, post-correction—using AI to infer the intended text from noisy output—offers a scalable alternative. This paper investigates the performance of modern, open-weight LLMs (Llama, Gemma, Mixtral) compared to proprietary models like GPT-4o across different languages and noise levels.
Methodology
The researchers benchmarked several open-weight models against GPT-4o using a suite of technical refinements:
- Overgeneration Removal: To mitigate the tendency of LLMs to include conversational filler or hallucinations, the authors implemented character-level local sequence alignment. This mathematically "anchors" the output to the original OCR, stripping extraneous text.
- Hyperparameter Optimization: Using the Optuna library, the team identified optimal temperature,
top_k, andtop_psettings for each language. - Normalization: Historical spelling artifacts, such as the "long-s" (ſ), were normalized to prevent models from being penalized for modernizing text that remains semantically correct.
- Contextual Correction: The study explored "continuation methods" (LCC and LUC), providing models with preceding text segments to maintain narrative flow across boundaries.
Datasets
The evaluation utilized two primary corpora:
- English ECCO-TCP: Eighteenth Century Collections Online, comprising ~300,000 well-aligned pages of 18th-century British and American publications.
- Finnish NLF Ground Truth: A dataset from the National Library of Finland (1836–1918), consisting of 449 manually corrected pages.
Results and Discussion
The experimental results reveal a stark disparity between English and Finnish performance. As shown in the performance table below, while English text saw substantial improvements, open-weight models actually increased the error rate for Finnish.
The Language Gap
The failure of open-weight models on Finnish suggests a heavy English bias in "multilingual" training data, particularly regarding historical variants. Only GPT-4o achieved a positive improvement (11.9% CER reduction) for Finnish, whereas Llama-3.1-70B increased the error rate by 47%.
Technical Considerations
- Post-Processing: Without overgeneration removal, the Llama family's raw output was often unusable. Alignment techniques were critical in turning negative performance into positive gains for English.
- Scaling and Precision: Larger models (70B) significantly outperformed smaller variants (8B). Furthermore, moving from 4-bit to 16-bit precision provided a modest boost (2.5–4.7 percentage points) at the cost of significantly higher VRAM requirements.
- Segment Length: Models benefited from longer context windows (up to 300 words), which helped resolve ambiguous OCR errors through broader semantic context.
Conclusion
The "No Free Lunch" theorem applies heavily to historical OCR correction. While LLMs can significantly clean English archives, their out-of-the-box performance on lower-resource or non-English historical languages remains poor. Future work will focus on fine-tuning models specifically for historical Finnish and developing book-level correction strategies to leverage even larger contexts.
Summary updated