GMN: Generative Multi-modal Network for Practical Document Information Extraction

Haoyu Cao, Jiefeng Ma, Antai Guo, Yiqing Hu, Hao Liu, Deqiang Jiang, Yinsong Liu, Bo Ren

Abstract

Document Information Extraction (DIE) has traditionally been framed as a sequence labeling task, which often suffers from sensitivity to reading order, OCR errors, and a lack of flexibility for unseen categories. This paper introduces the Generative Multi-modal Network (GMN), a framework that treats DIE as a generative translation problem. By decoupling text, layout, and visual modalities and employing a novel 2D spatial encoding (Cord2Vec), GMN demonstrates superior robustness to complex layouts and noisy OCR. Experimental results show that GMN achieves state-of-the-art performance on standard benchmarks and significantly outperforms traditional models in zero-shot scenarios involving unseen document keys.

Introduction

Extracting structured data from documents such as receipts, invoices, and forms is a critical component of enterprise automation. For years, the dominant paradigm for this task has been Sequence Labeling (SL), where models classify individual tokens into predefined categories. However, real-world documents present challenges—ambiguous reading orders, poor OCR quality, and evolving document formats—that expose the fundamental limitations of the SL approach.

The Generative Multi-modal Network (GMN) proposes a paradigm shift: viewing DIE as a translation task. Instead of labeling existing tokens, GMN generates the structured output directly, allowing it to correct errors and adapt to novel information structures.

The Pitfalls of Sequence Labeling

Traditional SL methods rely on four assumptions that often fail in practice:

  1. Serialization Sensitivity: Models require a deterministic "reading order" (e.g., top-to-bottom, left-to-right). In complex layouts with tables or sidebars, this order is often incorrectly inferred.
  2. OCR Fragility: SL models are bound to the characters provided by the OCR engine. If "Total" is misread as "T0tal," the model may fail to classify it correctly.
  3. Label Dependency: These models require dense, word-level annotations, which are expensive and time-consuming to produce.
  4. The "Unseen Key" Problem: SL models are restricted to a fixed vocabulary of labels. They cannot extract information for a category (key) that was not present during training.

The GMN Framework

GMN addresses these issues through a generative architecture based on UniLM, incorporating several key innovations:

Cord2Vec: Unified Layout Embedding

To eliminate reliance on 1D sequence order, GMN introduces Cord2Vec. This method uses 2D coordinates—including top-left and bottom-right points along with box dimensions—to represent spatial information. By removing 1D positional embeddings, the model becomes invariant to the order in which words are processed, relying instead on their physical location on the page.

MD-Bert and Modal-aware Masking

Multi-modal models often struggle when one modality is noisy. GMN utilizes Modal-decoupling Bert (MD-Bert) and a Modal-aware Mask Module (MAMM). Rather than simply concatenating features, MAMM processes attention scores for text, layout, and visual modalities separately before fusion. This prevents noise in one modality (e.g., a blurry image) from degrading the representation of another (e.g., clear text).

NER-LM Pre-training

The model undergoes a specialized pre-training task called NER-LM. This task requires the model to predict entity types and their corresponding values simultaneously. This strengthens the semantic link between keys and values, which is essential for accurate generative extraction.

Experimental Evaluation

GMN was pre-trained on the IIT-CDIP (6 million documents) and the Enron Email Dataset. Evaluation was conducted on several benchmarks:

  • SROIE & CORD: Standard receipt extraction tasks.
  • FUNSD-R: A revised version of the FUNSD dataset designed to test key-value pair extraction, featuring 267 keys present only in the test set.
  • SROIE-S & CORD-S: "Shuffled" versions of standard datasets where word order is randomized to test spatial robustness.

Results and Insights

GMN established new state-of-the-art (SOTA) benchmarks, notably achieving an F1 score of 0.9821 on SROIE.

Robustness to Layout Complexity

On the shuffled SROIE-S dataset, traditional sequence labeling models experienced significant performance degradation. In contrast, GMN maintained an F1 score of 0.9550, demonstrating that its 2D spatial encoding effectively captures document structure regardless of token serialization.

Generative Error Correction

A unique advantage of the generative approach is its ability to "fix" OCR mistakes. Because the decoder generates text based on learned semantic context, it can output the correct string (e.g., "GUCCI") even if the input OCR was corrupted (e.g., "GUUC1").

Zero-Shot Extraction

The most striking result occurred on the FUNSD-R dataset. While traditional SL models achieved an F1 of 0 for unseen keys (as they cannot predict labels they haven't been trained on), GMN achieved an F1 of 0.5333. The model's ability to generate the key name and value allows it to handle novel document types out of the box.

Conclusion

GMN represents a significant advancement in Document Information Extraction by moving beyond the constraints of sequence labeling. By leveraging generative translation and robust 2D spatial embeddings, it provides a practical solution for processing messy, real-world documents. While challenges remain in resolving highly ambiguous semantic cases, GMN's ability to handle noisy OCR and unseen categories sets a new standard for the field.

Summary updated

BibTeX
@inproceedings{cao2022gmn,
  author = {Haoyu Cao and Jiefeng Ma and Antai Guo and Yiqing Hu and Hao Liu and Deqiang Jiang and Yinsong Liu and Bo Ren},
  title = {{GMN: Generative Multi-modal Network for Practical Document Information Extraction}},
  booktitle = {Conference of the North American Chapter of the Association for Computational Linguistics},
  year = {2022},
  doi = {10.18653/v1/2022.naacl-main.276},
}
Figure