AI News AI资讯 5d ago Updated 4d ago 更新于 4天前 49

Baidu's 'Unlimited OCR' processes dozens of document pages in one pass by treating memory like human forgetting 百度“无限OCR”一次处理数十页文档,将记忆机制拟人化为遗忘

Baidu introduces "Unlimited OCR," a model capable of processing dozens of document pages in a single inference pass by maintaining constant memory usage and speed regardless of text length. The core innovation is Reference Sliding Window Attention (R-SWA), which fixes the KV cache size by limiting attention to the last 128 generated tokens while preserving full access to visual reference tokens. Built on the DeepSeek OCR foundation, the model achieves 93% accuracy on OmniDocBench v1.5, outperfor 百度发布Unlimited OCR,通过引入参考滑动窗口注意力(R-SWA)机制,实现了单次推理处理数十页文档且内存与速度恒定。 R-SWA仅保留最近128个生成token的KV缓存,同时固定视觉参考token,解决了传统端到端OCR中KV缓存随长度线性增长导致的性能瓶颈。 基于DeepSeek OCR架构,该模型在OmniDocBench v1.6上达到93.92%准确率,长文档错误率低于0.11,推理速度比基线提升12.7%。 尽管受限于32,000 token上下文窗口,但该技术证明了固定窗口注意力在长文本OCR中的有效性,并计划扩展至语音识别等其他参考型任务。

65
Hot 热度
75
Quality 质量
70
Impact 影响力

Analysis 深度分析

TL;DR

  • Baidu introduces "Unlimited OCR," a model capable of processing dozens of document pages in a single inference pass by maintaining constant memory usage and speed regardless of text length.
  • The core innovation is Reference Sliding Window Attention (R-SWA), which fixes the KV cache size by limiting attention to the last 128 generated tokens while preserving full access to visual reference tokens.
  • Built on the DeepSeek OCR foundation, the model achieves 93% accuracy on OmniDocBench v1.5, outperforming the baseline by six percentage points, particularly in table structure recognition.
  • R-SWA prevents the degradation of visual features caused by standard sliding windows and reduces kernel latency, offering a 12.7% speed increase in Base mode compared to previous systems.
  • While currently limited by a 32,000-token context window, the architecture demonstrates significant potential for extending language model memory efficiency to other reference-based tasks like speech recognition and translation.

Why It Matters

This development addresses a critical scalability bottleneck in end-to-end OCR systems, where traditional language model decoders suffer from linear memory growth and slowing generation speeds as document length increases. By decoupling visual reference retention from output history management, Baidu enables efficient processing of long documents without the computational overhead of page-by-page looping, setting a new standard for high-throughput document understanding.

Technical Details

  • Reference Sliding Window Attention (R-SWA): Unlike standard sliding window attention that shifts all tokens, R-SWA treats visual tokens as static references that remain fully accessible, while the KV cache for generated text acts as a fixed-length queue (last 128 tokens). This prevents the blurring of image features and keeps memory usage constant.
  • Architecture: The model utilizes a frozen DeepEncoder to compress 1024x1024 pixel images into 256 tokens, paired with a Mixture-of-Experts (MoE) decoder containing 3 billion parameters (500 million active). All standard attention layers in the decoder are replaced with R-SWA.
  • Training Data & Setup: Trained on approximately two million document samples (90% single-page, 10% multi-page synthetic stitched documents) using Paddle OCR annotations. Training occurred over 4,000 steps on eight Nvidia A800 GPUs with sequences packed to 32,000 tokens.
  • Performance Metrics: Achieves 93% overall accuracy on OmniDocBench v1.5 and 93.92% on v1.6. In long-horizon tests exceeding 40 pages, the edit distance remains below 0.11. Throughput reaches 5,580 tokens/second in Base mode, surpassing the DeepSeek OCR baseline.

Industry Insight

  • Efficiency Over Scale: The success of R-SWA suggests that future multimodal models should prioritize architectural innovations that manage context windows efficiently rather than simply increasing parameter counts, especially for tasks involving long-form visual-text alignment.
  • Cross-Domain Applicability: The technique of separating static reference inputs from dynamic output histories is likely to be adopted in other domains requiring long-context processing, such as continuous speech recognition or translation of lengthy documents, reducing inference costs significantly.
  • Data Strategy Implications: As OCR becomes more efficient, the ability to rapidly digitize and parse large volumes of physical documents will accelerate the creation of high-quality training corpora, potentially intensifying debates around copyright and data sourcing for large language models.

TL;DR

  • 百度发布Unlimited OCR,通过引入参考滑动窗口注意力(R-SWA)机制,实现了单次推理处理数十页文档且内存与速度恒定。
  • R-SWA仅保留最近128个生成token的KV缓存,同时固定视觉参考token,解决了传统端到端OCR中KV缓存随长度线性增长导致的性能瓶颈。
  • 基于DeepSeek OCR架构,该模型在OmniDocBench v1.6上达到93.92%准确率,长文档错误率低于0.11,推理速度比基线提升12.7%。
  • 尽管受限于32,000 token上下文窗口,但该技术证明了固定窗口注意力在长文本OCR中的有效性,并计划扩展至语音识别等其他参考型任务。

为什么值得看

这篇文章揭示了突破端到端OCR长文本处理瓶颈的关键技术创新,为处理超长文档提供了高效且低成本的解决方案。对于AI从业者和行业而言,其提出的R-SWA机制不仅优化了OCR性能,更展示了如何通过改进注意力机制来降低大模型在处理长序列时的显存占用和计算延迟,具有广泛的迁移应用价值。

技术解析

  • 核心架构创新:采用参考滑动窗口注意力(R-SWA),将KV缓存设计为固定长度的队列。生成的每个token可以查看所有参考token(图像和提示),但仅关注最近128个已生成的输出token,从而将KV缓存大小限制为前缀长度加窗口大小,避免随输出长度线性增长。
  • 模型基础与参数:基于开源DeepSeek OCR构建,保留冻结的DeepEncoder(将1024x1024像素PDF压缩为256个token),解码器替换为30亿参数的混合专家(MoE)架构,推理时仅激活约5亿参数。
  • 训练数据与配置:使用约200万文档样本进行训练,单页与多页数据比例为9:1。多页数据通过合成拼接2至50页的单页文档生成,所有数据打包为32,000 token序列,在8张Nvidia A800 GPU上训练4,000步。
  • 性能基准表现:在OmniDocBench v1.6上得分93.92%,超越基线6个百分点。在40页以上的长文档测试中,编辑距离保持在0.11以下,表格结构识别准确率显著提升。Base模式下推理速度达5,580 tokens/秒,优于DeepSeek OCR的4,951 tokens/秒。

行业启示

  • 长上下文处理的范式转变:传统依赖无限KV缓存的端到端模型在长文本场景下存在显著的效率天花板。通过类似R-SWA的局部注意力机制,可以在保持精度的同时大幅降低资源消耗,这为其他需要处理长序列的任务(如长对话、大文档翻译)提供了新的技术路径。
  • OCR技术的竞争焦点转移:随着Mistral、DeepSeek等厂商在OCR领域激烈竞争,技术指标已从单纯的识别准确率转向token效率、长文档处理能力以及复杂版面(如表格、手写体)的理解能力。企业应关注具备高效长文本处理能力的模型以优化成本。
  • 数据合成与预训练策略的价值:利用合成数据解决多页文档标注稀缺问题,并结合冻结编码器仅更新解码器的策略,是一种高效且经济的模型迭代方式。这种“冻结视觉编码+优化语言解码”的思路可推广至其他多模态长序列任务中。

Disclaimer: The above content is generated by AI and is for reference only. 免责声明:以上内容由 AI 生成,仅供参考。

Research 科学研究 Inference 推理 Multimodal 多模态