Manuscript Offprint

arXiv:2610.11148

SP-DocReader: Difference-Aware Self-Play for Precise Document OCR

Wenjie Liao, Xiaohui Song, Liangjie Zhao, Haonan Lu

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

Abstract

Accurate page transcription remains difficult for vision language models under limited input and training budgets. We present SP-DocReader, a self-play framework for optical character recognition (OCR) that targets residual errors after supervised fine-tuning. Reading Discrepancy Masking aligns reference and generated model tokens through a longest common subsequence, then scores unmatched positions with their full conditioning prefixes. Focused Fidelity Loss adds direct negative log-likelihood supervision at unmatched ground-truth positions. Only the OCR module is trained, while the backbone remains frozen. We derive the combined gradient to distinguish relative score optimization from direct supervision. Compared with SFT-2, SP-DR-3 reduces Vary-600K character error rate on both backbones. On Qwen3-VL-4B, it reduces character error rate by approximately 54 percent and improves DocVQA Average Normalized Levenshtein Similarity (ANLS) by 3.7 points. These results show the value of focusing self-play training on the discrepancies that remain after supervised fine-tuning.

1. Introduction

Page-level transcription must reproduce text across a document, including small characters and numbers. DocFormer and LayoutLM represent text and spatial information (Appalaraju et al., 2021; Xu et al., 2020). Document images and infographics combine dense text with varied layouts (Mathew et al., 2021, 2022). Recent vision language models (VLMs) support document understanding and multimodal reasoning (Bai et al., 2025; Chen et al., 2024a; Luo et al., 2024), but page transcription differs from producing a short answer to a document question.

Higher resolution can improve small-text reading while increasing visual tokens, as in PaliGemma (Beyer et al., 2024). InternLM-XComposer-2.5 uses image tiles (Zhang et al., 2024), while LLaVA-OneVision combines AnyRes processing with pooling to control token budgets (Li et al., 2024). ScreenAI studies optical character recognition (OCR) text as an additional input (Baechler et al., 2024), and LATIN-Prompt preserves layout through spaces and line breaks (Wang et al., 2023a). DocVLM compresses OCR text and layout into queries for a frozen VLM (Nacson et al., 2025). We study reduced-resolution page transcription, distinguishing source resolution from the visual tokens passed to the language model.

Our study starts from a reader adapted by supervised fine-tuning (SFT) on annotated pages. Full-sequence SFT supervises every target position without selecting positions from discrepancies in a generated reading. SP-DocReader uses these discrepancies to focus self-play training on the tokens that still need correction.

SP-DocReader builds on DocVLM's modular reader (Nacson et al., 2025) and follows SPIN's iterative pairing of references with previous-model responses (Chen et al., 2024c). Reading Discrepancy Masking

(RDM) aligns the model-token sequences through a longest common subsequence and selects unmatched positions in both readings. The contrastive loss compares score changes against the previous model at these positions while retaining each sequence's full conditioning prefixes. Focused Fidelity Loss (FFL) adds direct negative log-likelihood supervision at unmatched ground-truth positions. Only the OCR module is updated, with the visual encoder and language backbone frozen.

Compared with SFT-2, SP-DocReader reduces transcription error on both backbones and improves most evaluated question-answering scores. On Qwen3-VL-4B, the gains extend from in-distribution reading to zero-shot document benchmarks.

We make three main contributions.

• We formulate a discrepancy-based self-play objective for page transcription that combines masked relative scoring with direct supervision at unmatched ground-truth positions.

• We derive the combined gradient to explain the roles of relative and direct supervision, and clarify why selecting loss positions still requires full-prefix computation.

• We evaluate SP-DocReader on bilingual transcription and zero-shot document benchmarks, and analyze its components, resolution robustness and training cost.

References (43)