百度开源 Unlimited OCR 2,面向几十到几百页文档的 OCR 与版面解析,模型为 3B/A0.5B 的 MoE 架构,地址 https://huggingface.co/baidu/Unlimited-OCR-2。
百度开源 Unlimited OCR 2:超长文档解析,注意力开销尽量不随页数涨
Unlimited OCR 2 是面向「几十到几百页」文档的开源 OCR / 版面解析模型,3B/A0.5B 的 MoE 模型架构:用 SR-SWA 把文本–视觉注意力压到固定大小的工作参考集,再配合按页分块解码,让超长文档能在有限上下文里跑完,并声称逐步解码的延迟和显存几乎不随文档变长而涨。
开源模型:https://huggingface.co/baidu/Unlimited-OCR-2
相对 v1 改了什么
v1(R-SWA)已能做多页端到端解析,但论文写明输入大约卡在 40 页,也因此没上 MarathonDocBench。v2 把解码器注意力升到 SR-SWA(Sparse Reference Sliding Window Attention),并加上 Unlimited-Horizon Decoding;骨干仍是 DeepEncoder + MoE 解码器一路,从 v1 权重再训。口号从「长程」推到「不限程」。
SR-SWA 在做什么(技术报告口径)
长文档会让文本–视觉注意力很贵。R-SWA 管住了局部交互,但远端视觉 token 仍会随页数涨。SR-SWA 的做法是:把交互压进固定容量的工作参考(README 举例 512 tokens)。大致两步:Page Gate 先按页收窄候选;Token Sieve 再对块做摘要打分,用 α-entmax 稀疏路由,只保留 top-k 远端块加局部窗口。解码侧按页切块,页边界重叠 1 页并复用 KV 尾部,避免超长时显存爆掉。作者称百页量级上,逐步速度相对 Full Attention 约 7.0×、相对 R-SWA 约 5.6×。
Unlimited OCR 2 is here, and it's open source. 📖 ✨ Longer documents can mean a lot more attention computation. Our new SR-SWA mechanism keeps that in check by condensing text-visual attention interactions into a fixed-size set of working references. Here's what it delivers: - Document parsing at virtually any length, within a finite context window - Nearly constant per-step decoding latency and memory footprint as documents grow longer - State-of-the-art performance on MPDocBench and MarathonDocBench, covering documents from dozens to hundreds of pages Check out the model here ↓在 X 查看被引用的帖子
来源:meng shao · x.com