Introduction
Extracting relationships from complex documents—such as linking a header to its corresponding value—is a fundamental task in document intelligence. This paper benchmarks two contrasting architectural philosophies: the massive, pre-trained LayoutXLM (a multimodal Transformer) and the lightweight Edge Convolution Network (ECN) (a Graph Neural Network). The study reveals that the specialized GNN, despite being 70 times smaller and requiring no massive pre-training, performs comparably to heavyweight Transformers in realistic scenarios.
The Challenge of Visually Rich Documents
In "visually rich documents" like forms, invoices, and tables, meaning is derived from both textual content and spatial arrangement. Standard NLP models often struggle because they treat text as a linear sequence, failing to account for the fact that a "Question" might be physically positioned above an "Answer" rather than adjacent in the text stream.
The authors focus on Relation Extraction (RE): identifying links between text entities (e.g., connecting "Invoice Number" to "12345"). They investigate whether the current trend of using massive, pre-trained multimodal models is necessary, or if specialized graph-based architectures can handle the task more efficiently.
Methodology: Transformers vs. GNNs
The researchers compared two distinct approaches:
- LayoutXLM (The Heavyweight): A multimodal Transformer incorporating text, 2D positions, and image features. Pre-trained on 11 million document pages, it uses a bi-affine classifier to predict links between all possible entity pairs.
- Edge Convolution Network (ECN) (The Lightweight): A Graph Neural Network (GNN) that treats text blocks as nodes. It constructs a graph using a "line-of-sight" strategy and leverages geometric features—such as distances and area ratios between bounding boxes—to identify valid relations.
Datasets and the "512 Curse"
The primary benchmark used is XFUND, a multilingual extension of the FUNSD dataset containing forms in eight languages. A significant finding is the "512 curse": because LayoutXLM has a maximum sequence length of 512 tokens, long documents must be split. This process destroys approximately 12% of relations in the dataset because related items end up in different "sub-documents."
Key Insights
- Geometry over Semantics: For Relation Extraction, physical layout is often a stronger signal than the semantic meaning of words. In settings where entity labels are provided, the ECN model performed better using geometry alone than LayoutXLM did with text.
- Efficiency and Speed: ECN (1.2M to 5.5M parameters) is roughly 70 times smaller than LayoutXLM-base (354M parameters). It is 30-50% faster to train and avoids the computationally expensive pre-training phase required by Transformers.
Comparative Performance
In realistic testing scenarios (where no pre-provided labels are used), both models showed similar performance. In the multilingual setting, LayoutXLM achieved an F1 score of 71.42, while ECN-XLM reached 71.63. In specific monolingual tests, such as Chinese (ZH), the ECN model significantly outperformed LayoutXLM-base in certain settings.
Limitations and Future Outlook
The authors note that current benchmarks often provide a "perfect" reading order, which may not reflect real-world OCR noise. Future work may involve "cascaded" approaches, combining the feature extraction power of language models with the spatial reasoning of GNNs as specialized decoders.
Summary updated