Hierarchical Visual Feature Aggregation for OCR-Free Document Understanding

Jaeyoo Park, Jin Young Choi, Jeonghyung Park, Bohyung Han

Abstract

Understanding documents with complex layouts and tiny text remains a significant challenge for Multimodal Large Language Models (MLLMs). While "OCR-free" approaches—which process document images directly—avoid the pitfalls of external OCR engines, they often face a "scaling wall" where high-resolution processing leads to prohibitive computational costs. This paper presents a framework utilizing Hierarchical Visual Feature Aggregation (HVFA) and novel partial-reading training tasks. By compressing high-resolution visual features into a fixed token budget and teaching the model spatial awareness through relative positioning, the framework achieves state-of-the-art performance across multiple document benchmarks without the typical quadratic increase in LLM attention overhead.

Introduction

Document understanding tasks, such as interpreting forms, charts, and reports, require high-fidelity visual perception. Traditional pipelines rely on Optical Character Recognition (OCR) to convert images to text before processing. However, OCR engines frequently fail on non-standard fonts, handwritten notes, and intricate layouts.

Recent shifts toward OCR-free MLLMs offer a more integrated solution but introduce a resolution dilemma. To capture fine details, models require high-resolution inputs; yet, because LLM attention complexity is quadratic, increasing resolution significantly increases memory usage and latency. Furthermore, long documents often exceed the context window of the underlying LLM, leading to "truncation" where the model fails to process information beyond the initial pages. This research addresses these bottlenecks through efficient feature aggregation and spatially-aware instruction tuning.

Methodology

Hierarchical Visual Feature Aggregation (HVFA)

The core of the proposed framework is the HVFA module, designed to provide the LLM with high-resolution information without increasing the token count. The model processes the document at three distinct scales: a global view, a standard cropped view, and a 2x upscaled "zoomed-in" view.

Instead of passing all high-resolution tokens to the LLM, the HVFA module employs cross-attentive pooling within a feature pyramid. This process "squashes" high-resolution features back into the original lower-resolution token count. To ensure that critical textual and structural information is preserved during this compression, the authors implement a Reconstruction Loss (MSE). This forces the compressed features to retain sufficient data to theoretically reconstruct the original high-resolution image. A critical finding in this architecture was the necessity of a "stop-gradient" operation during the reconstruction task; without it, the model tended to converge on trivial solutions that degraded actual document-reading performance.

Relative Text-Position Tasks

To mitigate the issue of text truncation in long documents, the authors introduced two novel instruction-tuning tasks designed to improve spatial awareness:

  1. Relative Position Task (RPT): The model is prompted to read specific segments of a document (e.g., "Read the text between 40% and 60% of the page").
  2. Position-to-Text (PTP): The model identifies the relative spatial location of a specific sentence (e.g., "This sentence is located at 15%-30%").

By training on these tasks, the model learns to navigate document layouts logically rather than simply attempting to read a continuous stream of text that might be cut off by context limits.

Experimental Results

The framework was trained on a corpus of approximately 650,000 image-instruction pairs and evaluated across 10 diverse benchmarks, including DocVQA, InfoVQA, and ChartQA.

Performance and Efficiency

The proposed method, utilizing backbones such as BLIP-2 and mPLUG-Owl, consistently outperformed previous OCR-free models like UReader. On the DocVQA benchmark, the model improved the Average Normalized Levenshtein Similarity (ANLS) score from 38.7 to 51.4 (using BLIP-2) and reached a peak of 72.7 (using mPLUG-Owl).

Crucially, the HVFA module allowed the model to leverage the benefits of 2x upscaling—which typically results in a 25x increase in computational load for the LLM—while maintaining the original token complexity. Qualitative analysis demonstrated that the model could successfully identify tiny, blurred text in complex infographics where previous models often hallucinated or failed entirely.

Discussion and Conclusion

The success of the HVFA framework suggests that for document understanding, the quality of visual tokens is more important than the quantity. By using cross-attention to pool features, the model learns to prioritize the most informative parts of a high-resolution image for the LLM. Furthermore, the transition from "Full Reading" to "Partial Reading" (via RPT) provides a more robust training signal, preventing the model from ignoring the end of documents.

While the current model is primarily optimized for English and constrained by the fixed architecture of its Vision Transformer (ViT) encoder, it establishes a new standard for efficient, high-resolution document processing. Future work may explore multi-language support and the use of RPT for distilling document-understanding capabilities into even smaller, more mobile-friendly models.

Summary updated

BibTeX
@inproceedings{park2024hierarchical,
  author = {Jaeyoo Park and Jin Young Choi and Jeonghyung Park and Bohyung Han},
  title = {{Hierarchical Visual Feature Aggregation for OCR-Free Document Understanding}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2024},
  url = {https://openreview.net/forum?id=PWkjxjgGLP},
}
Figure