arXivDaily arXiv每日学术速递 周一至周五更新
感恩节,周五至周末无更新,大家顺遂。周一再来吧
arXiv 2605.17447cs.CVcs.CL
收藏

FastOCR: 通过KV缓存剪枝实现高效的动态视觉聚焦文档解析

FastOCR: Dynamic Visual Fixation via KV Cache Pruning for Efficient Document Parsing

Tsinghua University(清华大学)

Zihan Tang, Leqi Shen, Hui Chen, Ao Wang, Ben Wan, Yan Feng, Ke Zhang, Sicheng Zhao, Tongxuan Liu, Guiguang Ding

AI总结:

本文提出FastOCR,一种无需训练的框架,通过动态视觉聚焦技术解决文档解析中的高效KV缓存剪枝问题,显著提升处理速度和准确性。

摘要:

视觉-语言模型(VLMs)在光学字符识别(OCR)中展现出强大潜力,但编码密集文档所需的大量视觉令牌导致推理成本过高。现有剪枝方法依赖物理驱逐,例如在prefill阶段永久丢弃视觉令牌。尽管在自然图像上有效,但此策略在OCR中失效,因为几乎每个视觉令牌可能对应一个字符或结构元素,任何不可逆的损失都会导致准确性急剧下降。我们观察到,尽管文档图像看似密集且难以剪枝,模型对它们的注意力实际上在时间上是稀疏的:在每个解码步骤中,它集中在一小块区域,随着步骤逐渐移动,就像人类读者依次聚焦于词语而不是一次性感知整页内容一样。受此动态视觉聚焦现象的启发,我们将不可行的全局剪枝问题转化为可处理的局部动态问题,并提出FastOCR,一种无需训练的框架,包含两个互补模块。具体而言,Focal-Guided Pruning识别少量焦点层,并在每一步从中选择最相关的视觉令牌;Cross-Step Fixation Reuse利用固定点的逐渐移动,从上一步温暖启动。通过动态调整哪些令牌被关注而不是驱逐任何缓存中的令牌,FastOCR避免了永久信息丢失。广泛实验表明,FastOCR作为一种即插即用的加速模块,在五个不同大小和架构的VLMs上表现出一致的泛化能力。在Qwen2.5-VL上,FastOCR在每个解码步骤只关注5%的视觉令牌,保留了未剪枝模型98%的准确性,同时将注意力延迟减少了3.0倍。

英文摘要:

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$.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑