Introduction
Relation Extraction (RE) is a fundamental task in natural language processing, serving as a cornerstone for knowledge graph construction and information retrieval. Traditionally, RE systems rely on supervised learning with large-scale, human-annotated datasets. However, these systems are often constrained by a fixed set of relations defined during training. When encountering new, "unseen" relations in the wild, traditional models typically fail to generalize.
While previous research has explored Zero-Shot Relation Classification (ZeroRC)—where a model identifies a relation given a sentence and its entities—this setting is often too narrow for real-world applications. In practice, we often face Zero-Shot Relation Triplet Extraction (ZeroRTE), where the model must identify the head entity, the tail entity, and the relation simultaneously from raw text, even if the relation was never seen during training. This paper introduces RelationPrompt, a framework that leverages the latent knowledge of pre-trained language models (PLMs) to address the ZeroRTE challenge by generating synthetic training data.
Methodology
RelationPrompt adopts a two-stage pipeline that treats large language models as automated data generators, transforming a zero-shot problem into a supervised learning task.
1. Relation Generation (GPT-2)
To bridge the gap between seen and unseen relations, the authors utilize a Relation Generator based on GPT-2. The model is first fine-tuned on "seen" relations using a structured prompt format:
Relation: [Label] -> Context: [Sentence], Head: [Entity], Tail: [Entity]
Once the model learns this structure, it is prompted with the labels of unseen relations. By leveraging the vast world knowledge acquired during pre-training, the generator "dreams up" synthetic training examples (sentences and entity pairs) that correspond to these new relation types. This process effectively "exports" the model's internal semantic understanding into a structured dataset.
2. Relation Extraction and Triplet Search Decoding (BART)
The second stage involves a Relation Extractor based on BART. This model is initially trained on the original "seen" data and subsequently fine-tuned on the synthetic data generated in the first stage.
A significant challenge in generative RE is that synthetic data often contains only one triplet per sentence, whereas real-world data is frequently multi-triplet. To resolve this, the authors developed Triplet Search Decoding. Instead of standard greedy or beam search, this specialized decoding strategy allows the model to branch out:
- Head Identification: The model identifies multiple potential head entities.
- Tail Search: For each identified head, it searches for corresponding tail entities.
- Relation Prediction: It predicts the relation for each valid pair.
By applying a probability threshold to these paths, the model can extract multiple triplets from a single sentence at inference time, despite being trained primarily on single-triplet synthetic examples.
Experimental Setup
The framework was evaluated on two benchmark datasets adapted for the zero-shot setting:
- FewRel: A high-quality, human-annotated dataset.
- Wiki-ZSL: A larger, noisier dataset constructed via distant supervision from Wikipedia and Wikidata.
The researchers tested the models across varying numbers of unseen relations ($m = 5, 10, 15$) to assess scalability and robustness as the complexity of the zero-shot environment increased.
Key Results and Insights
RelationPrompt established a new state-of-the-art for the ZeroRTE task, demonstrating several key advantages:
- Performance Gains: On the FewRel dataset ($m=5$), RelationPrompt achieved an F1 score of 22.34 for multi-triplet extraction, nearly doubling the performance of the "NoGen" baseline.
- Superior Classification: In the simpler ZeroRC task, the model outperformed the previous state-of-the-art (ZS-BERT) significantly, achieving an 89.30 F1 compared to 77.90 on FewRel.
- Ablation Success: The inclusion of Triplet Search Decoding proved critical; removing it caused F1 scores to drop by nearly 50%, confirming that the decoding strategy is essential for handling the complexity of natural language.
- Scalability: Unlike previous methods that show sharp performance degradation as the number of unseen labels increases, RelationPrompt remained relatively stable, suggesting it captures the underlying semantics of relations more effectively than template-based or embedding-based methods.
Limitations and Future Work
While RelationPrompt represents a significant leap forward, the authors identified areas for further refinement. One primary issue is semantic alignment: the generator occasionally produces entities that fit the general context but do not strictly satisfy the specific relation (e.g., generating a "Political Party" when prompted for a "Political Partner"). Additionally, synthetic data often lacks the vocabulary diversity found in human-written text.
Future research will likely focus on improving the precision of entity span generation and ensuring that synthetic examples more accurately reflect the nuanced constraints of specific relation types.
Summary updated