Unlimited OCR Works

Youyang Yin, Huanhuan Liu, YY, Qunyi Xie, Chaorun Liu, Shiqi Yang, Shaohua Wang, Zhanlong Liu, Hao Zou, Jinyue Chen, Shu Wei, Jingjing Wu, Mingxin Huang, Zhen Wu, Guibin Wang, Tengyu Du, Lei Jia

arXiv:2606.23050 · 2026-06-23 공개 · arXiv · PDF

long-horizon kv-cache memory-efficiency ocr speech-recognition deepseek-ocr document-transcription translation

Abstract

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.

한국어 요약

한 줄 요약

Unlimited OCR은 R-SWA를 통해 32K 길이의 문서를 단일 패스로 처리하며, DeepSeek OCR 대비 6% 성능 향상.

핵심 기여도

핵심 아이디어

기존 OCR 모델은 출력 길이가 늘어날수록 KV 캐시가 누적되어 메모리 소비와 처리 속도 저하가 발생한다. 인간은 장거리 복사 작업에서도 효율성을 유지하므로, 이와 유사한 메커니즘을 모델에 구현해야 한다는 통찰에서 출발했다. R-SWA는 각 토큰이 전체 이미지(참조 토큰)를 참조하면서, 출력 토큰은 이전 128개 토큰만 주목하도록 설계되어, KV 캐시를 일정하게 유지한다. 이는 인간의 자연스러운 주의 흐름을 모방한 것으로, 기존의 전체 어텐션(full attention)이나 선형 어텐션(linear attention)과는 구별된다. 특히, R-SWA는 시각 토큰의 재귀적 업데이트 없이도 정확도를 유지하며, 이는 시각 특징이 퇴화되는 것을 방지한다.

기술적 접근법

주요 결과

의의 및 한계

Unlimited OCR은 장거리 문서 처리에서 기존 모델의 메모리 및 계산 한계를 극복하며, MLLM의 장거리 처리 능력을 향상시킨다. R-SWA는 OCR 외에도 ASR, 번역 등 다양한 작업에 적용 가능하다는 점에서 일반화 가능성이 높다. 그러나 본 연구는 R-SWA의 장거리 처리 능력을 검증한 초기 단계이며, 더 긴 길이나 복잡한 다중 언어 문서에 대한 실험은 아직 수행되지 않았다. 또한, R-SWA의 성능 향상이 모든 데이터셋에서 동일하게 적용되는지에 대한 추가 검증이 필요하다.

실용적 활용

Unlimited OCR은 대규모 문서 처리, 전자책 OCR, 장시간 음성 인식(ASR), 번역 등 장거리 의존성 처리가 필요한 산업 및 연구 분야에 적용 가능하다. 특히, 단일 패스로 수십 페이지를 처리할 수 있어, 문서 스캐닝, 법적 문서 분석, 교육 자료 처리 등에서 실용적 가치가 높다.