[Paper Review] ERNIE-Layout: Layout Knowledge Enhanced Pre-training for Visually-rich Document Understanding
ERNIE-Layout proposes a layout knowledge-enhanced pre-training framework for visually-rich document understanding, integrating reading order serialization, spatial-aware disentangled self-attention, and novel pre-training tasks (reading order prediction and replaced regions prediction). It achieves state-of-the-art performance on key information extraction, document question answering, and document classification benchmarks by systematically leveraging layout as a first-class modality beyond positional encoding.
Recent years have witnessed the rise and success of pre-training techniques in visually-rich document understanding. However, most existing methods lack the systematic mining and utilization of layout-centered knowledge, leading to sub-optimal performances. In this paper, we propose ERNIE-Layout, a novel document pre-training solution with layout knowledge enhancement in the whole workflow, to learn better representations that combine the features from text, layout, and image. Specifically, we first rearrange input sequences in the serialization stage, and then present a correlative pre-training task, reading order prediction, to learn the proper reading order of documents. To improve the layout awareness of the model, we integrate a spatial-aware disentangled attention into the multi-modal transformer and a replaced regions prediction task into the pre-training phase. Experimental results show that ERNIE-Layout achieves superior performance on various downstream tasks, setting new state-of-the-art on key information extraction, document image classification, and document question answering datasets. The code and models are publicly available at http://github.com/PaddlePaddle/PaddleNLP/tree/develop/model_zoo/ernie-layout.
Motivation & Objective
- To address the sub-optimal performance in visually-rich document understanding due to insufficient utilization of layout knowledge.
- To improve model generalization by replacing raster-scanning order with layout-aware serialization based on document parsing.
- To enhance cross-modal interaction between text, vision, and layout through a novel spatial-aware disentangled attention mechanism.
- To introduce new pre-training tasks—reading order prediction and replaced regions prediction—that explicitly model layout semantics.
- To achieve state-of-the-art performance across diverse downstream document understanding tasks.
Proposed method
- Introduces a layout-based document parser to serialize input tokens according to human-like reading order, replacing standard raster-scanning order.
- Employs a spatial-aware disentangled self-attention mechanism that separates content and relative position representations for improved layout-aware attention computation.
- Proposes a reading order prediction (ROP) task to predict the next token in the serialized sequence, encouraging learning of sequential and structural document knowledge.
- Introduces a replaced regions prediction (RRP) task to learn fine-grained cross-modal alignment between text, layout, and visual features.
- Combines standard masked visual-language modeling and text-image alignment tasks within a unified multi-modal pre-training objective.
- Uses layout embeddings and position embeddings as input features, with layout-aware attention enabling richer spatial context modeling.
Experimental results
Research questions
- RQ1Can replacing raster-scanning order with layout-aware serialization improve downstream document understanding performance?
- RQ2Does integrating layout as a first-class modality through spatial-aware disentangled attention enhance model performance?
- RQ3To what extent do novel pre-training tasks like reading order prediction and replaced regions prediction contribute to layout-aware representation learning?
- RQ4How does the integration of layout knowledge across serialization, attention, and pre-training tasks affect performance on diverse document understanding tasks?
- RQ5Can layout-enhanced pre-training achieve state-of-the-art results across key information extraction, document question answering, and document classification benchmarks?
Key findings
- ERNIE-Layout achieves state-of-the-art performance on the FUNSD dataset with a F1 score of 0.9171, outperforming previous methods.
- On the CORD dataset, ERNIE-Layout achieves a F1 score of 0.9678, demonstrating strong generalization across complex document layouts.
- For document question answering on DocVQA, ERNIE-Layout achieves the highest ANLS score on the leaderboard with ensemble inference, significantly outperforming prior models.
- On the RVL-CDIP document image classification benchmark, ERNIE-Layout sets a new state-of-the-art accuracy, indicating strong macro-level document understanding.
- Ablation studies show that reading order prediction (ROP) contributes a 1.3% F1 improvement on FUNSD, and spatial-aware disentangled attention boosts performance by further gains.
- The use of layout-aware serialization (via Document-Parser) improves performance even without disentangled attention, proving its independent effectiveness.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.