Skip to content
WebAI

How a 1.3B model turns a PDF into Markdown

OXR-1.0 is only 1.3B parameters, yet it beats larger models on several document-parsing benchmarks. Its RSI training loop, its pluggable layout analysis, and the three ways in: hosted demo, free API or Docker.

The SoMark team open-sourced OXR, Optical Everything Recognition, a document parser whose main network is 1.3B parameters. We noticed something odd when adding it to the catalogue: that size is small for document parsing, yet it took first place on three public benchmarks and passed 1,000 GitHub stars in its first week. PDFs and document images come out as Markdown / JSON, with layout coordinates for each block on the original page, ordered by reading sequence. The team calls this agent-friendly data, meaning it can go straight into a knowledge base, a RAG pipeline or an agent without another processing step.

OXR recognises 13 element types: text, titles, tables, formulas, chemical equations, chemical structures, code blocks, stamps and more. Tables come out as HTML/Markdown with row and cell structure intact, formulas as LaTeX, chemical equations in mhchem syntax, molecular structures as SMILES, and multi-column newspapers, papers and A3 exam sheets are reassembled in reading order.

First on three benchmarks, fast too

The three benchmarks look at different things. OmniDocBench covers many document types and layouts, reading order included. olmOCR-Bench checks whether key text and table relations survive. DocParsingBench is open-sourced by SoMark and targets real business documents.

BenchmarkOXR-1.0Rank
OmniDocBench97.18#1
olmOCR-Bench87.84#1
DocParsingBench87.76#1

For speed, the team parsed a fixed 100-page draw from OmniDocBench on a single NVIDIA RTX PRO 6000 Blackwell (96 GB). OXR-1.0 finished in 101 seconds, roughly 1.43× the throughput of PaddleOCR-VL-1.6 and 2.52× that of MinerU2.5-Pro.

ModelTime to fully parse 100 pages
OXR-1.0 (1.3B)101.0 s
OvisOCR2134.8 s
PaddleOCR-VL-1.6144.7 s
DeepSeek-OCR-2161.1 s
LightOnOCR-2-1B171.7 s
HunyuanOCR175.2 s
ABot-OCR217.3 s
MinerU2.5-Pro254.7 s
Single RTX PRO 6000 Blackwell (96 GB), full parse of a fixed 100-page draw from OmniDocBench

Those numbers correspond to the specified hardware and fixed document set. The hosted demo adds upload and queue latency, so wall-clock times you see there are not comparable.

Turning parse errors into training data with RSI

OXR is pre-trained from scratch, and its post-training introduces a recursive self-improvement (RSI) loop. Per the team it is the first in document parsing that needs no newly hand-labelled data:

  • OXR parses unlabelled documents to produce candidate results
  • a general multimodal model judges the rollouts, finding and diagnosing error and weak samples
  • an independent clustering model groups similar causes
  • the general model then plans the next training round and prepares targeted data, and OXR trains and validates on it before the loop repeats

What it saves is manual labelling of new training data. Judging, attribution and data preparation are done by cooperating models, and the next round targets whichever document type parsed worst.

Pluggable layout analysis

Layout analysis is a separate module you can swap. A lightweight model locates content regions while the main model handles recognition and reading order in one pass, so ordering can use content semantics and needs no separate stage. Businesses disagree on how the same block should be split, title plus body or one table, so plug in your own layout model with its own element categories, region boundaries and grouping, and keep OXR’s recognition and ordering.

How to get started

The quickest way in is the hosted online demo (free uploads) or the free API (no sign-up). For Node.js there is the official somark-js SDK, Node 18+ with a CLI:

parse.mjs
import { SoMark } from 'somark-js';

// reads the SOMARK_API_KEY environment variable
const client = new SoMark();

const result = await client.parser.parse({
  file: './sample.pdf',
  formats: ['md'],
});

await result.save('./result.md', 'md');
console.log(result.md);

Self-hosting runs via Docker (a single 24 GB GPU to start; 48 GB+ recommended for long documents and higher concurrency). Weights are published on Hugging Face and ModelScope. The licence is a custom one based on Apache 2.0 with additional terms. Read the repository LICENSE before commercial use.

This site also lists OXR-1.0 under the document-understanding demo in Multimodal. Its weights run on servers with no browser build, so clicking that card on the demo page opens the hosted demo above rather than running anything locally.

All posts →

← Back to all posts