跳到主内容
@wquguru
精选88MarkTechPost(RSS)模型发布/更新多源精选 ×2

百度开源Unlimited OCR 2:3B模型长文档解析性能领先

Baidu Open-Sources Unlimited OCR 2 for Hundred-Page Document Parsing

原文
发到 X
推荐理由

长文档OCR是Agent落地刚需,这个3B模型用稀疏注意力解决了上下文爆炸问题,跑分碾压竞品,值得工程团队直接拿来压测。

Baidu has released Unlimited OCR 2, an open-source OCR model built for very long documents. The 3B model parses books, filings and reports of hundreds of pages in one request. Its core change is SR-SWA, a sparse attention scheme that keeps per-step decoding cost nearly flat. Weights ship under the MIT license, with code on GitHub.

百度发布了 Unlimited OCR 2,这是一个专为超长文档构建的开源 OCR 模型。该 3B 模型可在一次请求中解析数百页的书籍、申报文件和报告。其核心改进是 SR-SWA,一种稀疏注意力机制,使每步解码成本几乎保持平稳。权重采用 MIT 许可证发布,代码托管在 GitHub 上。

TL;DR

TL;DR(太长不看)

  • Size: 3.34B parameters. Active parameters not disclosed. Max position length 131,072 tokens.
  • Runs on: 1 CUDA GPU in BF16. Baidu tested on an NVIDIA A800-80GB. BF16 weights total about 6.7 GB.
  • Performance: first place on both multi-page benchmarks Baidu tested, against 9 other models (self-reported).
  • Best: 77.1 overall on MarathonDocBench (hundreds of pages). The next model, Kimi-K3, scores 33.7.
  • Worst: 48.2 on heading hierarchy (TEDS) on MarathonDocBench, its lowest sub-score.
  • 规模:33.4 亿参数。活跃参数数量未公开。最大位置长度 131,072 tokens。
  • 运行环境:BF16 精度下需 1 块 CUDA GPU。百度在 NVIDIA A800-80GB 上进行了测试。BF16 权重大小约为 6.7 GB。
  • 性能:在百度测试的多页基准测试中均排名第一,击败了其他 9 个模型(自我报告)。
  • 最佳表现:在 MarathonDocBench(数百页)上总体得分 77.1。下一个模型 Kimi-K3 得分为 33.7。
  • 最差表现:在 MarathonDocBench 的标题层级(TEDS)指标上得分为 48.2,这是其最低的子分数。

What is Unlimited OCR 2?

什么是 Unlimited OCR 2?

Unlimited OCR 2 is a 3B vision-language model from Baidu that turns ordered page images into structured text. Output covers text, tables, formulas, figures, headings and reading order. It succeeds Unlimited-OCR, released in June 2026 to push DeepSeek-OCR further.

Unlimited OCR 2 是百度推出的一款 3B 视觉语言模型,可将有序页面图像转换为结构化文本。输出涵盖文本、表格、公式、图表、标题和阅读顺序。它是对 2026 年 6 月发布的 Unlimited-OCR 的继任者,旨在进一步超越 DeepSeek-OCR。

The config keeps a DeepSeek-OCR style layout. A SAM ViT-B plus CLIP-L encoder feeds a 12-layer mixture-of-experts decoder. Each token routes to 6 of 64 experts, plus 2 shared experts. The DeepSeek-OCR paper describes this decoder as DeepSeek3B-MoE-A570M. Baidu does not state an active count for version 2. In multi-page mode, each page costs 273 image tokens.

配置保留了 DeepSeek-OCR 风格的布局。SAM ViT-B 加上 CLIP-L 编码器为 12 层混合专家(MoE)解码器提供输入。每个 token 路由到 64 个专家中的 6 个,以及 2 个共享专家。DeepSeek-OCR 论文将该解码器描述为 DeepSeek3B-MoE-A570M。百度未公布版本 2 的活跃参数数量。在多页模式下,每页消耗 273 个图像 tokens。

How does SR-SWA work?

SR-SWA 是如何工作的?

Full attention cost grows quadratically with sequence length. During decoding, each new token scans a longer KV cache. At 273 image tokens per page, 100 pages add 27,300 input tokens before any output.

全注意力的成本随序列长度呈二次方增长。在解码过程中,每个新 token 都需要扫描更长的 KV 缓存。每页 273 个图像 tokens,100 页会在任何输出之前增加 27,300 个输入 tokens。

SR-SWA stands for Sparse Reference Sliding Window Attention. It compresses text-visual attention into a fixed set of working references. Baidu’s model card gives 512 tokens as the example size. The config pairs a 128-token local window with top-16 selection over 32-token blocks. That is 16 blocks of 32 tokens, matching the 512-token budget.

SR-SWA 代表稀疏参考滑动窗口注意力(Sparse Reference Sliding Window Attention)。它将文本-视觉注意力压缩为一组固定的工作参考。百度的模型卡给出 512 tokens 作为示例大小。配置将 128-token 的局部窗口与 32-token 块上的 top-16 选择相结合。即 16 个包含 32 个 tokens 的块,符合 512-token 的预算。

This keeps per-step latency and memory nearly constant as documents grow. It calls the result ‘unlimited-horizon’ parsing within a finite context window. Image encoding and total runtime still rise with page count.

这使得随着文档的增长,每步延迟和内存几乎保持恒定。它在有限的上下文窗口内调用结果为‘无限视界’解析。图像编码和总运行时间仍随页面数量增加而上升。

How does it score on MPDocBench and MarathonDocBench?

它在 MPDocBench 和 MarathonDocBench 上的得分如何?

Baidu team tests on MPDocBench, with dozens of pages per document, and MarathonDocBench, with hundreds. MPDocBench-Parse is a public benchmark of 433 documents and 3,246 pages. We could not find a public MarathonDocBench release.

百度团队在 MPDocBench(每份文档数十页)和 MarathonDocBench(每份文档数百页)上进行测试。MPDocBench-Parse 是一个包含 433 份文档和 3,246 页的公开基准测试。我们未能找到公开的 MarathonDocBench 发布版本。

Per Baidu’s leaderboard chart, Unlimited OCR 2 scores 84.6 on MPDocBench. Qwen3.8-Max follows at 78.3, then Qwen-3.8-Flash-Next at 77.4. On MarathonDocBench it scores 77.1. Kimi-K3 is next at 33.7, then Gemini-3.8-Flash at 28.6.

根据百度的排行榜图表,Unlimited OCR 2 在 MPDocBench 上得分为 84.6。Qwen3.8-Max 紧随其后,得分为 78.3,然后是 Qwen-3.8-Flash-Next,得分为 77.4。在 MarathonDocBench 上,其得分为 77.1。Kimi-K3 排名次之,得分为 33.7,随后是 Gemini-3.8-Flash,得分为 28.6。

The drop between benchmarks is the real story. Qwen3.8-Max falls from 78.3 to 22.9 on hundred-page documents. Unlimited OCR 2 falls 7.5 points. Its predecessor, Unlimited-OCR, scores 0.0 on MarathonDocBench.

基准测试之间的差距才是关键所在。Qwen3.8-Max 在处理百页文档时,得分从 78.3 骤降至 22.9。Unlimited OCR 2 下降了 7.5 分。其前身 Unlimited-OCR 在 MarathonDocBench 上的得分为 0.0。

Sub-scores (MPDocBench / MarathonDocBench):

子分数(MPDocBench / MarathonDocBench):

  • Text: 94.8 / 89.6
  • Formula: 89.4 / 87.9
  • Reading order: 92.3 / 85.3
  • Tables: 87.8 / 74.8
  • Heading hierarchy: 60.1 / 48.2
  • 文本:94.8 / 89.6
  • 公式:89.4 / 87.9
  • 阅读顺序:92.3 / 85.3
  • 表格:87.8 / 74.8
  • 标题层级:60.1 / 48.2

Single-metric margins on MPDocBench are thin. Qwen3.8-Max scores 94.3 on text and 89.2 on formulas. All figures are self-reported and appear only in a chart image.

在 MPDocBench 上,各项指标的差距很小。Qwen3.8-Max 在文本任务上得分为 94.3,在公式任务上得分为 89.2。所有数据均为自报,且仅出现在图表图片中。

Comparison with other open OCR models

与其他开源 OCR 模型的比较

Unlimited OCR 2Unlimited-OCRDeepSeek-OCR-2PaddleOCR-VL-1.6
DeveloperBaiduBaiduDeepSeekBaidu PaddlePaddle
Parameters3.34B3.34B3.39B0.96B
Active parametersNot disclosedNot disclosedNot disclosedNot disclosed
LicenseMITMITApache 2.0Apache 2.0
Paper / releaseOct 2026 (report)Jun 2026 (arXiv)Jan 2026 (arXiv)Jun 2026 (arXiv)
Long-document mechanismSR-SWA, 512-token reference setMulti-page infer_multi, no SR-SWANot disclosedNot disclosed
MPDocBench overall84.6 (Baidu)61.9 (Baidu)Not reportedNot reported
MarathonDocBench overall77.1 (Baidu)0.0 (Baidu)Not reportedNot reported
ServingTransformers, custom SGLangTransformers, vLLM, SGLangTransformers, SGLangPaddleOCR, Transformers
Unlimited OCR 2Unlimited-OCRDeepSeek-OCR-2PaddleOCR-VL-1.6
开发者百度百度DeepSeek百度 PaddlePaddle
参数量3.34B3.34B3.39B0.96B
激活参数量未披露未披露未披露未披露
许可证MITMITApache 2.0Apache 2.0
论文/发布2026年10月(报告)2026年6月(arXiv)2026年1月(arXiv)2026年6月(arXiv)
长文档机制SR-SWA,512-token 引用集Multi-page infer_multi,无 SR-SWA未披露未披露
MPDocBench 总分84.6 (百度)61.9 (百度)未报告未报告
MarathonDocBench 总分77.1 (百度)0.0 (百度)未报告未报告
部署方式Transformers, 自定义 SGLangTransformers, vLLM, SGLangTransformers, SGLangPaddleOCR, Transformers

Parameter counts and licenses from each model’s Hugging Face page. Benchmark scores from Baidu’s chart.

参数量和许可证信息来自各模型在 Hugging Face 页面的数据。基准测试分数来自百度的图表。

How do you run Unlimited OCR 2?

如何运行 Unlimited OCR 2?

The model card lists Transformers for quick tests and SGLang for serving. In Transformers, infer handles 1 page with dynamic tiling, called gundam mode. infer_multi parses every page of a document in 1 request, so the model keeps cross-page context. Loading requires trust_remote_code=True, which runs Python code from the repo.

模型卡片列出了用于快速测试的 Transformers 和用于服务的 SGLang。在 Transformers 中,infer 处理单页图像时使用动态平铺,称为 gundam 模式。infer_multi 可在一次请求中解析文档的每一页,从而保持跨页上下文。加载时需要设置 trust_remote_code=True,这会运行仓库中的 Python 代码。

SGLang serving uses a customized wheel from Baidu, not upstream SGLang. Baidu’s example schedules 10 pages per window and reuses the previous window’s KV tail. Smaller windows cut peak memory but weaken cross-page merging. Baidu warns a default bias setting can trigger a 462 MiB allocation and run out of memory.

SGLang 服务使用的是来自百度的定制 wheel,而非上游 SGLang。百度的示例在每个窗口中调度 10 个页面,并复用前一个窗口的 KV 尾部。较小的窗口可降低峰值内存,但会削弱跨页合并效果。百度警告称,默认的偏置设置可能触发 462 MiB 的分配并导致内存耗尽。

Key Takeaways

关键要点

  • Unlimited OCR 2 is a 3.34B, MIT-licensed OCR model from Baidu.
  • SR-SWA caps attention at a fixed 512-token reference set.
  • It scores 77.1 on MarathonDocBench, against 33.7 for the next model.
  • Heading hierarchy is the weak spot, at 48.2 on long documents.
  • All benchmark numbers are Baidu’s own.
  • Unlimited OCR 2 是百度发布的一款拥有 MIT 许可证、参数量为 3.34B 的 OCR 模型。
  • SR-SWA 将注意力机制限制在固定的 512 token 引用集上。
  • 它在 MarathonDocBench 上得分 77.1,而下一个模型的得分为 33.7。
  • 标题层级是其薄弱环节,在长文档上的得分为 48.2。
  • 所有基准测试数据均为百度自行提供。

Check out the model card, the technical report and the GitHub repo. Also, feel free to follow us on Twitter and don’t forget to join our 150k+ML SubReddit and Subscribe to our Newsletter. Wait! are you on telegram? now you can join us on telegram as well.

请查阅模型卡片、技术报告和 GitHub 仓库。此外,欢迎在 Twitter 上关注我们,别忘了加入我们拥有 150k+ 成员的 ML SubReddit 并订阅我们的新闻通讯。等等!你在 Telegram 上吗?现在你也可以加入我们的 Telegram 群组。

更进一步:量化金融体系

看懂新闻只是起点——沿量化金融路径,把它变成能交付的工程能力

进入量化体系 →