Multimodal Pre-Training Based on Graph Attention Network for Document Understanding

Zhenrong Zhang, Jiefeng Ma, Jun Du, Licheng Wang, Jianshu Zhang

TL;DR

GraphDoc is a novel multimodal document understanding model that shifts from traditional word-level processing to region-level semantic blocks (like paragraphs or tables). By replacing standard Transformer self-attention with a Graph Attention Network (GAT), it captures local spatial context more efficiently, achieving state-of-the-art results with significantly less pre-training time (10 hours vs. 500 hours for LayoutLMv2).

What Problem Does This Paper Address?

Most contemporary document intelligence models (like the LayoutLM family) treat documents as sequences of individual words. This approach has two major drawbacks:

  1. Computational Complexity: Standard self-attention scales quadratically ($O(n^2)$) with the number of tokens. For text-heavy documents, this becomes a massive bottleneck.
  2. Ignoring Inductive Bias: In a document, a word or block's meaning is usually defined by its immediate neighbors (local context) rather than the entire page. Standard Transformers try to learn this "local-first" relationship from scratch, which is inefficient.

The authors propose that "semantic regions" (text blocks, headings, tables) are better basic units for document understanding than isolated words.

Methods

GraphDoc introduces a multimodal framework that integrates text, layout, and image data through several key components:

  • Region-based Inputs: Instead of words, the model uses semantic regions extracted via OCR.
  • Multimodal Encoders:
    • Textual: Uses a pre-trained Sentence-BERT to generate embeddings for each region.
  • Visual: Uses a Swin Transformer with a Feature Pyramid Network (FPN) to extract visual features from the document image.
  • Gate Fusion Layer: Rather than simply adding or concatenating features, a "gate" mechanism (inspired by GRUs/LSTMs) decides how much information to take from the visual vs. textual modality for each node.
  • Graph Attention Layer (GAT): This is the core innovation. Each semantic region is a node in a graph. Instead of attending to every other node, a node only attends to its top-k nearest neighbors (based on Euclidean distance) and a special Global Node that captures the "big picture" of the document.
  • Pre-training Task: The model is pre-trained using Masked Sentence Modeling (MSM), where 15% of region embeddings are masked, and the model must reconstruct them using surrounding multimodal context.

Datasets

  • Pre-training: 320k unlabeled document images from the RVL-CDIP dataset.
  • Visual Backbone Pre-training: PubLayNet (for document layout detection).
  • Evaluation:
    • FUNSD: Form understanding (noisy scanned forms).
  • SROIE & CORD: Receipt information extraction.
  • RVL-CDIP: Document image classification (16 categories).

Key Insights and Ideas

  • Local Context is King: The GAT architecture enforces a "local-first" inductive bias. By limiting attention to neighbors, the model avoids the noise of distant, irrelevant text blocks while reducing computational overhead.
  • The Global Node Bridge: To prevent the model from becoming too localized, the authors added a "Global Node" connected to every other node. This allows for page-level reasoning (e.g., "Is this a resume or an invoice?") while keeping the rest of the attention sparse.
  • Efficiency Gains: Because the model operates on regions (usually dozens per page) rather than words (hundreds or thousands), it is much faster. GraphDoc reached SOTA performance with only 10 hours of pre-training on 4 A100 GPUs, whereas LayoutLMv2 required roughly 500 hours.

Key Results

GraphDoc achieved state-of-the-art (SOTA) or near-SOTA performance across several benchmarks:

  • SROIE: Achieved an F1 score of 98.45%, setting a new record.
  • FUNSD: Reached an F1 of 87.77%, outperforming LayoutLMv2 (82.76%) and matching/exceeding other heavyweights.
  • RVL-CDIP: Achieved 96.02% accuracy in document classification.
  • Ablation Study: The authors proved that Gate Fusion significantly outperformed simple addition or concatenation, and that jointly optimizing the visual backbone during training (rather than using fixed features) was crucial for performance.

Limitations and Future Work

The authors identified a few "failure cases" that point toward future improvements:

  • Structure Nesting: The model sometimes struggles when subtitles are nested within larger sections (e.g., mislabeling a sub-header as a main header).
  • Labeling Fuzziness: In some datasets (like FUNSD), the distinction between "Question" and "Header" is subjective, leading to model errors that mirror human labeling inconsistencies.
  • Table Complexity: Distinguishing between keys and values in complex, multi-row tables remains a challenge for the current graph structure.

Future work may involve more sophisticated graph construction methods beyond simple Euclidean distance to better capture hierarchical document structures.

Summary updated

BibTeX
@article{zhang2023multimodal,
  author = {Zhenrong Zhang and Jiefeng Ma and Jun Du and Licheng Wang and Jianshu Zhang},
  title = {{Multimodal Pre-Training Based on Graph Attention Network for Document Understanding}},
  journal = {IEEE Trans. Multimedia},
  year = {2023},
  doi = {10.1109/tmm.2022.3214102},
}
Figure