LightOnOCR-3-4B
by lightonai
LightOn's 4B OCR model that turns a page image into Markdown, with optional labeled bounding boxes, image descriptions and chart data as tables
lightonai/LightOnOCR-3-4BDeploy LightOnOCR-3-4B
Single-tenantMixpeek has no managed extractor for this model. On a single-tenant deployment you upload the weights and a custom plugin serves them next to the rest of your pipeline.
Overview
LightOnOCR-3-4B reads a scanned or rendered document page and writes its text out as Markdown. Called with the prompt "grounding", it also puts a label and a bounding box in front of every block, describes each image in a sentence, and turns each chart into an HTML table of its data points. It is the largest of LightOn's three LightOnOCR-3 models, released in October 2026 under Apache 2.0, and the one LightOn recommends for most OCR work.
LightOn's launch post reports 86.3 on olmOCR-Bench, 75.1 on ParseBench (five-category overall) and 74.1 on the French fr-bench-pdf2md. These are LightOn's own runs, scored after normalization functions they publish in the LightOnOCR repository, and the post says normalization changes scores noticeably for every top model. On olmOCR-Bench it sits 1.3 points behind Infinity Parser Pro, a 35.1B model, and 0.5 points ahead of Chandra 2 at the same 4B size.
For search, the grounding mode is the useful part. Each block arrives with its type (title, table, chart, footnote and 12 other labels) and its position on the page, so you can index a page block by block, filter out headers and footers, and point a search result at the exact region that answered it.
Architecture
Qwen3.5 vision-language architecture, loaded with Qwen3_5ForConditionalGeneration (Transformers 5.2 or later). Per the repo's config.json: a 24-layer vision encoder (hidden size 1024, 16-pixel patches) projecting into a 32-layer language model (hidden size 2560, 248,320-token vocabulary). About 4.54B parameters in BF16 safetensors. Trained and evaluated with thinking disabled. Two prompt modes: an empty prompt for plain transcription, or "grounding" for blocks prefixed with , coordinates normalized to 0-1000. LightOn says other instructions are out of distribution.
Mixpeek SDK Integration
# LightOnOCR-3-4B runs on your side, as in the model card: render PDF pages
# at 400 DPI with a 2048 px longest edge, then call the model with the
# "grounding" prompt. No Mixpeek extractor runs these weights.
import re, requests, torch
from transformers import AutoProcessor, Qwen3_5ForConditionalGeneration
model_id = "lightonai/LightOnOCR-3-4B"
model = Qwen3_5ForConditionalGeneration.from_pretrained(model_id, dtype=torch.bfloat16, device_map="auto")
processor = AutoProcessor.from_pretrained(model_id)
conversation = [{"role": "user", "content": [
{"type": "image", "url": "https://your-cdn.example.com/reports/2026-q3/page-004.png"},
{"type": "text", "text": "grounding"},
]}]
inputs = processor.apply_chat_template(
conversation, add_generation_prompt=True, tokenize=True,
return_dict=True, return_tensors="pt", enable_thinking=False,
).to(model.device)
output_ids = model.generate(**inputs, max_new_tokens=1024, do_sample=True, temperature=0.2)
page = processor.decode(output_ids[0, inputs["input_ids"].shape[1]:], skip_special_tokens=True)
# Each block starts with . Upload one object per block to
# a bucket whose collection uses features: ["text_search"] (text_extractor,
# E5-Large). The text extractor reads up to 512 tokens, so block-sized
# objects keep long pages from being truncated. List source_key, page, label
# and bbox in the collection's field_passthrough so they reach each document.
MARK = re.compile(r"!\[([a-z_]+\+?)\]\((\d+),(\d+),(\d+),(\d+)\)\n")
parts = MARK.split(page)
for i in range(1, len(parts), 6):
label, x0, y0, x1, y1, text = parts[i:i + 6]
if label.rstrip("+") in ("header", "footer", "page_number"):
continue
requests.post(
"https://api.mixpeek.com/v1/buckets/bkt_your_bucket/objects",
headers={"Authorization": "Bearer API_KEY", "X-Namespace": "ns_your_namespace"},
json={
"key_prefix": "/reports/2026-q3",
"blobs": [{"property": "block_text", "type": "text", "data": text.strip()}],
"source_key": "reports/2026-q3.pdf", "page": 4, "label": label,
"bbox": [int(x0), int(y0), int(x1), int(y1)],
},
)Capabilities
- Page image to Markdown text with an empty prompt, the same interface as LightOnOCR-2
- Grounding mode: every block gets one of 16 labels plus a bounding box
- Short descriptions for image regions
- Charts and graphs converted to HTML tables of their data points
- Tables, forms, receipts, multi-column layouts and math notation
- Serves with vLLM or Transformers; Apache 2.0 for research and commercial use
Use Cases on Mixpeek
Benchmarks
| Dataset | Metric | Score | Source |
|---|---|---|---|
| olmOCR-Bench | Overall | 86.3 | LightOn launch post (vendor-run, LightOn's published normalization) |
| olmOCR-Bench, Infinity Parser Pro (35.1B) | Overall | 87.6 | LightOn launch post (vendor-run comparison) |
| olmOCR-Bench, Chandra 2 (4B) | Overall | 85.8 | LightOn launch post (vendor-run comparison) |
| ParseBench | Overall (5 categories) | 75.1 | LightOn launch post (vendor-run) |
| ParseBench | Charts | 66.1 | LightOn launch post (vendor-run) |
| fr-bench-pdf2md | Overall | 74.1 | LightOn launch post (vendor-run) |
Performance
Throughput is LightOn's measurement on the 512 olmOCR-Bench pages; at 400 DPI with a 5 MP cap, about 4.8k image tokens per page, peak throughput is lower. The card says grounding mode adds about 25% output tokens (1,433 against 1,158 per page on average). We have not measured it.
Common Pipeline Companions
The text embedder behind Mixpeek's text_search feature, for the extracted blocks
The previous generation; LightOnOCR-3 keeps its empty-prompt interface
Searches page images directly, to compare against OCR-then-embed on the same documents
Frequently Asked Questions
What is LightOnOCR-3-4B?
An open OCR model from LightOn that converts a document page image into Markdown text. With the "grounding" prompt it also returns a label and bounding box for every block, a short description of each image and chart data as tables. It is the largest of three LightOnOCR-3 sizes and is released under Apache 2.0.
How accurate is LightOnOCR-3-4B?
LightOn's launch post reports 86.3 on olmOCR-Bench, 75.1 on ParseBench and 74.1 on fr-bench-pdf2md. LightOn ran these evaluations and applied its own published normalization before scoring, so check the model on your own documents before relying on the ranking.
Which LightOnOCR-3 size should I use?
LightOn recommends the 4B for most OCR tasks. The 0.8B shares the Qwen3.5 architecture and scores 85.5 on olmOCR-Bench in LightOn's runs; the 1B keeps the LightOnOCR-2 architecture as a drop-in upgrade for existing deployments.
Can I use LightOnOCR-3-4B commercially?
Yes. The model card and launch post state Apache 2.0 for research and commercial use.
How do I search documents parsed by LightOnOCR-3-4B?
Run the model with the grounding prompt, split its output into blocks and upload each block to a Mixpeek bucket as a text object with its page, label and bounding box. A collection with the text_search feature embeds each block, and a retriever searches them and returns the page and region that matched.
Specification
Research Paper
LightOnOCR-3: High-Performance OCR and Layout Extraction in One Model (LightOn, October 2026)
arxiv.orgBuild a pipeline with LightOnOCR-3-4B
Add this model to a processing pipeline alongside other extractors. Combine with retrieval stages for end-to-end search.
Run it on your own data, free