Abstract
Relation extraction (RE), a crucial task in NLP, aims to identify semantic relationships between entities mentioned in texts. Despite significant advancements in this field, existing models typically rely on extensive annotated data for training, which can be both costly and time-consuming to acquire. Moreover, these models often struggle to adapt to new or unseen relationships. In contrast, few-shot learning settings, which aim to reduce annotation requirements, may offer incomplete and biased supervision for understanding target relation semantics, leading to degraded and unstable performance. To provide the model with accurate and explicit descriptions of the relations types and meanwhile minimize the annotation requirements, we study the definition only zero-shot RE setting where only relation definitions expressed in natural language are used to train a RE model. Motivated by the strong synthetic data generation power of LLMs, we propose a framework REPaL which consists of three stages: (1) We utilize LLMs to generate initial seed instances based on relation definitions and an unlabeled corpora. (2) We fine-tune a bidirectional Small Language Model (SLM) using these initial seeds to learn the relations for the target domain. (3) We enhance pattern coverage and mitigate bias resulting from the limited number of initial seeds by incorporating feedback acquired from SLM's predictions on unlabeled corpora. To accomplish this, we leverage the multi-turn conversation ability of LLMs to generate new instances in follow-up dialogues. Experiments on two datasets show REPaL achieves better zero-shot performance with large margins over baseline methods.
Introduction
Relation Extraction (RE)—the task of identifying how entities in a text are connected (e.g., X is the child of Y)—traditionally requires massive amounts of human-labeled data. While "few-shot" and "zero-shot" methods have been developed to mitigate this, they often suffer from partial coverage of relation semantics or rely on unrealistic settings where models assume prior knowledge of all possible test relations. Furthermore, using massive Large Language Models (LLMs) like GPT-4 for direct inference on large-scale datasets is prohibitively expensive and slow.
To address these issues, we introduce the Definition Only Zero-Shot RE setting. In this scenario, the model is provided with only a natural language definition of a single target relation and a collection of unlabeled text. We propose REPaL (RE via Pattern-Augmented LLM), a novel framework that achieves state-of-the-art performance by using an LLM to iteratively synthesize high-quality training data for a smaller, task-specialized model.
Methods: The REPaL Framework
REPaL utilizes a "teacher-student" loop where a giant LLM acts as a data generator (the teacher) for a smaller, more efficient Small Language Model (the student). The framework operates in three distinct stages:
- Definition-Based Seed Construction: An LLM (such as GPT-4o) generates an initial set of positive training instances based on the provided relation definition. Negative instances are randomly sampled from an unlabeled corpus.
- Pattern Learning with a Small Language Model (SLM): A smaller model (e.g., RoBERTa) is trained as a binary classifier using a Natural Language Inference (NLI) approach. It treats the sentence as a "premise" and the relation definition as a "hypothesis" to determine if the relation holds.
- Feedback-Driven Refinement: This core innovation involves running the trained SLM on the unlabeled corpus. Its high-confidence predictions—including potential errors or biases—are fed back to the LLM. Using multi-turn dialogue, the LLM "self-reflects" on these errors to generate rectified positive instances and "near-miss" negative definitions (e.g., distinguishing "spouse" from "sibling") to sharpen the SLM’s decision boundary.
Key Results
We evaluated REPaL on two adapted benchmarks: DefOn-FewRel (80 relations) and DefOn-Wiki-ZSL (113 relations). REPaL significantly outperformed existing zero-shot baselines across both datasets.
On the DefOn-FewRel dataset, REPaL (w/ GPT-4o) achieved a Macro-F1 score of 91.71%, substantially outperforming the GPT-3.5 baseline (53.94%) and specialized zero-shot models like RE-MATCHING (75.11%). Beyond accuracy, REPaL is remarkably cost-efficient. While a pure "RE as QA" approach using GPT-3.5 would cost roughly $260 to process one dataset split, REPaL achieves superior performance for approximately $3.70 by restricting the LLM's role to data synthesis.
Conclusion and Insights
Our research demonstrates that well-crafted natural language definitions are often more "information-dense" than a handful of gold examples. By leveraging the synergy between LLMs and SLMs, REPaL effectively captures the "long-tail" patterns of relations that one-shot generation often misses. The feedback-driven negative instance generation proved critical for reducing false positives and sharpening model precision. Future work will focus on extending this framework to multi-label extraction and complex document-level relations.
Summary updated