NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

RAPL: A Relation-Aware Prototype Learning Approach for Few-Shot Document-Level Relation Extraction

Shiao Meng, Xuming Hu, Aiwei Liu, Shuang Li, Fukun Ma, Yawen Yang, Lijie Wen

Introduction

Document-level Relation Extraction (DocRE) involves identifying semantic relationships between entities across multiple sentences within a document. While deep learning has advanced this field, standard models require extensive labeled datasets. Few-Shot Document-Level Relation Extraction (FSDLRE) addresses this by attempting to extract relations from only a few examples. Most existing FSDLRE methods rely on metric-based meta-learning, where "prototypes" (representative vectors) are created for each relation class. However, these methods struggle with relational noise—where entity pairs may share multiple irrelevant relations—and the "None-of-the-Above" (NOTA) problem, where a generic vector fails to capture the task-specific boundaries of unrelated entity pairs.

Conceptual comparison between previous methods and RAPL, showing the shift from generic to task-specific NOTA prototypes and relation-aware instances.

Methodology: The RAPL Framework

The Relation-Aware Prototype Learning (RAPL) approach introduces three primary innovations to refine prototype construction and classification boundaries.

1. Instance-Based Prototype Construction

Traditional models often average entity pair embeddings to form prototypes, which can incorporate significant noise from the document context. RAPL utilizes a Relation Encoder to process textual names and descriptions of target relations. This semantic information acts as a query in an attention mechanism, allowing the model to focus on the most relevant parts of the support document. By anchoring the prototype in the linguistic definition of the relation, RAPL ensures that the resulting vector represents the specific relationship rather than just the co-occurrence of entities.

2. Relation-Weighted Contrastive Learning

To improve discriminative power, RAPL employs a contrastive loss function that pushes prototypes of different relations further apart. Crucially, this "push" is weighted by the semantic similarity of the relations. If two relations are linguistically similar (e.g., "Place of Birth" and "Place of Death"), the model applies a stronger contrastive force to ensure the embedding space clearly distinguishes between these potentially confusing classes.

3. Task-Specific NOTA Prototypes

A significant challenge in DocRE is that the vast majority of entity pairs have no target relation. Previous models used a static, generic NOTA prototype. RAPL instead adaptively selects actual NOTA instances from the support documents that are most likely to be confused with the target relations. These instances are fused with learnable base vectors to create a dynamic, task-specific NOTA boundary, significantly reducing false positives.

The RAPL architecture, illustrating the flow from document and relation encoding to prototype generation and classification.

Evaluation and Benchmarking

The authors evaluated RAPL on two benchmarks: FREDo and a newly introduced ReFREDo. The authors developed ReFREDo after identifying significant annotation gaps and errors in the original DocRED dataset upon which FREDo is based. ReFREDo provides a more complete and accurate ground truth for evaluating few-shot performance.

Results and Discussion

RAPL consistently outperformed state-of-the-art baselines, achieving an average F1 score improvement of 2.61%. On the ReFREDo benchmark, RAPL reached a macro F1 of 15.20% in the 1-document in-domain setting, surpassing the best baseline of 13.37%.

Key findings include:

  • Cross-Domain Robustness: RAPL showed superior generalization when trained on news data and tested on scientific papers, indicating that its relation-aware approach is less dependent on domain-specific entity patterns.
  • Scalability: Unlike some baselines that plateau, RAPL demonstrated consistent performance gains as the size of the support set increased.
  • Ablation Success: Removing either the relation-aware attention or the task-specific NOTA generation resulted in significant performance drops, confirming that both components are essential to the model's success.

Conclusion

RAPL demonstrates that incorporating semantic relation descriptions and dynamic NOTA boundaries can significantly enhance few-shot document-level relation extraction. By making prototypes "smarter" and more context-aware, RAPL moves beyond simple averaging of entity pairs toward a more nuanced understanding of relational context. Future work may address the computational overhead of the relation encoder and the potential for end-to-end systems that integrate entity recognition.

Summary updated

BibTeX
@inproceedings{meng2023rapl,
  author = {Shiao Meng and Xuming Hu and Aiwei Liu and Shuang Li and Fukun Ma and Yawen Yang and Lijie Wen},
  title = {{RAPL: A Relation-Aware Prototype Learning Approach for Few-Shot Document-Level Relation Extraction}},
  booktitle = {Conference on Empirical Methods in Natural Language Processing},
  year = {2023},
  doi = {10.18653/v1/2023.emnlp-main.316},
}
Figure