RCL: Relation Contrastive Learning for Zero-Shot Relation Extraction

Shusen Wang, Bosen Zhang, Yajing Xu, Yanan Wu, Bo XiaoNAACL 2022

Introduction

Relation Extraction (RE) is the task of identifying semantic connections between entities in a sentence (e.g., identifying that "Paris" and "France" share a capital_of relation). While supervised models excel at this, they often fail when encountering "unseen" relations not present in their training data. This challenge is the focus of Zero-Shot Relation Extraction (ZSRE).

The authors of this paper identify two major hurdles in ZSRE: Similar Relations, where unseen relations have overlapping meanings (e.g., member_of vs. part_of), and Similar Entities, where models over-rely on entity names rather than context. To address these, they propose RCL (Relation Contrastive Learning), a framework that significantly reduces representation overlap.

Methodology

RCL uses a multi-task learning approach to create a more discriminative representation space for relations.

The RCL architecture featuring the Relation Classification and Contrastive Learning modules.

Core Components

  • Input Encoding: The model uses a BERT backbone enhanced with "Entity Markers" (special tokens like <e1> and </e1>) to highlight target entities.
  • Contrastive Learning Module: For every sentence, the model generates two slightly different "views" by passing the input through the network twice with different Dropout masks. An InfoNCE-style loss forces the model to pull these two views of the same instance together while pushing them away from all other instances in the batch.
  • Classification Module: Simultaneously, the model performs standard supervised classification on "seen" relations. This ensures the representation space captures broad relational semantics.
  • Minimal Augmentation: Interestingly, the authors found that simple dropout noise worked better than complex data augmentations (like word masking). It provides just enough "jitter" to help the model learn subtle differences without destroying the underlying meaning.

At test time, the model projects sentences with unseen relations into this learned space, and a simple K-Means clustering algorithm groups the novel relations.

Key Results and Insights

RCL set a new high bar for zero-shot relation extraction on two widely-used benchmarks: SemEval2010 Task8 and FewRel.

  • Performance Leap: On SemEval2010 Task8, RCL achieved a 68.02% B³ F1 score, a staggering improvement over the previous state-of-the-art (MTB-BERT) at 45.71%.
  • Clustering Quality: Qualitative success was confirmed via t-SNE visualizations, which showed that RCL creates much tighter, more distinct clusters for unseen relations compared to previous methods.
t-SNE visualizations comparing the representation space of MTB-BERT (left) and RCL (right).

The researchers noted an "Aha" moment regarding dropout: usually a regularization tool, here it acts as a minimal data augmentation that forces the model to be robust to internal variations while remaining sensitive to the actual text. This combination of classification and contrastive losses prevents the representation "overlap" that plagues other models.

Limitations and Future Work

While RCL is highly effective, it currently relies on K-Means, which assumes the number of unseen relations ($K$) is known. In real-world scenarios, this number might be unknown. Additionally, while RCL mitigates entity bias, the representations are still derived from entity-marker positions. Future work could explore integrating external knowledge graphs or further decoupling context from specific entities to enhance generalization.

Summary updated

BibTeX
@inproceedings{wang2022rcl,
  author = {Shusen Wang and Bosen Zhang and Yajing Xu and Yanan Wu and Bo Xiao},
  title = {{RCL: Relation Contrastive Learning for Zero-Shot Relation Extraction}},
  booktitle = {Conference of the North American Chapter of the Association for Computational Linguistics},
  year = {2022},
  doi = {10.18653/v1/2022.findings-naacl.188},
}
Figure