Source-linked AI summary

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

Wenjie Liao, Xiaohui Song, Liangjie Zhao, Haonan Lu

arXiv:2610.11148v1cs.CVcs.AI

TL;DR

Page transcription remains difficult for vision-language models, and full-sequence SFT does not select positions based on residual generated-reading errors. SP-DocReader uses iterative self-play to target those discrepancies with relative scoring and direct supervision. Compared with two-epoch SFT, three self-play rounds reduce Vary-600K CER on both evaluated backbones.

  • Problem

    Page transcription must reproduce document text, including small characters and numbers, and full-sequence SFT does not select positions using discrepancies in generated readings.

    Source: §1 · p. 1
  • Method

    SP-DocReader iteratively uses generated-reading discrepancies to select unmatched tokens for relative scoring and direct supervision, while training only the OCR module.

    Source: §1 · p. 2, §3.2 · p. 4
  • Results

    Compared with two-epoch supervised fine-tuning, three self-play rounds reduce Vary-600K CER from 2.40 to 1.11 on Qwen3-VL-4B and from 2.12 to 1.17 on InternVL-3.5-4B.

    Source: §5 · p. 11
  • Takeaways & Limitations

    The results support focusing self-play on reading discrepancies for transcription across the evaluated document datasets and in the tested fewer-reference-page budget comparison.

    Source: §1 · p. 1, §5 · p. 11

    The study covers single-page transcription, English and Chinese training pages, and two vision-language backbones; it does not establish generalization to other languages or model families.

    Source: Limitations · p. 11

Abstract

from arXiv · show

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 transcription requires reproducing document text, including small characters and numbers, rather than answering a short document question. SP-DocReader focuses self-play training on errors remaining after supervised fine-tuning, and reduces transcription error on both evaluated backbones.

1. Introduction

  • Page transcription must reproduce document text, including small characters and numbers, unlike producing a short answer to a document question.The paper situates this challenge amid document images and infographics with dense text and varied layouts.Source: §1 · p. 1
  • Higher resolution can improve small-text reading while increasing visual tokens, and prior approaches also use image tiles, pooling, OCR text, layout-preserving prompts, or compressed OCR and layout.This study focuses on reduced-resolution page transcription and distinguishes source resolution from the visual tokens passed to the language model.Source: §1 · p. 1
  • Unlike full-sequence SFT, which supervises every target position, SP-DocReader uses generated-reading discrepancies to select tokens that still need correction.The reader is first adapted by supervised fine-tuning on annotated pages.Source: §1 · p. 1
  • Reading Discrepancy Masking aligns reference and generated model-token sequences through a longest common subsequence and selects their unmatched positions.The selected positions are scored with their full conditioning prefixes; Focused Fidelity Loss adds direct negative log-likelihood supervision at unmatched ground-truth positions, while the visual encoder and language backbone remain frozen.Source: §1 · pp. 1–2
  • Compared with SFT-2, SP-DocReader reduces transcription error on both backbones and improves most evaluated question-answering scores.On Qwen3-VL-4B, gains also extend from in-distribution reading to zero-shot document benchmarks.Source: §1 · p. 2
  • SP-DocReader combines masked relative scoring at discrepancy positions with direct supervision on unmatched ground-truth tokens.The paper also derives the combined gradient and evaluates bilingual transcription, zero-shot benchmarks, components, resolution robustness, and training cost.Source: §1 · p. 2

2. Related Work

Related work spans modular document readers, specialized OCR and parsing systems, and supervised or self-play fine-tuning. SP-DocReader builds on a modular reader and focuses training on mismatches between known transcriptions and generated readings.

Efficient Document Reading with VLMs

  • DocVLM compresses OCR text and layout into learnable queries for a frozen vision-language model, and SP-DocReader builds on this modular reader for discrepancy-focused page-transcription training.Other document-reader designs combine image features, recognized text, and layout in different ways.Source: §2 · p. 2

Specialized OCR Systems for Document Recognition

  • Specialized systems emphasize recognition and parsing designs, including text detection and recognition, scientific-document markup, formatted OCR, layout analysis, or optical compression of text.SP-DocReader instead focuses on discrepancy-based training of a modular reader.Source: §2 · p. 2

Supervised and Self-Play Fine-Tuning

  • For document recognition, supervised fine-tuning uses paired images and transcriptions, while SP-DocReader uses generated readings to select self-play training positions.The method locates unmatched model-token positions in reference and generated readings, compares them, and directly supervises unmatched reference tokens while retaining their original prefixes.Source: §2 · pp. 2–3
  • SPIN pairs demonstrations with previous-model responses and optimizes a full-response relative score, while SPACE, SPPO, and DNO use other preference or iterative-alignment objectives.SP-DocReader uses known page transcriptions to locate unmatched positions rather than comparing only full responses.Source: §2 · pp. 2–3

3. Methodology

SP-DocReader adapts a modular document reader for page transcription and trains it through iterative self-play on reference-versus-generated reading discrepancies. Its objective combines opponent-relative scoring with direct supervision on unmatched reference tokens, while retaining their original sequence context.

3. Methodology

  • The objective combines Reading Discrepancy Loss, which scores discrepancies, with Focused Fidelity Loss, which directly supervises unmatched ground-truth positions.Both losses score tokens using their original prefixes.Source: §3 · p. 3

3.1. Problem Formulation and Document Reading

  • Page transcription is modeled as conditional sequence generation from a document image and instruction, with a reference token sequence that transcribes the page.The modular reader uses a visual encoder and an OCR branch that encodes extracted text and layout into compact representations; the visual encoder and language backbone remain frozen.Source: §3.1 · pp. 3–4

3.2. Iterative Self-Play Training

  • Each self-play round fixes an SFT-initialized opponent to generate a reading, then updates the main player using the reference and synthetic reading.RDM aligns their model-token sequences through an LCS and selects unmatched positions; matched tokens remain in the conditioning prefixes, and selected tokens are scored in their original sequences.Source: §3.2 · p. 4
  • Reading Discrepancy Loss compares current-versus-opponent score changes for reference and generated readings at selected positions, favoring a larger relative improvement for the reference discrepancies.The scoring uses the same full sequence and position set for the current model and opponent, with each token conditioned on its own reading’s full prefix.Source: §3.2 · pp. 4–5
  • Focused Fidelity Loss adds direct negative log-likelihood supervision at unmatched ground-truth positions, and the total objective adds it to the masked contrastive loss with weight λ.This direct term addresses the possibility that the relative objective decreases by lowering the synthetic score without raising the ground-truth score; refreshed models become the next opponents and generate new readings and masks.Source: §3.2 · pp. 5–6

3.3. Optimization Analysis

  • The two losses play complementary roles: relative scoring compares improvement over the opponent, while direct supervision raises the reference score without relying only on penalizing generated readings.Figure 2 reports that the refreshed checkpoint scores higher than the fifth fixed-reading epoch in every panel.Source: §3.3 · p. 6, Figure 2 · p. 7

4. Experiments

Experiments evaluate SP-DocReader against supervised fine-tuning across two backbones, transcription and question-answering benchmarks, training budgets, resolutions, and adaptation variants. Results show lower transcription error, gains on additional benchmarks and limited-page settings, and qualitative corrections in prose and mathematical notation.

4.1. Experimental Setup

  • The evaluation uses balanced English and Chinese training pages, two supervised epochs followed by self-play, and reduced-resolution inputs; only OCR components are updated while the visual encoder and language backbone remain frozen.The benchmarks include Vary-600K, DocBank, IIT-CDIP, DocVQA, and InfographicVQA; zero-shot means no target-benchmark adaptation during the described training stages.Source: §4.1 · pp. 7–8

4.2. Main Results

  • Vary-600K CER falls from 2.40 to 1.11 on Qwen3-VL-4B and from 2.12 to 1.17 on InternVL-3.5-4B; SP-DR-3 also improves all three additional benchmark aggregates on both backbones.On Qwen3-VL-4B, DocBank and IIT-CDIP CER decrease by 1.90 and 2.29 percentage points, while DocVQA and InfographicVQA ANLS increase by 3.67 and 3.60 points.Source: §4.2 · pp. 8–9, Table 2 · p. 9
  • Refreshing the opponent, generated readings, and masks reaches an average near 90.3 after two local epochs, versus near 89.8 after five epochs with fixed readings.Each plotted metric also favors the refreshed checkpoint over the fifth fixed-reading epoch.Source: §4.2 · p. 9

4.3. Ablation Study

  • The full objective gives the best score in every component-analysis column; modular tuning uses 0.5B trainable parameters and has the highest DocVQA ANLS among compared architectures.Modular tuning does not have the lowest CER on every dataset: full tuning has lower Vary-600K CER, while modular tuning has lower DocBank and IIT-CDIP CER.Source: §4.3 · pp. 9–10, Table 4 · p. 10, Table 3
  • At 30k pages, SP-DocReader reaches an AVG of 82.46, exceeding SFT’s 80.73 with 120k pages.The AVG equally weights three reading datasets and two question-answering datasets, including Vary-600K and zero-shot benchmarks.Source: Figure 3 · p. 8, §4.3 · p. 9
  • Across four tested resolutions from 48 to 150 DPI, SP-DocReader has lower Vary-600K CER than SFT.At 48 DPI, CER is 3.41 for SFT and 1.74 for SP-DocReader; at 150 DPI, it is 1.52 and 0.71, respectively.Source: Figure 3 · p. 8, §4.3 · p. 10

4.4. Cost Analysis

  • At the third self-play round, modular tuning reaches a zero-shot AVG of 79.58 at relative training cost 0.33, compared with 74.98 at cost 1.58 for full tuning.The reported inference overhead is about ten percent relative to the backbone without OCR.Source: Figure 3 · p. 8, §4.4 · p. 10

4.5. Qualitative Results

  • On two low-resolution documents, SP-DocReader restores a misread repeal year and wording, and more accurately transcribes a dimension formula and theorem number.The examples illustrate recognition of both prose and mathematical notation.Source: §4.5 · pp. 10–11, Figure 4 · p. 11

5. Conclusion

SP-DocReader trains a modular reader on discrepancies between generated readings and references, updating only the OCR branch while freezing the visual encoder and language backbone. Three self-play rounds improve transcription and question-answering results over two-epoch SFT in the reported comparisons.

5. Conclusion

  • Reading Discrepancy Masking selects unmatched model-token positions while preserving their original context, and Focused Fidelity Loss directly supervises unmatched reference tokens.The method updates the OCR branch while the visual encoder and language backbone remain frozen.Source: §5 · p. 11
  • Vary-600K CER falls from 2.40 to 1.11 on Qwen3-VL-4B and from 2.12 to 1.17 on InternVL-3.5-4B; Qwen3-VL-4B DocBank and IIT-CDIP CER fall by 1.90 and 2.29 points.On Qwen3-VL-4B, DocVQA and InfographicVQA ANLS rise by 3.67 and 3.60 points, respectively.Source: §5 · p. 11
  • At a 30k-page budget, SP-DocReader reaches a five-task AVG of 82.46, compared with 80.73 for SFT using 120k pages.The comparison supports strong performance with fewer reference pages in the tested budget comparison.Source: §5 · p. 11
  • The full objective outperforms either reduced-loss variant in the component analysis.Source: §5 · p. 11

Limitations

The evaluation is limited to single-page transcription, English and Chinese training pages, and two vision-language backbones; results do not establish generalization beyond those languages or model families.

Limitations

  • SP-DocReader targets single-page transcription, not multi-page reading or structured extraction.Source: Limitations · p. 11
  • A fixed generation budget may limit coverage of longer pages.Source: Limitations · p. 11
  • Experiments use English and Chinese training pages and two vision-language backbones, so generalization to other languages or model families is not established.Source: Limitations · p. 11

Ethical Considerations

The paper cautions that document transcription can expose sensitive information and that data and model reuse must respect permissions. Its additional related work spans vision-language document reading, adversarial learning, iterative self-improvement, instruction tuning, and forgetting.

Ethical Considerations

  • Document transcription may expose personal or confidential information; consequential outputs should be checked against source documents, and reuse must follow applicable licenses and permissions.Source: Ethical Considerations · pp. 11–12

A. Additional Related Work

B. Supporting Derivations

The supporting derivations express the per-pair objective and its combined gradient for reference and generated readings. They also delimit what the derivation establishes about variance, computation, and cost.

B. Supporting Derivations

  • The combined gradient weights the reference-score gradient by the logistic comparison term plus direct supervision, while the generated-reading score receives the opposing comparison contribution.The per-pair objective uses a logistic relative-score term and subtracts λ times the reference score.Source: B. Supporting Derivations · p. 17
  • Both score gradients retain the full original prefixes and sum over selected positions, including pairs with empty masks.Source: B. Supporting Derivations · p. 17
  • Across training examples, gradient variance depends on both weighted score contributions and their covariance; selected-position counts alone do not determine it.The derivation assumes neither independence nor equal token-contribution variance and gives no variance bound relative to full-sequence training.Source: B. Supporting Derivations · p. 18
  • Loss masking does not save dense vocabulary-projection work if logits were already computed at every position; reducing that work requires skipping excluded projections.Selected losses may still depend on preceding hidden states, and frozen-backbone derivatives are needed to update the OCR branch.Source: B. Supporting Derivations · p. 18
  • A complete adaptation-cost comparison must include preprocessing, supervised initialization, generation, alignment, scoring, and optimization across required rounds.Single-step or single-round accounting is incomplete; runtime and memory claims require measurements with a stated scope.Source: B. Supporting Derivations · p. 18

C. Implementation Details

The implementation keeps the visual encoder and language backbone frozen while training an OCR module, and specifies controlled input, alignment, evaluation, and comparison protocols.

C. Implementation Details

  • The OCR encoder interleaves projected bounding-box and OCR-text embeddings, compresses its outputs into queries, and projects them to the frozen VLM.The design replaces additive text-spatial fusion and omits DocFormerV2’s visual branch and decoder.Source: C. Implementation Details · p. 18
  • Training uses two supervised epochs followed by up to five self-play rounds, with SP-DR-3 as the default model; the Vary-600K subset has 30,000 English and 30,000 Chinese pages.The default Focused Fidelity Loss weight is 0.5; AdamW uses a cosine schedule and ten-percent warmup.Source: C. Implementation Details · p. 18
  • The 15k, 30k, and 60k data-efficiency variants each train only on their own nested, language-balanced page subset, without inheriting a larger-budget checkpoint.Each budget starts from the same pre-task initialization and completes its own two-epoch supervised stage.Source: C. Implementation Details · pp. 18–19
  • Self-play generates one greedy reading per page, capped at 1,024 new tokens, while retaining complete references and prefixes and avoiding silent truncation.Unmatched positions come from deterministic LCS alignment; ties skip the generated token, and matched EOS tokens are masked.Source: C. Implementation Details · pp. 19, 21
  • Transcription scoring normalizes Unicode and whitespace but preserves case, punctuation, and order; CER uses corpus character edits, while normalized edit similarity is averaged over pages.Auxiliary WER, Token-F1, ROUGE-L, and BLEU-4 use a fixed SacreBLEU zh tokenizer.Source: C. Implementation Details · p. 19
  • Both branches receive the same reduced-resolution page, while image budgets, OCR query counts, and encoder-capacity checks are fixed or recorded across settings.Resolution checks use fixed SFT-2 and SP-DR-3 checkpoints; OCR outputs are recomputed and shared between methods.Source: C. Implementation Details · pp. 19–20
  • Component variants retain LCS masks and use two epochs per round; controls compare continued SFT and all-position contrastive scoring against discrepancy-focused self-play.The refresh comparison jointly changes the opponent and training records, and uses matched updates but includes generation, alignment, and scoring in computation.Source: C. Implementation Details · p. 20
  • Cost accounting includes OCR, training, generation, alignment, scoring, and I/O; online inference latency includes page processing, external OCR, encoding, and generation.Normalized training cost uses the complete joint-tuning SFT-2 run as denominator; startup is recorded separately for inference.Source: C. Implementation Details · p. 21

D. Benchmarks and Data Sources

The evaluation spans in-distribution transcription, zero-shot document reading, and document question answering, with dataset-specific metrics and audited data splits.

D. Benchmarks and Data Sources

  • The benchmarks cover Vary-600K transcription, zero-shot academic-page and scanned-document reading, DocVQA and InfographicVQA, plus three broader document benchmarks.The paper reports NED for DocBank and IIT-CDIP, ANLS for the VQA tasks, Text Edit Distance for OmniDocBench, and task-specific metrics for OCRBench v2 and CC-OCR.Source: D. Benchmarks and Data Sources · p. 22
  • The evaluation fixes dataset revisions and references, separates development and final evaluation from training where provenance permits, and verifies IIT-CDIP transcription references.It uses no task demonstrations at inference and keeps target-benchmark data out of training and model selection.Source: D. Benchmarks and Data Sources · pp. 22–23
  • Table 6 reports full zero-shot trajectories on DocBank, IIT-CDIP, DocVQA, and InfographicVQA, with AVG combining their two NED and two ANLS scores.The aggregate is on a 0–100 scale; each cell gives change over the previous row, with SP-DR-1 measured against SFT-2.Source: Table 6 · p. 23

E. Full Iteration Trajectories

The reported trajectories are not uniformly monotonic, and the paper fixes the third-round endpoint and distinguishes aggregate scores by evaluation scope.

E. Full Iteration Trajectories

  • Qwen3-VL-4B’s Vary-600K NED changes from 0.988 at SP-DR-2 to 0.987 at SP-DR-3, illustrating that improvements are not monotonic across all metrics.The main comparison uses the third-round endpoint rather than selecting a different round for each metric.Source: E. Full Iteration Trajectories · p. 23
  • The five-task mean includes in-distribution Vary-600K, whereas Figure 3(c)’s four-task mean covers zero-shot tasks; these averages should not be compared directly.Figure 2 combines Vary-600K NED, DocBank NED, and DocVQA ANLS; Figure 3(a) uses a five-task mean.Source: E. Full Iteration Trajectories · pp. 23–24
  • AVG values and changes are displayed to two decimal places, so subtracting displayed averages can differ from the reported change by 0.01.Table 7 describes full-tuning and modular trajectories and the four-score zero-shot AVG.Source: E. Full Iteration Trajectories · p. 24, Table 7 · p. 24

F. Modality-Specific Analysis

On the evaluated zero-shot tasks, modular tuning’s four-task average rises across iterations while full tuning’s declines; case studies show both corrected words and residual reading errors.

F. Modality-Specific Analysis

  • The four-task zero-shot AVG rises from 75.89 to 79.58 with modular tuning, while full tuning changes from 75.92 to 74.98.Table 7 contrasts modular tuning, which freezes the backbone, with full tuning, which updates the backbone and OCR module.Source: F. Modality-Specific Analysis · p. 24

G. Case Study

  • The Vary-600K case studies compare supplied references with model readings and show that corrected words coexist with remaining errors.The examples include a Quicksort page and a Summa Theologica page.Source: G. Case Study · p. 24, Table 8 · p. 25, Table 9 · p. 26
  • In the Summa Theologica example, the displayed Document Reading uses effect, while SFT-2 uses affect in the corresponding sentence about bringing to effect what the whole state is striving for.Red shading marks differences from the displayed references.Source: G. Case Study · pp. 24, 27, 28
Loading 2610.11148v1…