NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

TextHawk: Exploring Efficient Fine-Grained Perception of Multimodal Large Language Models

Ya-Qi Yu, Minghui Liao, Jihao Wu, Yongxin Liao, Xiaoyu Zheng, Wei ZengarXiv 2024 · DOI

Introduction

Multimodal Large Language Models (MLLMs) like LLaVA and GPT-4V have demonstrated impressive capabilities in general scene understanding. However, they frequently struggle with document-oriented tasks involving PDFs, charts, and tables. These tasks demand high-resolution perception because critical information often resides in minute textual details. Simply increasing input resolution leads to a quadratic explosion in visual tokens, significantly increasing computational costs and latency. TextHawk addresses this "resolution vs. efficiency" challenge by introducing a novel architecture designed for fine-grained perception with massive token compression.

Methodology

TextHawk utilizes a four-pronged architectural approach to achieve sharp yet efficient document perception.

The TextHawk architecture featuring the ReSampling and ReArrangement (ReSA) module and Multi-Level Cross-Attention (MLCA).

ReSampling and ReArrangement (ReSA)

While standard models typically compress visual features by a factor of 4, TextHawk achieves a 16x compression ratio. The ReSA module first resamples features using cross-attention and then rearranges them via concatenation. This allows the model to ingest high-resolution images while maintaining a manageable number of tokens for the LLM backbone.

Scalable Positional Embeddings (SPEs)

To handle arbitrary image aspect ratios and sub-image cropping, TextHawk employs Scalable Positional Embeddings. By using Spherical Linear Interpolation (Slerp), the model smoothly maps spatial positions, ensuring it understands the global context of cropped document segments regardless of their original shape.

Query Proposal Network (QPN) and Multi-Level Cross-Attention (MLCA)

Instead of static learned queries, the Query Proposal Network (QPN) dynamically generates queries based on the specific visual content of the input. Furthermore, the Multi-Level Cross-Attention (MLCA) mechanism extracts features from multiple layers of the visual encoder. This hierarchical approach allows the model to capture both low-level character details and high-level structural layouts simultaneously.

Datasets and Training

TextHawk was trained using a multi-stage pipeline:

  • Pre-training: Alignment on 96 million image-text pairs.
  • Specialized Document Data: Inclusion of 1.28 million OCR images and 1.28 million PDF-to-Markdown pages.
  • DocGemini Dataset: A key contribution is the DocGemini dataset, consisting of 195,000 high-quality QA pairs and summaries generated by Gemini Pro from existing document images.

Key Results and Discussion

TextHawk establishes new benchmarks for open-source MLLMs in the document domain while maintaining strong general-purpose reasoning.

Performance comparison of TextHawk against state-of-the-art MLLMs across various document and general benchmarks.

Performance and Efficiency

On the DocVQA benchmark, TextHawk achieved a state-of-the-art score of 76.4, outperforming previous models like UReader (65.4) and TextMonkey (73.0). Remarkably, it achieves this while using significantly fewer tokens—approximately 160 tokens per image compared to over 1,200 in models like Monkey. This 16x compression suggests that substantial visual redundancy exists in current MLLM architectures, which TextHawk successfully exploits.

Generalization

Unlike many specialized document models, TextHawk does not sacrifice general visual reasoning. It remains highly competitive on benchmarks like MMBench and MME, even outperforming generalist models like LLaVA-1.5.

Conclusion and Future Work

TextHawk demonstrates that efficient, fine-grained perception is achievable through intelligent token compression and multi-level feature extraction. While currently limited by a frozen visual encoder (SigLIP), future iterations will explore unfreezing the vision backbone to learn document-specific features directly and scaling to even larger language model backbones.

Summary updated

BibTeX
@misc{yu2024texthawk,
  author = {Ya-Qi Yu and Minghui Liao and Jihao Wu and Yongxin Liao and Xiaoyu Zheng and Wei Zeng},
  title = {{TextHawk: Exploring Efficient Fine-Grained Perception of Multimodal Large Language Models}},
  year = {2024},
  eprint = {2404.09204},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2404.09204},
}
Figure