RTPrune is a training-free, two-stage token pruning method designed to accelerate DeepSeek-OCR without sacrificing its high-fidelity text recognition capabilities. By mimicking the model’s "reading-twice" behavior, RTPrune achieves a 1.23× prefill speedup while maintaining 99.47% accuracy on complex document parsing tasks.
The Challenge: Efficiency vs. Exhaustive Reconstruction
Vision-Language Models (VLMs) like DeepSeek-OCR are highly effective at converting images into text, but they face a fundamental efficiency paradox. Processing high-resolution documents generates hundreds of visual tokens, many of which represent redundant information such as empty margins, background textures, or repetitive structural patterns.
While token pruning methods exist to eliminate redundant data in general VLMs (often used for Chat or Visual Question Answering), these methods fail when applied to Optical Character Recognition (OCR). In a VQA task, a model might only need to analyze a small fraction of an image to answer a prompt. OCR, however, demands exhaustive reconstruction. If a pruning algorithm accidentally deletes a token containing a single comma or mathematical symbol, the entire output becomes unreliable. Consequently, applying existing pruning methods to dense document tasks often results in hallucinations, repetitive text, or missing data.
The Solution: RTPrune and the "Reading-Twice" Philosophy
To address this, the authors introduce RTPrune, a method built on a "Reading-Twice" philosophy. By analyzing the internal attention mechanisms of DeepSeek-OCR, researchers discovered a distinct two-stage reading trajectory: the model's Large Language Model (LLM) layers initially focus on high-energy tokens (those with a high $\ell_2$-norm) and subsequently redistribute attention to the remaining tokens in deeper layers to fill in fine-grained details.
RTPrune operationalizes this insight through three key components:
- Dominant Token Selection: Instead of relying on complex attention scores, RTPrune ranks tokens by their embedding $\ell_2$-norm. High-norm tokens act as "anchors" that capture the most salient textual and structural information.
- Optimal Token Merging (OTM): Rather than simply discarding non-dominant tokens, RTPrune employs Optimal Transport theory (specifically the Sinkhorn algorithm) to map information from discarded tokens onto the retained ones. This ensures that even when a token is pruned, its features are aggregated into a surviving neighbor, preserving the crucial fine-grained cues necessary for accurate OCR.
- Dynamic Pruning Ratio: Recognizing that not all images require the same level of processing, RTPrune calculates a custom pruning ratio for every image. It evaluates inter-token similarity (feature repetitiveness) and textual density (using a Sobel operator to detect edges and strokes). A blank page is pruned aggressively, whereas a dense academic paper is handled with minimal pruning.
Key Insights
- The $\ell_2$-Norm as a Proxy for Importance: A surprising finding is that the $\ell_2$-norm of a visual token is a highly effective proxy for its importance in DeepSeek-OCR. This likely occurs because DeepSeek-OCR retrains its vision encoder specifically for text compression, causing informative tokens to stand out energetically.
- Merging Over Deleting: In OCR, pruning is better conceptualized as compression. By merging tokens rather than deleting them, the model maintains a holistic view of the image, preventing the omission errors common in standard pruning methods.
- Layer-wise Divergence: Different LLM layers attend to different subsets of tokens. Standard pruning, which typically occurs once at the beginning, often fails because it cannot predict what deeper layers might need. RTPrune's merging strategy bypasses this limitation by keeping information available in a condensed form.
Results and Performance
The authors evaluated RTPrune across several rigorous OCR benchmarks, including OmniDocBench (diverse PDF parsing), olmOCR-Bench (PDF content extraction), and Ocean-OCR (document extraction, scene text, and handwritten text).
RTPrune establishes a new state-of-the-art for efficient OCR inference:
- High Fidelity: On OmniDocBench, RTPrune maintained 99.47% of the original model's accuracy while retaining only ~84% of the tokens.
- Speedup: It achieved a 1.23× faster prefill time (the initial stage of LLM processing where visual tokens are ingested).
- Computational Savings: GFLOPs (computational operations) were reduced by nearly 15.29%.
- Generalizability: While tailored for DeepSeek-OCR, RTPrune also proved effective on other models like LightOnOCR and GLM-OCR, preserving over 92% of their performance while accelerating inference.
Limitations and Future Directions
Despite its success, the authors acknowledge a few limitations. First, the method exhibits architecture specificity; it is highly optimized for models that retrain their vision encoders (like DeepSeek-OCR) and may be less effective on VLMs using frozen vision backbones like standard CLIP. Second, there is an efficiency ceiling. Because OCR is a dense task, pruning cannot be as aggressive as in VQA, meaning speedups (1.23×) are significant but less dramatic than the 2× or 4× gains seen in sparser tasks.
Future work will explore more sophisticated methods to achieve higher inference efficiency without accuracy trade-offs, potentially by investigating how the LLM's Key-Value (KV) cache can be pruned alongside visual tokens.
Summary updated