Skip to main content
Back

Zhipu AI's Tiny GLM-OCR Beats Gemini 3 Pro at Document Parsing

A 0.9B-parameter model from Zhipu AI tops OmniDocBench, beating Gemini 3 Pro and GPT-5.2 while running 50% faster via multi-token decoding.

Pro

  • Zhipu AI released GLM-OCR, a 0.9B parameter document parsing model with open weights
  • Scores 94.62 on OmniDocBench v1.5, beating Gemini 3 Pro (90.33) and Qwen3-VL-235B (89.15)
  • Multi-Token Prediction generates 5.2 tokens per step on average, delivering ~50% throughput gain
  • Two-stage pipeline: PP-DocLayout-V3 crops regions, then parallel recognition via GLM-OCR Core
  • Runs at 1.86 PDF pages per second; supports vLLM, SGLang, Ollama, and LLaMA-Factory fine-tuning
  • Available on Hugging Face with hosted API at ~$0.03 per million tokens

A tiny document parsing model just outscored every closed-source giant on the field's most watched benchmark. GLM-OCR, released by Zhipu AI in collaboration with Tsinghua University, is a 0.9B-parameter multimodal model that hits 94.6 on OmniDocBench v1.5, edging out Gemini 3 Pro, GPT-5.2, and Qwen3-VL-235B on document parsing while running fast enough to sit on a single consumer GPU.

The model is designed for one thing: turning messy real-world documents (PDFs, invoices, handwritten menus, scientific papers with matrices) into clean Markdown or JSON. It combines a 0.4B-parameter CogViT visual encoder with a 0.5B-parameter GLM language decoder, and the entire pipeline is openly available on Hugging Face along with an SDK, a fine-tuning tutorial, and a hosted API.

Why autoregressive decoding is wrong for OCR

Standard vision-language models generate one token at a time, where each token depends on all previous ones. OCR is inherently a deterministic task with strong local dependencies and explicit structural supervision, where strictly autoregressive token-by-token decoding is inefficient. If the model has already seen a <td> tag, the closing </td> a few tokens later is essentially predictable, but the model still burns a full forward pass on it.

GLM-OCR's headline trick is Multi-Token Prediction (MTP), borrowed from DeepSeek-V3's training recipe. In addition to the main prediction head, GLM-OCR attaches k shared-parameter auxiliary heads that simultaneously predict the next k tokens. These heads share the same parameters but are trained to model different future offsets. During inference, this allows the model to generate multiple tokens per step, reducing latency while encouraging better local structural coherence.

The concrete numbers: the model is trained to predict 10 tokens per step using k shared-parameter auxiliary heads. At inference time, it generates an average of 5.2 tokens per decoding step, yielding approximately 50% throughput improvement. MTP also improves structural coherence, producing fewer broken HTML/Markdown tags in table and formula outputs. Sharing parameters across the auxiliary heads is what keeps memory in check, which is why the whole model still fits in edge-scale budgets.

GLM-OCR architecture pipeline showing layout detection, parallel region recognition, and unified document parsing with KIE outputs

Two stages beat one big model

Feeding a small model an entire dense page tends to produce hallucinations and infinite repetition loops. GLM-OCR sidesteps this with a decomposed pipeline. Rather than feeding entire complex documents to the model at once (which causes hallucinations in small models), GLM-OCR uses a two-stage approach. PP-DocLayout-V3 first performs layout analysis, decomposing pages into semantically coherent regions (paragraphs, tables, formulas), then each region is recognized independently and in parallel.

The same core model handles two distinct workflows under a single generative formulation:

  • Document Parsing: Layout detector crops regions, GLM-OCR Core transcribes each region, a merge module restores reading order and emits Markdown plus JSON.
  • Key Information Extraction: The full image plus a JSON-schema prompt goes straight into the core. No layout cropping; the model attends to relevant regions implicitly.

The training recipe

The team trained the model in four stages, progressively narrowing from broad visual understanding to structured output reliability:

  1. Vision encoder pretraining on tens of billions of image-text pairs using combined masked image modeling and CLIP objectives, plus distillation from a larger in-house ViT.
  2. Vision-language pretraining that attaches GLM-0.5B to the encoder and trains jointly on image-text, document parsing, grounding, and VQA data. MTP is introduced as an objective in phase 2.2.
  3. Supervised fine-tuning on curated OCR data covering text, formulas, tables, and KIE, with MTP kept on to align training and inference.
  4. Reinforcement learning using GRPO with task-aware rewards: normalized edit distance for text, CDM score for formulas, TEDS for tables, and field-level F1 plus JSON parse validation for KIE.

Benchmark results

On the granular OmniDocBench v1.5 breakdown, GLM-OCR posts the highest overall score at 94.62. The gap between it and much larger general VLMs is striking: Qwen3-VL-235B scores 89.15 and Gemini 3 Pro 90.33, despite being roughly 260 times larger. The model integrates the CogViT visual encoder pre-trained on large-scale image-text data, a lightweight cross-modal connector with efficient token downsampling, and a GLM-0.5B language decoder.

ModelParamsOmniDocBench v1.5Table TEDS
GLM-OCR0.9B94.6293.96
PaddleOCR-VL-1.50.9B94.5092.76
MinerU2.51.2B90.6788.22
Gemini-3 Pro-90.3388.28
Qwen3-VL235B89.1586.21
GPT-5.2-85.5082.66

The team also ran an in-house benchmark on six messy real-world scenarios. GLM-OCR wins five of six open-weight comparisons, with especially large margins on tasks that trip up general models: 90.5 on seal recognition (versus 63.0 for dots.ocr, the next best open model) and 91.5 on real-world tables. On receipt KIE it hits 94.5, well ahead of GPT-5.2's 83.5.

Throughput and deployment

Speed is where the compact size compounds with MTP. On single-replica, single-concurrency tests, GLM-OCR processes 1.86 PDF pages per second and 0.67 standalone images per second, roughly 1.5x PaddleOCR-VL-1.5 and 3.9x MinerU2.5. The model runs under vLLM, SGLang, and Ollama for local deployment, and Zhipu offers a hosted API at 0.2 RMB per million tokens (roughly $0.03 USD), which they claim processes about 2,000 A4 scans per RMB.

For custom domains, fine-tuning goes through LLaMA-Factory with configuration templates provided in the repo.

Where it breaks

The paper is upfront about the tradeoffs of the two-stage design. Errors in PP-DocLayout-V3 propagate downstream, and complex layouts with cross-page dependencies or irregular multi-column structures can produce imperfect reading order. Performance also degrades on extremely low-resolution documents, very dense or irregular tables, and underrepresented languages.

Because GLM-OCR is generative, there's residual stochastic variation in things like whitespace and line breaks, which the RL stage mitigates but does not eliminate. For KIE, extraction quality depends heavily on how precisely the prompt schema is specified; ambiguous field boundaries in complex forms still cause missing or duplicated outputs.

Why this matters

The interesting takeaway is not that a small model beat big ones on one benchmark. It is that the recipe here (task-appropriate decoding plus layout decomposition plus RL with structural rewards) shows document intelligence does not need scale. For teams building invoice pipelines, RAG ingestion, or on-device document scanning, a 0.9B model that runs on modest hardware and outputs valid JSON is a substantially different deployment story than a 200B general VLM. And with MTP giving a 50% throughput bump essentially for free on deterministic outputs, expect the same trick to appear in the next generation of specialized OCR and code generation models.