Introduction
Relation Extraction (RE) is a fundamental task in Natural Language Processing, focused on identifying semantic relationships between entities in text. For example, from the sentence "SpaceX was founded in 2002 by Elon Musk," a model should extract the triplet (SpaceX, founded_by, Elon Musk). While modern neural models have achieved impressive scores on RE benchmarks, this research investigates whether these models are truly understanding linguistic context or simply exploiting statistical shortcuts related to entity names.
The Pilot Study: Identifying the "Name Leakage" Problem
The authors first conducted a pilot study to determine the extent to which models rely on entity mentions versus textual context. They evaluated three representative architectures—CNN, BERT, and "Matching the Blanks" (MTB)—under three restricted input conditions:
- Only Context (OnlyC): Entity names are replaced with generic tokens (e.g.,
[SUBJ],[OBJ]). - Only Mention (OnlyM): Only the entity names are provided; the rest of the sentence is removed.
- Only Type (OnlyT): Only the entity types (e.g., Organization, Person) are provided.
Results showed that models performed surprisingly well using OnlyM, suggesting that existing benchmarks like TACRED allow models to "cheat" by memorizing that certain entity pairs (like "SpaceX" and "Elon Musk") are frequently associated with specific relations, regardless of the surrounding text.
Proposed Method: Contrastive Pre-training (CP)
To address this bias, the researchers developed an entity-masked contrastive pre-training (CP) framework. The goal is to force the model to learn abstract relational patterns that generalize across different entities.
As illustrated above, the CP framework uses contrastive learning to pull representations of sentences expressing the same relation closer together in vector space, while pushing those with different relations apart. Crucially, the model randomly masks entity mentions (with 70% probability) during pre-training. This prevents the model from rote-memorizing specific entity names and forces it to focus on the relational indicators in the context (e.g., "was started by" or "is the founder of").
Experimental Results
The CP framework was evaluated against standard BERT and MTB across several diverse benchmarks, including TACRED, SemEval-2010, Wiki80, and the biomedical dataset ChemProt.
Key findings from the experiments include:
- Low-Resource Dominance: CP showed massive gains in data-scarce scenarios. On TACRED with only 1% of training data, CP achieved an F1 score of 0.485, compared to BERT's 0.211.
- Few-Shot Success: On the FewRel 1.0 benchmark, CP reached 0.912 accuracy, significantly outperforming previous state-of-the-art methods.
- Cross-Domain Robustness: Despite being pre-trained on general Wikipedia text, CP performed exceptionally well on the specialized ChemProt dataset, suggesting it learned universal relational patterns that transcend specific domains.
Conclusion
This study demonstrates that neural RE models are often biased toward entity names rather than context. By employing entity-masked contrastive pre-training, the authors successfully shifted the model's focus toward textual context. This approach not only improves performance on standard benchmarks but also significantly enhances model robustness and effectiveness in low-resource and cross-domain settings.
Summary updated