A Masked Image Reconstruction Network for Document-level Relation Extraction

Liang Zhang, Yidong ChengarXiv 2022 · DOI

Introduction

Document-level Relation Extraction (RE) is a challenging task that requires identifying semantic relationships between entities across multiple sentences. Unlike sentence-level RE, where context is localized, document-level extraction often necessitates complex reasoning over scattered information. For example, to link a person to a specific date of birth, a model might need to synthesize information about their parentage from one sentence and the parent's history from another.

Traditional approaches have utilized document-level graphs or standard Transformer architectures to propagate information. However, these methods often treat entity pairs in isolation, failing to capture the inherent correlations between different relationships (e.g., if $A$ is the father of $B$, and $B$ is the father of $C$, then $A$ is likely the grandfather of $C$). The DRE-MIR framework addresses this by modeling the global relational structure of a document as a cohesive whole.

Methodology

The authors introduce DRE-MIR (Document-level Relation Extraction via Masked Image Reconstruction), a framework that treats the set of all entity-pair features as a 2D image and employs self-supervised reconstruction to learn relational logic.

Architecture and Masked Reconstruction

The core of DRE-MIR is the conceptualization of the entity-pair matrix as an image.

The DRE-MIR architecture utilizes an encoder to build an entity-pair matrix, which is then processed through a masked image reconstruction (MIR) task to learn global relational dependencies.
  1. Encoder Module: Uses a pre-trained language model (such as BERT) to generate entity embeddings and context-aware representations for every possible entity pair in the document.
  2. Entity-Pair Matrix ($M$): These representations are organized into a 2D matrix $M$, where each cell $(i, j)$ contains the features of the relationship between entity $i$ and entity $j$.
  3. Masked Image Reconstruction (MIR): During training, a percentage of cells in $M$ (typically 20%) are randomly masked. An Inference Module is then trained to reconstruct these missing "pixels" based on the surrounding unmasked relations. This task forces the model to internalize the logical dependencies and transitivity inherent in the document's relational structure.

Inference Multi-head Self-Attention (I-MSA)

To enhance the model's reasoning capabilities, the authors replaced standard self-attention with a custom Inference Multi-head Self-Attention (I-MSA) module.

The I-MSA module features specialized attention heads designed to capture specific logical reasoning paths, such as transitivity and symmetry.

The I-MSA module employs four distinct types of "inference heads," each mathematically structured to attend to specific relational paths. For example, some heads focus on transitive paths ($A \to k$ and $k \to B$ to infer $A \to B$), effectively baking formal logic into the neural architecture. This allows the model to perform sophisticated multi-hop reasoning more effectively than standard attention mechanisms.

Experimental Results

The DRE-MIR model was evaluated on three prominent benchmarks: DocRED, CDR, and GDA.

Performance and Reasoning

DRE-MIR achieved state-of-the-art results across all three datasets, notably reaching an F1 score of 62.85 on DocRED. A key highlight is the model's performance on Inter-F1, which measures accuracy on relations spanning multiple sentences. On DocRED, DRE-MIR outperformed previous leading models by a significant margin (3.28 points), demonstrating its superior reasoning capabilities.

Robustness

The model also exhibits remarkable robustness. Even when the masking rate is increased to 50% during testing, the performance degradation is minimal. This suggests that the model has successfully learned to "restore" the global relational texture of a document even when significant information is missing, relying on the learned logical patterns.

Discussion and Limitations

While DRE-MIR shows strong performance, the authors note that the MIR task is data-intensive. On smaller datasets with fewer entities per document, such as CDR, the entity-pair matrix can be sparse, which may slightly diminish the effectiveness of the image reconstruction task. Future research will explore applying this masked reconstruction logic to other complex tasks, such as cross-sentence collective event detection.

Conclusion

DRE-MIR represents a significant advancement in document-level relation extraction by reframing the task as a global structure learning problem. Through masked image reconstruction and logic-aware attention heads, the model effectively captures the complex inter-dependencies between relationships, enabling more accurate and robust extraction across long-form documents.

Summary updated

BibTeX
@misc{zhang2022masked,
  author = {Liang Zhang and Yidong Cheng},
  title = {{A Masked Image Reconstruction Network for Document-level Relation Extraction}},
  year = {2022},
  eprint = {2204.09851},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2204.09851},
}
Figure