End-to-End OCR Multimodal LLMs: How a Small Parameter Count Still Delivers High-Accuracy Document Parsing

    This article breaks down the end-to-end approach to document parsing with multimodal large models, where a single vision-language model (VLM) handles layout understanding and content reconstruction in one pass instead of chaining specialized models. It covers why the pipeline approach accumulates errors, how a decoupled coarse-to-fine architecture separates structure from content, and why systematic data engineering has become the real competitive moat, with evaluation scores rising from roughly 93 to above 95 without any change in model architecture or parameter count. Readers will also find practical guidance on training strategy, inference optimization for a 1.2B-class model, a multi-dimensional evaluation framework, and common pitfalls when moving such a system into production.

    End-to-End OCR with Multimodal LLMs: How a Small Parameter Count Delivers High-Accuracy Document Parsing

    Document intelligence has long relied on a multi-model pipeline: layout detection, reading-order prediction, text-line recognition, formula recognition, and table recognition are each handled by a dedicated model and then stitched together with rules. This design produces a long engineering chain, accumulates error stage by stage, and leaves each module with its own incompatible annotation scheme. As multimodal large models have matured, the field has begun exploring a single vision-language model (VLM) that covers the entire flow from layout understanding to content reconstruction, an approach known as end-to-end document parsing. This article reviews that direction systematically, from architecture design to data engineering and deployment practice.

    1. Why End-to-End Document Parsing Is Worth the Investment

    The core weakness of the pipeline approach is error propagation caused by divide-and-conquer. A slightly misaligned layout box means the downstream recognition module receives a cropped, incomplete input; an incorrect reading order scrambles the semantic structure of the whole page; and structured content such as formulas and tables loses spatial relationships as it is passed between serial modules.

    End-to-end parsing offers three advantages:

    1. Global context modeling: the model sees the entire page, or even the entire document, so the spatial relationships of mixed text and images are preserved naturally, avoiding the semantic fragmentation caused by block-by-block processing.
    2. No stage-by-stage error amplification: all subtasks are completed jointly inside one model with a unified output format, which makes the parsing result far more internally consistent.
    3. Lower engineering complexity: only one model service needs to be maintained, which simplifies deployment, monitoring, and version iteration.

    The end-to-end route also has inherent challenges. For a small-parameter model to match or exceed a large general-purpose model across open layouts, multiple languages, and complex tables, it has to be improved on both the architecture side and the data side. Some recent public work, such as an end-to-end document parsing model at the 1.2B parameter scale, already leads on comprehensive document parsing benchmarks, and its approach is well worth studying.

    2. Core Architecture: Decoupled Coarse-to-Fine

    One architecture that has proven effective is decoupled coarse-to-fine: document parsing is split into two cooperating stages of different granularity, while a single model still produces the output end to end.

    2.1 Coarse Stage: Global Layout Understanding

    The goal of the coarse stage is to give the model a structured understanding of the full page image, including:

    • Layout region segmentation: identifying regions such as titles, body text, figures, tables, headers, and footers, together with their boundaries;
    • Reading-order modeling: determining the logical sequence between regions, including complex cases such as multi-column and cross-page layouts;
    • Cross-modal alignment: linking visual regions to the generated content so that subsequent output stays in the correct position.

    This stage effectively builds the page’s “skeleton” in feature space and provides a stable structural prior for fine-grained generation.

    2.2 Fine Stage: Content Reconstruction

    The fine stage generates content region by region within that skeleton, covering:

    • Text recognition: multiple languages and low-quality scans;
    • Formula recognition: editable representations such as LaTeX;
    • Table structure reconstruction: structured formats such as HTML or Markdown, restoring merged cells and cross-row/cross-column relationships;
    • Chart understanding (supported by some approaches): converting chart content into a structured description.

    2.3 Why Decoupling Matters

    Decoupling means structural understanding and content generation are separated in representation and cooperate at inference time. The benefits are:

    • Clearer training signals: layout supervision and content supervision do not interfere with each other, so a small model learns stable patterns more easily;
    • More controllable inference: structural errors from the coarse stage can be partially corrected by the fine stage, and vice versa;
    • Easier data augmentation: different intensity levels and mixing ratios can be designed for each granularity.

    Practical recommendation: when building your own model, make the coarse-stage output an explicit structural markup (for example, a sequence of region types and coordinates) and have the fine stage generate content under that constraint. This combination of structured prompting and constrained generation noticeably reduces hallucination and serial misalignment.

    3. Data Engineering: The Real Moat

    Public progress shows that with model architecture and parameter count completely unchanged, systematic data engineering alone can raise the comprehensive evaluation score from about 93 to above 95. The competitive core of end-to-end document parsing has therefore shifted from architectural novelty to building a data system. The key stages are below.

    3.1 Data Sources and Collection

    High-quality training data usually comes from four sources:

    1. Real documents: papers, textbooks, financial reports, invoices, ID documents, ancient books, and more, covering different layouts and languages;
    2. Synthetic documents: generated by a typesetting engine with controllable parameters (column count, font size, noise, rotation, perspective distortion), which come with perfect labels by construction;
    3. Web-crawled data: web pages, e-books, and similar sources that require strict cleaning and deduplication;
    4. Model-assisted annotation: pre-labeling with an existing model plus human refinement to cut annotation cost, with the noise ratio kept under control.

    3.2 Cleaning and Quality Control

    Data quality sets the ceiling. A multi-layer quality gate is recommended:

    • Deduplication: combine image perceptual hashing with text similarity so that a few templates cannot dominate the training distribution;
    • Filtering: remove unreadable blurry samples, samples where content and labels are misaligned, and samples with mixed languages that cannot be learned;
    • Stratified sampling review: manually spot-check by source, language, and document type, and continuously recalibrate automatic filter thresholds;
    • Difficulty balance: ensure hard cases (complex tables, handwritten formulas, two-column ancient books) make up a sufficient share so the model does not overfit on easy samples.

    3.3 Difficulty-Aware Mixing Strategy

    A fixed mixing ratio often lets easy samples drown out hard ones. A dynamic curriculum is a workable reference:

    1. Early training: standard layouts and clean scans to build baseline capability
    2. Mid training: gradually increase the share of complex tables, multi-column, cross-page, and low-quality scans
    3. Late training: target the categories with the highest error rate for focused supplementation and retraining

    Error analysis on the evaluation set should drive the data loop: periodically generate an error report on the validation set, attribute errors by type (wrong table structure, wrong formula symbols, wrong order, missed recognition), and then add data in a targeted way. This evaluation-driven data cycle is what allows a small model to keep gaining points.

    3.4 Annotation Standards and a Unified Output Format

    An end-to-end model needs a unified output protocol, otherwise supervision signals conflict with each other. Recommended practice:

    • Define a single Markdown/HTML superset covering heading levels, formulas, tables, figure captions, and reading order;
    • Use one consistent representation for merged table cells and one consistent LaTeX dialect for formulas;
    • Normalize region boundaries consistently, for example as per-mille values relative to page width and height.

    4. Training and Inference Practice

    4.1 Training Strategy

    • Multi-stage training: start with large-scale general document pretraining (image-text alignment plus text recognition), then apply instruction tuning for structured output, and finally polish with high-quality fine-grained annotations;
    • Resolution and aspect ratio: document images vary enormously in aspect ratio, so dynamic resolution and tiled position encoding are critical for preserving layout geometry;
    • Loss design: structural markup and content tokens can use differentiated loss weights to strengthen learning of the layout skeleton.

    4.2 Inference Optimization

    A 1.2B-class model has natural deployment advantages, but the following still matter:

    • Batching and throughput: multi-page PDF parsing suits batch submission, and continuous batching improves GPU utilization;
    • Precision quantization: use lower-precision inference (such as FP16 or INT8) where the accuracy loss is acceptable, reducing memory footprint and cost;
    • Output post-processing: validate the generated format (for example, HTML tag closure in tables and formula syntax), and trigger a retry on failure;
    • Service orchestration: combine object storage for raw files and parsing results, a message queue to decouple tasks asynchronously, and logging and monitoring services to track failure rate and latency, forming a complete production chain.

    A schematic service call flow:

    1. # Pseudocode: typical usage of a document parsing service
    2. def parse_document(doc_uri: str) -> dict:
    3. image_pages = download_and_render(doc_uri) # render pages to images
    4. results = [model.generate(page, prompt=STRUCT_PROMPT)
    5. for page in image_pages] # end-to-end parsing
    6. merged = merge_pages(results) # merge across pages
    7. validate(merged) # format validation
    8. return merged

    5. Evaluation Framework and Results Analysis

    Evaluating end-to-end document parsing should cover several dimensions rather than a single aggregate score:

    • Text metrics: character-level and word-level accuracy, edit distance;
    • Structure metrics: layout region F1, reading-order accuracy;
    • Table metrics: cell matching rate, structural similarity (TEDS and similar);
    • Formula metrics: exact and normalized LaTeX matching;
    • End-to-end metrics: overall Markdown similarity, cross-page document consistency.

    It is also worth maintaining two test sets, one of clean scans and one of real-world noise (photographs, shadows, creases): the former measures the upper bound, the latter measures engineering usability. On the public benchmark side, comprehensive document parsing evaluation sets are already available for reference, and a self-built system should keep running regressions on comparable multi-dimensional benchmarks.

    6. Deployment Advice and Common Pitfalls

    1. Do not worship parameter count: a small model plus strong data engineering can beat a large general-purpose model, provided the data loop is solid;
    2. Unify the output protocol before training: changing the format midway forces large-scale rework of earlier data;
    3. Keep the pipeline as a fallback: for extreme layouts or very long documents, a hybrid strategy with the end-to-end model as primary and traditional modules as backup works well;
    4. Invest in error analysis tooling: without explainable error attribution, adding data is guesswork;
    5. Keep evaluation and training sets strictly separated: split by document source rather than by page to prevent same-source leakage.

    7. Summary

    End-to-end OCR multimodal LLMs are changing the technical paradigm of document intelligence: a vision-language model serves as the unified backbone, a decoupled coarse-to-fine architecture keeps structure and content working together, and systematic data engineering keeps pushing against the ceiling of data quality. The 1.2B-parameter results show that combining careful architectural design with disciplined data-loop operations can lead on comprehensive document parsing evaluations while keeping deployment costs low. For teams building document intelligence systems, mastering the engineering methodology across three threads, architecture, data, and deployment, has more long-term value than chasing a single model metric.