Fine-tuning olmOCR into a business-grade OCR engine
Key point
Shares how olmOCR was fine-tuned to extract business document headers and footers without omission, along with the results.
Details
Allen Institute's olmOCR was designed for generating LLM training data, and it has a characteristic of intentionally excluding auxiliary information such as document headers and footers. This acts as a critical limitation for business applications, such as invoices, where every piece of information in a document matters.
TNG fine-tuned the olmOCR-7B-0225-preview model to address this problem, developing an OCR engine that faithfully extracts all information.
Key techniques and methodology:
- Dataset creation: Used Qwen2.5-VL-72B-Instruct to build a high-quality dataset of 8,000 documents that includes header and footer information.
- Training environment: Trained for 2.5 epochs on an 8xH100 Nvidia node using the open-source olmOCR pipeline.
- Inference strategy: Leveraged document anchoring technique, passing both positional information of text blocks and the original text into the VLM prompt together to preserve the document's structural context.
Results: Experiments confirmed that the fine-tuned model accurately extracts key information at the top and bottom of documents that the original olmOCR had ignored. This secures a level of OCR performance applicable to real business workflows, going beyond simple training data generation.