觉
AI觉醒星球
Awakening is here
Knowledge File / AI小生意项目库
2026-07-05 3 浏览 免费阅读

百度“无限OCR”通过将记忆模拟为人类遗忘,单次处理数十页文档

百度研究人员开发了Unlimited OCR模型,通过参考滑动窗口注意力(R-SWA)机制,实现单次推理处理数十页文档,内存和速度保持恒定,在基准测试中准确率达93%。

SOURCE / AI小生意项目库 MIN / 9 ACCESS / 免费阅读 POST / 2026-07-05 23:25:07

原贴

查看原文
作者:Jonathan Kemper 来源站点:the-decoder.com 原贴时间:

原文

Baidu researchers have built an OCR model that handles dozens of document pages in a single inference pass, keeping memory use and speed constant regardless of text length. A redesigned attention mechanism makes this possible. No current OCR model handles more than about ten pages in a single pass, the Baidu researchers write in their technical report. The bottleneck is the KV cache, a buffer where a language model stores all previously processed tokens during generation so it can look them up later. Current end-to-end systems use a language model as their decoder, so this buffer grows with every new line of text. That drives up memory use and steadily slows generation. In practice, systems get around the problem with a loop that processes each document page by page, resetting the cache after every step. Baidu frames the problem with a human analogy. Someone copying a book doesn't re-read everything they've already written. They keep their eyes on the source, the last few characters they wrote, and the next one to put down. Older passages fade through a kind of soft forgetting. The researchers want Unlimited OCR to mimic that pattern. It works through what the team calls Reference Sliding Window Attention (R-SWA). Each generated token still sees all reference tokens, the visual image tokens and the prompt. But when it comes to previously generated output, it only looks back at the last 128 tokens. That keeps the KV cache constant throughout the entire process instead of growing linearly with output length. Standard sliding window attention would also subject visual tokens to ongoing state changes, gradually blurring image features and degrading recognition. R-SWA exempts visual tokens from these transitions. They're encoded once and stay unchanged. The KV cache works as a queue where each new token pushes out the oldest one. With standard multi-head attention, memory use grows without bound as token count rises. R-SWA caps it at the fixed sum of prefix length and window size. Unlimited OCR builds on the open-source Deepseek OCR model . Baidu keeps its DeepEncoder and pairs it with a mixture-of-experts architecture with three billion parameters, of which only about 500 million are active during inference. The DeepEncoder compresses a 1024-by-1024-pixel PDF image down to 256 tokens. Two resolution modes carry over. "Base" mode handles multi-page documents, and "Gundam" mode uses dynamic resolution for single pages. Every standard attention layer in the decoder was swapped out for R-SWA. Training used about two million document samples, split 9-to-1 between single-page and multi-page data. Paddle OCR handled annotation for single pages. Multi-page data was built synthetically by stitching single pages together into documents ranging from two to 50 pages. All data was packed into sequences of 32,000 tokens; training ran for 4,000 steps on 8 times 16 Nvidia A800 GPUs. The DeepEncoder stayed frozen, and only the language model parameters were updated. Unlimited OCR scores 93 percent overall on the OmniDocBench v1.5 document benchmark, six percentage points above the Deepseek OCR baseline, according to the authors. The benchmark measures several sub-tasks. Pure text recognition error rate, measured as edit distance (the number of corrections needed per character), drops slightly. Table structure recognition improves more sharply, by nearly six percentage points. On the newer v1.6 version, the model hits 93.92 percent, putting it at the top of the end-to-end system rankings.

中文翻译

百度研究人员构建了一个OCR模型,单次推理即可处理数十页文档,无论文本长度如何,内存使用和速度都保持恒定。重新设计的注意力机制使之成为可能。百度研究人员在其技术报告中写道,目前没有OCR模型能在单次推理中处理超过大约十页。瓶颈是KV缓存,这是一个缓冲区,语言模型在生成过程中存储所有先前处理的标记,以便以后查找。当前的端到端系统使用语言模型作为解码器,因此这个缓冲区会随着每一行新文本而增长。这导致内存使用增加,生成速度逐渐变慢。实践中,系统通过一个循环逐页处理每个文档,每一步后重置缓存来绕开这个问题。

百度用一个人类类比来描述这个问题。抄写书籍的人不会重读他们已经写下的所有内容。他们盯着原文、刚刚写下的最后几个字符以及下一个要写的字符。较早的段落通过一种软性遗忘逐渐淡出。研究人员希望Unlimited OCR模仿这种模式。它通过团队所称的参考滑动窗口注意力(R-SWA)来实现。每个生成的标记仍然可以看到所有参考标记、视觉图像标记和提示。但涉及到先前生成的输出时,它只回看最后128个标记。这使得KV缓存在整个过程中保持恒定,而不是随着输出长度线性增长。标准的滑动窗口注意力也会使视觉标记经历持续的状态变化,逐渐模糊图像特征并降低识别能力。R-SWA使视觉标记免于这些变化。它们被编码一次并保持不变。KV缓存作为一个队列工作,每个新标记将最旧的标记推出。使用标准多头注意力,内存使用随着标记数量增加而无限制增长。R-SWA将其上限设定为前缀长度和窗口大小的固定总和。

Unlimited OCR基于开源Deepseek OCR模型构建。百度保留了其DeepEncoder,并将其与一个混合专家架构配对,该架构有30亿参数,其中推理时仅有约5亿活跃。DeepEncoder将1024x1024像素的PDF图像压缩为256个标记。两种分辨率模式延续下来。“基础”模式处理多页文档,“高达”模式对单页使用动态分辨率。解码器中的每个标准注意力层都被替换为R-SWA。训练使用了约200万个文档样本,单页与多页数据按9:1分割。Paddle OCR负责单页的标注。多页数据是通过将单页拼接成2到50页的文档来合成的。所有数据被打包成32,000个标记的序列;训练在8x16块Nvidia A800 GPU上运行了4000步。DeepEncoder保持冻结,仅更新语言模型参数。

据作者称,Unlimited OCR在OmniDocBench v1.5文档基准测试中整体得分93%,比Deepseek OCR基线高6个百分点。该基准测试衡量多个子任务。纯文本识别错误率(以编辑距离衡量,即每字符需要纠正的次数)略有下降。表格结构识别提升更明显,接近6个百分点。在更新的v1.6版本上,模型达到93.92%,在端到端系统排名中位居首位。

核心信息

百度研究人员开发了Unlimited OCR模型,通过参考滑动窗口注意力(R-SWA)机制,实现单次推理处理数十页文档,内存和速度保持恒定,在基准测试中准确率达93%。

  • 百度研究人员开发了Unlimited OCR模型,通过参考滑动窗口注意力(R-SWA)机制,实现单次推理处理数十页文档,内存和速度保持恒定,在基准测试中准确率达93%。
  • 原贴提到:Baidu researchers have built an OCR model that handles dozens of documen
  • 来源:the-decoder.com

详细解读

这是什么信号?

百度提出的Unlimited OCR模型,通过创新的参考滑动窗口注意力(R-SWA)机制,在OCR领域实现了一项关键突破:单次推理即可处理数十页文档,且内存和计算速度不随文本长度增长。这标志着长文档OCR从逐页处理向端到端实时处理的范式转变。

为什么重要?

现有的OCR系统受限于KV缓存的线性增长,通常只能逐页处理,导致效率低下且内存占用高。R-SWA通过固定窗口大小和视觉令牌不变性,彻底解决了这一瓶颈,使得大规模文档批量处理成为可能。对于需要自动化处理大量多页文档的场景(如发票、合同、书籍扫描),该技术可大幅提升吞吐量并降低硬件成本。

对谁有价值?

首先,文档处理软件开发商和AI服务提供商可将其集成到产品中,获得差异化竞争力。其次,金融、法律、政府档案等需要高频OCR的行业用户将受益于更快的处理速度和更低的资源消耗。此外,研究社区可借鉴R-SWA设计思路,推广到其他长序列生成任务。

可以怎么行动?

关注百度是否开源或发布API,尽早进行技术评估;对比现有OCR流水线(如逐页处理的PaddleOCR),测试Unlimited OCR在长文档上的准确率和速度提升;若该模型可用,优先在批量文档数字化、自动录入等场景中试点应用。

风险或限制

模型基于Deepseek OCR架构,可能依赖特定组件,通用性待验证;训练数据以合成多页文档为主,真实场景的复杂版面(如不规则表格、手写混合)识别效果需进一步测试;仅30亿参数,在极长文档或高精度要求下可能仍有局限;此外,模型的商业许可和开源状态尚未明确。

信息差价值

这条内容的真正价值,不只是“有人发布了一个新功能”,而是它揭示了 the-decoder.com 背后的产品方向、工作流变化或竞争信号。对 OPC 来说,这种信息可以转化成持续追踪的栏目选题。

如果把《百度“无限OCR”通过将记忆模拟为人类遗忘,单次处理数十页文档》放到你的内容系统里,它最大的价值在于帮助读者更快看懂“为什么值得关注”,而不是只看到一条碎片化动态。

参考来源

AI SUMMARY

这篇文章回答了什么

百度“无限OCR”通过将记忆模拟为人类遗忘,单次处理数十页文档主要讲什么?

百度研究人员开发了Unlimited OCR模型,通过参考滑动窗口注意力(R-SWA)机制,实现单次推理处理数十页文档,内存和速度保持恒定,在基准测试中准确率达93%。

这篇文章最值得关注的要点是什么?

百度研究人员开发了Unlimited OCR模型,通过参考滑动窗口注意力(R-SWA)机制,实现单次推理处理数十页文档,内存和速度保持恒定,在基准测试中准确率达93%。;原贴提到:Baidu researchers have built an OCR model that handles dozens of documen;来源:the-decoder.com

这篇文章和哪些AI专题相关?

它适合放在AI副业、AI超级个体、AI工具专题里阅读。 关联原因:这篇内容命中「项目、小生意、变现」等主题信号。;这篇内容命中「效率、学习」等主题信号。;这篇内容命中「模型」等主题信号。

阅读这篇文章建议先理解哪些关键词?

建议先理解AI工具、工具、自动化、模型、Cursor这些关键词,再结合正文判断工具、机会或风险是否值得进入自己的工作流。

上一篇 Anthropic Claude Design 反向工程提示词开源更新 下一篇 美团 LongCat-2.0 完全开源(MIT 许可),1.6T MoE 模型开放权重与推理代码
北竹游乐场 免费玩小游戏 免费玩