Skip to main content
Back

StepFun's GOT-OCR2.0 Replaces Entire OCR Pipelines With One 580M Model

StepFun's 580M-parameter GOT-OCR2.0 unifies scene text, documents, formulas, tables, charts, and even sheet music into one end-to-end model.

Pro

  • GOT-OCR2.0 is a 580M-parameter end-to-end OCR VLM under Apache 2.0.
  • Handles text, tables, math, molecules, charts, sheet music, and geometric shapes in one model.
  • Outputs markdown, LaTeX/TikZ, SMILES, and Kern music notation directly.
  • Supports region-level OCR via bounding-box or color prompts.
  • Adds dynamic resolution and multi-page OCR for real documents.
  • Paper and code released; ~700K downloads on Hugging Face.

Most OCR pipelines are still stitched-together contraptions: a text detector here, a recognizer there, a layout parser, a table extractor, maybe a formula model bolted on for good measure. GOT-OCR2.0 from StepFun throws that entire stack out and replaces it with a single 580M-parameter vision language model that reads everything from grocery receipts to sheet music. It has quietly become one of the most downloaded OCR models on Hugging Face, pulling in nearly 700,000 downloads under an Apache 2.0 license.

The pitch is right there in the paper title: General OCR Theory: Towards OCR-2.0 via a Unified End-to-end Model. The authors argue that traditional OCR systems (OCR-1.0) are increasingly unable to meet demand for intelligent processing of man-made optical characters, and they redefine everything from plain text and math formulas to tables, charts, sheet music, and geometric shapes as "characters" the model should handle.

One model, one forward pass, many character types

GOT weighs in at 580M parameters as a unified end-to-end model built from a high-compression encoder and a long-context decoder. The architecture has three modules: an image encoder, a linear layer that maps channel dimensions between the vision encoder and the language decoder, and an output decoder. That is the whole thing. No separate detection network, no external layout analyzer, no post-processing pipeline.

Examples of GOT-OCR2.0 handling scene text, documents, tables, product packaging, sheet music, chemical structures, and charts

On the input side, the model accepts scene- and document-style images in both slice and whole-page styles. On the output side, a short prompt selects the target format:

  • Markdown for documents and tables
  • LaTeX/TikZ for math formulas and geometric shapes
  • SMILES for molecular structures
  • Kern notation for sheet music (rendered via verovio)

GOT-OCR2 covers plain document OCR, scene text OCR, formatted document OCR, and OCR for tables, charts, mathematical formulas, geometric shapes, molecular formulas, and sheet music. The model itself outputs plain text, which downstream tools like pdftex, mathpix, matplotlib, tikz, verovio, or pyecharts turn into rendered artifacts.

Interactive OCR you can actually script

Beyond dumping a whole page to text, GOT exposes region-level control that most OCR models do not. You can point it at a bounding box or a colored region and get back only what is inside. This turns OCR into something more like a query language over the pixels.

from transformers import AutoModel, AutoTokenizer
tokenizer = AutoTokenizer.from_pretrained('stepfun-ai/GOT-OCR2_0', trust_remote_code=True)
model = AutoModel.from_pretrained('stepfun-ai/GOT-OCR2_0', trust_remote_code=True,
    low_cpu_mem_usage=True, device_map='cuda', use_safetensors=True,
    pad_token_id=tokenizer.eos_token_id).eval().cuda()
# plain text OCR
res = model.chat(tokenizer, 'page.jpg', ocr_type='ocr')
# formatted OCR (markdown/latex out)
res = model.chat(tokenizer, 'page.jpg', ocr_type='format')
# region-level OCR by bounding box or by color
res = model.chat(tokenizer, 'page.jpg', ocr_type='format', ocr_box='[x1,y1,x2,y2]')
res = model.chat(tokenizer, 'page.jpg', ocr_type='format', ocr_color='red')

For long or high-resolution pages, a chat_crop variant runs multi-crop inference, and a render=True flag saves an HTML preview of the formatted output. The whole thing runs on a single GPU thanks to the modest parameter count.

A three-stage training recipe

The authors used a three-stage recipe rather than one giant end-to-end pretrain. First, they ran a pure text recognition task to pre-train the vision encoder, pairing it with a tiny decoder to pass gradients efficiently and save GPU resources. Once the encoder learned to compress dense text-heavy images, it was plugged into a larger Qwen-based decoder for joint training and then specialized on formatted outputs. The codebase builds on the team's earlier Vary project, which introduced the idea of scaling up the vision vocabulary for VLMs.

Later refinements added interactive OCR features (region-level recognition guided by coordinates or colors), dynamic resolution, and multi-page OCR. Dynamic resolution matters because dense A4 pages break fixed-tile vision encoders, and multi-page support means you can feed a short PDF chunk without stitching outputs manually.

Where it fits and where it does not

GOT is a strong default when your input is structured or semi-structured and you want machine-readable output rather than a bag of words. Concretely:

  • Good for: scanned papers with equations, financial tables, chemistry diagrams, chart digitization, multilingual documents (Chinese and English are first-class), and any workflow where you want markdown or LaTeX directly.
  • Less good for: handwriting-heavy inputs, very noisy scene text at extreme angles, and applications that need precise character-level bounding boxes (the model is autoregressive, so it emits tokens, not coordinates).
  • Watch for: hallucinated cells in very sparse tables, and the usual VLM failure mode of skipping content on extremely long pages if you do not enable multi-crop.

Why the community keeps pulling it down

The download counter is a fair proxy for how well GOT hits a real gap. Cloud OCR APIs are expensive and opaque, Tesseract is fast but has no notion of formulas or layout, and large general-purpose VLMs like GPT-4o read documents beautifully but cost money per page and cannot be self-hosted. A 580M open-weights model that emits markdown and LaTeX and runs on a consumer GPU fits neatly between those extremes.

It also nudges the field's assumptions. Document AI used to be a domain where multi-stage pipelines and specialized detectors were considered non-negotiable, especially for structured output. GOT shows that a compact end-to-end VLM, trained with the right data engines, can match or beat those pipelines while covering character types that classic OCR never handled at all. That is a useful reference point when you are deciding whether to build the next document workflow around six specialized models or one small unified one.