dots.mocr-svg: Unified Document Parsing
- dots.mocr-svg is a document parsing paradigm that converts both text and graphical elements into semantically rich, structured SVG code.
- It employs a high-resolution vision encoder and an autoregressive LLM decoder to maintain geometric fidelity and coherent element grouping.
- The framework uses native SVG datasets and end-to-end training strategies to outperform traditional OCR methods in reconstructing complex document layouts.
dots.mocr-svg is a specialized document parsing paradigm within the Multimodal OCR (MOCR) framework that reconstructs both textual and graphical components of documents by generating unified, code-level outputs, with specific emphasis on faithful, structured SVG (Scalable Vector Graphics) reconstruction. Unlike classical OCR methods, which focus exclusively on text and typically discard or rasterize graphical information, dots.mocr-svg treats visual elements—including charts, diagrams, tables, and icons—as primary targets for parsing, producing SVG code that accurately encodes their geometry and structure. This approach enables end-to-end training over mixed document modalities and allows systems to maintain semantic relationships among elements during parsing, pretraining, and downstream tasks (Zheng et al., 13 Mar 2026).
1. System Architecture
The dots.mocr-svg architecture is composed of a single end-to-end vision-to-text backbone responsible for parsing documents into an interleaved token sequence comprising text and SVG elements [(Zheng et al., 13 Mar 2026), Sec. 3.1]. The principal components are:
- High-Resolution Vision Encoder: A 1.2B-parameter module capable of ingesting images up to approximately 11 million pixels, preserving fine-grained details across both text and graphics.
- Multimodal Connector: Projects pixel-level encoder features into the token embedding space used by the downstream decoder.
- Autoregressive LLM Decoder: Based on Qwen2.5 (1.5B parameters), outputs sequences of triples , where designates a semantic region and is either a text block or an SVG program.
For any detected visual region , the decoder emits SVG tokens (structurally valid SVG fragments including element types, attributes, and coordinate values), terminated by a delimiter to maintain intermodality alignment. All graphical-to-SVG mapping is performed via direct sequence modeling; there is no separate branching for graphics [(Zheng et al., 13 Mar 2026), Sec. 3.1].
2. Data Processing and Supervision
The training corpus for dots.mocr-svg is built by aggregating, cleansing, and annotating graphical and textual data from four primary sources, with a special pipeline for SVG-rich data [(Zheng et al., 13 Mar 2026), Sec. 3.5]:
- Native SVG Asset Collection: SVGs are sourced from web repositories, design libraries, scientific charting tools, and icon sets.
- Cleaning and Normalization: SVGO is used to eliminate non-essential metadata, enforce attribute and element normalization, constrain numeric precision, and remove duplications at both code (text hash) and visual (pHash) levels.
- Complexity-Aware Sampling: SVGs are stratified by token length and path complexity, with sampling balanced across “simple,” “medium,” and “complex” classes to avoid over-representation of trivial assets.
- Supervision Pair Construction: For each unique, normalized SVG, a high-resolution PNG rendering is paired with the respective SVG code, creating pixel-to-code supervised learning examples.
This data engine enables the model to learn direct mappings between document images and code-level semantically rich representations suited for both text and graphical regions.
3. Training Strategies
dots.mocr-svg employs a three-stage pipeline for model pretraining and specialization [(Zheng et al., 13 Mar 2026), Sec. 3.3]:
- Stage 1: Vision-Language Interface Generic image-captioning and masked-pixel recovery objectives are used to establish stable visual token embeddings.
- Stage 2: Text-Centric Document Parsing Large-scale document images derived from PDFs and web sources are introduced, training the model to recognize and layout text, tables, and formulas. Resolution is scaled (from 1k×1k to 4k×4k) to build robustness on dense layouts.
- Stage 3: MOCR-Specific Fine-Tuning Emphasis is progressively shifted toward document samples with embedded SVG, ultimately composing 20–30% of each minibatch from native SVG–image pairs to reinforce image-to-code alignment.
After pretraining, supervised fine-tuning (SFT) is performed on a curated, high-precision dataset, with dots.mocr-svg using a doubled weighting of SVG-rich examples and “harder” SVG-specific loss terms. Two primary model variants are released:
- dots.mocr: Balanced for general document parsing.
- dots.mocr-svg: Enhanced for SVG code emission, optimized for high-fidelity graphics parsing.
4. SVG Generation and Representation
Within the dots.mocr paradigm, all detected graphical regions—including dot/scatter charts, bar charts, scientific diagrams, and schematics—are reconstructed as SVG programs. For statistical charts:
- The model generates SVG
<circle>elements for dots,<rect>for bars,<line>or<polyline>for trends, as relevant to the detected chart type. - SVG element attributes (e.g.,
cx,cy,r,fill) are derived from vision encoder outputs through an autoregressive SVG token generation process [(Zheng et al., 13 Mar 2026), Sec. 3.1, 5.2].
For scatter/dot charts specifically, the representation aligns with the agent-based dot extraction pipelines of Socratic Chart (Ji et al., 14 Apr 2025), but in dots.mocr-svg the end-to-end model implicitly encodes similar geometric and grouping information within the SVG output stream.
5. Evaluation and Quantitative Results
Parsing quality is benchmarked on both document-wide and graphics-specific tasks, using the UniSVG ISVGEN metric for render-based comparison with ground-truth SVG [(Zheng et al., 13 Mar 2026), Tab. 4; Sec. 4.1]:
- ISVGEN Score: Computes the geometric mean of low-level (primitive-level fidelity) and high-level (grouping, semantic structure) metrics via IoU and structural alignment of model-generated and ground-truth SVG renderings.
- Downstream Datasets: dots.mocr-svg exceeds the performance of OCRVerse and Gemini 3 Pro across all evaluated datasets:
- UniSVG overall: 0.902 (vs. 0.763, 0.735)
- ChartMimic (statistical charts): 0.905
- Design2Code (UI layouts): 0.834
- GenExam (exam diagrams): 0.800
- SciGen (scientific figures): 0.797
- ChemDraw (chemical diagrams): 0.901
Edit distance and command-level IoU, though common in SVG modeling literature, are supplanted by render-based metrics in this domain to accommodate stylistic normalization and serializer non-uniqueness [(Zheng et al., 13 Mar 2026), Sec. 4.3].
6. Model Outputs and Applications
Qualitative outputs (Figs. Example-Icon/Chart/Subject in (Zheng et al., 13 Mar 2026)) demonstrate the capacity of dots.mocr-svg to reconstruct:
- Icons and UI Graphics: Raster images parsed into SVG
<path>,<g>, and transform-encoded vector graphics, preserving spatial groupings and stylistic attributes. - Statistical Charts: Complete SVG representations including axes, ticks, legends, and discrete data marks (bars, lines, dots) with accurate attribute mapping.
- Technical and Scientific Illustrations: Circuit diagrams, biological schematics, and multi-level grouped graphics, parallel to structured representations valued in downstream scientific analysis.
- End-to-End Document Reconstruction: Text and graphics emitted in a unified sequence, supporting document-level semantic parsing and multimodal downstream tasks.
7. Relationship to Other Dot Extraction and SVG Pipelines
The dots.mocr-svg model is closely related in output and motivation to agent-based pipelines exemplified by Socratic Chart (Ji et al., 14 Apr 2025). Whereas Socratic Chart explicitly constructs dot proposals using parallel generator–critic agents and maps pixel coordinates to SVG space with affine transformations, dots.mocr-svg learns end-to-end SVG generation via transformer-based modeling. Both approaches emphasize robust identification of chart primitives, compatibility with ISVGEN render comparisons, and strict separation of graphical and textual modalities in the output.
A plausible implication is that the integration of SVG-level targets in large-scale pretraining not only boosts primitive extraction fidelity in scatter/dot charts but also enables improved semantic alignment for downstream multimodal models operating over complex documents.