通过动态关注文档局部区域,实现高效且不丢信息的OCR推理加速。
FastOCR: Dynamic Visual Fixation via KV Cache Pruning for Efficient Document Parsing

- 基于视觉注意力的时空稀疏性,动态选择关键视觉片段。
- 在保持98%准确率的同时,仅需5%的视觉令牌,提速3.0倍。
- 无需训练,可适配多种大模型,适合高密度文档处理场景。
视觉语言模型(VLM)在光学字符识别(OCR)任务中表现出色,但密集文档所需的海量视觉令牌导致推理成本极高。现有剪枝方法依赖物理淘汰,如在预填充阶段永久丢弃视觉令牌,虽对自然图像有效,但在OCR中会因不可逆损失导致精度灾难性下降。我们观察到,尽管文档图像整体密集,但模型注意力在时间上具有稀疏性:每个解码步骤仅聚焦于逐渐移动的小区域,如同人类逐字阅读。受此动态视觉聚焦现象启发,我们将难以处理的全局剪枝问题转化为可解的局部动态问题,提出FastOCR——一种无需训练的框架,包含两个互补模块:焦点引导剪枝(Focal-Guided Pruning)在每步从少数焦点层中选出最相关视觉令牌;跨步聚焦复用(Cross-Step Fixation Reuse)利用注意力的渐进移动特性,以先前步骤结果热启动当前步骤。通过动态调整关注对象而非永久移除,避免信息丢失。大量实验表明,FastOCR作为即插即用加速模块,在五种不同规模与架构的VLM上均表现一致,对Qwen2.5-VL而言,在保留98%原始精度的前提下,每步仅需5%视觉令牌,注意力延迟降低3.0倍。
原文摘要 · Abstract (English)
Vision-Language Models (VLMs) have shown strong promise on Optical Character Recognition (OCR), yet the sheer number of visual tokens required to encode dense documents incurs prohibitive inference cost. Existing pruning methods rely on physical eviction, e.g., permanently discarding visual tokens during the prefill stage. While effective for natural images, this strategy fundamentally breaks down on OCR, where virtually every visual token may correspond to a character or structural element, and any irreversible loss leads to catastrophic accuracy degradation. We observe that, although document images appear globally dense and seemingly unprunable, the model's attention to them is in fact temporally sparse: at each decoding step it concentrates on a small region that shifts gradually across steps, much as a human reader fixates on successive words rather than perceiving an entire page at once. Motivated by this Dynamic Visual Fixation phenomenon, we recast the intractable global pruning problem as a tractable local, dynamic one and propose FastOCR, a training-free framework with two complementary modules. Specifically, Focal-Guided Pruning identifies a small set of focal layers and selects the most task-relevant visual tokens from them at each step, while Cross-Step Fixation Reuse exploits the gradual shift of fixation to warm-start each step from the previous one. By dynamically adjusting which tokens are attended rather than evicting any from the cache, FastOCR avoids permanent information loss. Extensive experiments show that FastOCR serves as a plug-and-play acceleration module, generalizing consistently across five VLMs of varying sizes and architectures. On Qwen2.5-VL, FastOCR retains 98% of the unpruned model's accuracy while attending to only 5% of the visual tokens per decoding step, reducing attention latency by 3.0$\times$.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。