Abstract
We explore the ability of two LLMs -- GPT-4o and Claude Sonnet 3.5 -- to transcribe historical handwritten documents in a tabular format and compare their performance to traditional OCR/HTR systems: EasyOCR, Keras, Pytesseract, and TrOCR. Considering the tabular form of the data, two types of experiments are executed: one where the images are split line by line and the other where the entire scan is used as input. Based on CER and BLEU, we demonstrate that LLMs outperform the conventional OCR/HTR methods. Moreover, we also compare the evaluated CER and BLEU scores to human evaluations to better judge the outputs of whole-scan experiments and understand influential factors for CER and BLEU. Combining judgments from all the evaluation metrics, we conclude that two-shot GPT-4o for line-by-line images and two-shot Claude Sonnet 3.5 for whole-scan images yield the transcriptions of the historical records most similar to the ground truth.
Introduction
Digitalizing historical documents is a notorious bottleneck for researchers. Traditional Optical Character Recognition (OCR) and Handwritten Text Recognition (HTR) systems typically require a complex, multi-step pipeline: image pre-processing, layout analysis/segmentation, and finally text recognition. These systems often struggle with the "noise" of history—cursive handwriting, faded ink, damaged paper, and archaic layouts—and usually require extensive manual labeling and fine-tuning to achieve usable accuracy.
This study investigates whether multimodal Large Language Models (LLMs) can provide a "one-step" solution, moving directly from a raw image to a structured transcription without the need for custom-trained pipelines.
Methodology
The researchers conducted a head-to-head comparison between two state-of-the-art LLMs (GPT-4o and Claude 3.5 Sonnet) and four traditional systems (EasyOCR, Pytesseract, KerasOCR, and TrOCR). The study utilized 1921 Belgian probation data ("Déclaration de Succession") from Nivelles, containing a mix of typed headers and handwritten French text.
Two primary input methods were explored:
- Line-by-line: Images were pre-segmented into individual rows.
- Whole-scan: The entire document page was fed to the model at once.
To optimize the LLMs, five prompting strategies were tested: simple instructions, complex contextual descriptions, one-shot/two-shot examples, and an iterative refinement process.
Performance Comparison
The results demonstrate a significant performance gap between modern LLMs and traditional OCR/HTR systems. Even without fine-tuning, zero-shot LLMs outperformed versions of TrOCR that had been fine-tuned on 50% of the dataset.
As shown in Figure 1, LLMs consistently achieved higher BLEU scores compared to traditional OCR tools, which struggled significantly with the handwritten portions of the records. Similarly, Figure 2 illustrates that LLMs maintain substantially lower Character Error Rates (CER).
Key Insights
- Few-Shot Power: "Two-shot" prompting (providing just two examples) was the most effective strategy. This is a game-changer for historians who may only have a handful of transcribed pages to use as a reference.
- Model Specialization: GPT-4o excelled at the line-by-line task, while Claude 3.5 Sonnet was superior at whole-scan transcriptions.
- Metric Mismatch: Standard metrics like CER and BLEU scores didn't always align with human judgment. For instance, Claude often skipped repetitive typed headers (lowering its score) but was much better at transcribing the unique handwritten content that humans prioritize.
Limitations and Future Work
Despite their dominance, LLMs still face hurdles. They struggle with transcribing numbers accurately, which is a major issue for quantitative historical research. Furthermore, model volatility due to API updates and the higher cost of high-end LLM APIs compared to local traditional models remain concerns. Future work will explore forcing LLMs to output data in structured formats like JSON or XML to improve reasoning and data integration.
Conclusion
Large Language Models are revolutionizing the digitization of historical archives. By moving directly from raw images to structured transcriptions with high accuracy, they offer a powerful alternative to traditional, labor-intensive HTR pipelines.
Summary updated