arXiv:2606.23050cs.CVcs.CL2026-06被引 5

提出无需长序列记忆的OCR模型,可一次处理数十页文档。

Unlimited OCR Works

论文配图:Unlimited OCR Works
图 1 · 摘自论文原文
  • 用参考滑动窗口注意力替代原有注意力,保持恒定缓存
  • 32K长度下单次推理可处理数十页文档,速度不随长度下降
  • 通用解析机制,适用于语音识别、翻译等任务

近期以DeepSeek OCR为代表的端到端OCR模型再次引发关注。普遍观点认为,使用大语言模型作为解码器能利用语言先验提升性能,但弊端也明显:输出序列越长,累积的键值缓存导致内存消耗增加且生成速度下降。这与人类在长文本抄写中无效率衰减的表现形成鲜明对比。本文提出Unlimited OCR,旨在模拟人类的解析工作记忆。以DeepSeek OCR为基础,将解码器中所有注意力层替换为提出的参考滑动窗口注意力(R-SWA),在降低计算成本的同时维持恒定键值缓存。结合DeepSeek OCR编码器的高压缩率与恒定缓存设计,Unlimited OCR可在标准32K最大长度下,单次前向传播完成数十页文档的转录。更重要的是,R-SWA是一种通用解析注意力机制,不仅限于OCR,还可应用于语音识别、机器翻译等任务。代码与模型权重已公开于http://github.com/baidu/Unlimited-OCR。

原文摘要 · Abstract (English)

Recently, end-to-end OCR models, exemplified by DeepSeek OCR, have once again thrust OCR into the spotlight. A widely held view is that employing a large language model (LLM) as the decoder allows the model to leverage the prior distribution of language, leading to improved OCR performance. However, the downside is equally evident: as the output sequence lengthens, the accumulated KV cache drives up memory consumption and progressively slows down generation. This stands in stark contrast to humans, who exhibit no such decline in efficiency during long-horizon copying tasks. In this technical report, we propose Unlimited OCR, a model designed to emulate human parsing working memory. Taking DeepSeek OCR as the baseline, we replace all attention layers in the decoder with our proposed Reference Sliding Window Attention (R-SWA), which reduces attention computation costs while maintaining a constant KV cache throughout the entire decoding process. By combining the high compression rate of DeepSeek OCR's encoder with our constant KV cache design, Unlimited OCR can transcribe dozens of pages of documents in a single forward pass under a standard maximum length of 32K. More importantly, R-SWA is a general-purpose parsing attention mechanism - beyond OCR, it is equally applicable to tasks such as ASR, translation, etc. Codes and model weights are publicly available at http://github.com/baidu/Unlimited-OCR.

OCR注意力机制长序列处理大模型

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。