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

Unleashing the Power of Large Language Models in Zero-shot Relation Extraction via Self-Prompting

Siyi Liu, Yang Li, Jiang Li, Shan Yang, Yunshi Lan · DOI

Abstract

Relation Extraction (RE) remains a challenging task in natural language processing, particularly in zero-shot settings where models must identify relationships between entities without prior task-specific training. While Large Language Models (LLMs) possess vast internal knowledge, generic prompting often fails to capture the nuanced context required for complex RE tasks. This paper explores the "Self-Prompting" framework, a novel approach that enables LLMs to bootstrap their own performance by generating, filtering, and rephrasing synthetic in-context demonstrations. Our results demonstrate that this method significantly outperforms traditional zero-shot prompting and specialized state-of-the-art models across multiple benchmarks.

Introduction

Relation Extraction (RE) involves identifying the semantic relationship between two entities within a sentence—for instance, determining that "The Louvre" and "Paris" share a location relationship. In a zero-shot scenario, the model is tasked with identifying relations it has never explicitly encountered during training.

While LLMs are inherently capable of zero-shot reasoning, they often struggle with RE because standard prompts (e.g., "What is the relation between X and Y?") lack the structural and semantic guidance necessary to navigate complex linguistic patterns. Previous research has attempted to mitigate this through Question-Answering (QA) formulations or self-consistency checks. However, these methods often fail to provide the model with sufficient context-specific examples. The Self-Prompting framework addresses this by leveraging the LLM’s own internal knowledge to generate high-quality, diverse synthetic data that serves as a guide during inference.

The Self-Prompting Framework

The Self-Prompting framework utilizes a three-stage pipeline designed to create a robust set of synthetic demonstrations that "unleash" the relational knowledge already present within the LLM.

1. Relation Synonym Generation

To broaden the model's semantic understanding, the framework first prompts the LLM to generate synonyms for each target relation. For example, the relation Location might be expanded to include phrases like "situated at," "found within," or "resides in." This ensures the model recognizes the relation across various lexical expressions.

2. Pseudo-Sample Generation and Entity Filtering

The LLM then generates synthetic sentences for these relations. A critical challenge in synthetic data generation is the tendency for models to become "lazy," repeatedly using common entities (e.g., "Paris," "London," or "Apple"). To combat this, the authors implement an Entity Filtering mechanism. This step discards samples containing high-frequency entities, forcing the model to generate a more diverse and "long-tail" dataset that better reflects the complexity of real-world language.

3. Sentence Rephrasing

Finally, the generated sentences are rephrased into multiple structural variants. This step introduces linguistic variety, ensuring the model can identify a relation whether it is stated explicitly or subtly implied through different syntactic structures.

Inference via Retrieval

During the testing phase, the system does not use a static prompt. Instead, when a real test sentence is processed, the framework retrieves the most semantically similar synthetic samples from its generated pool. These samples are prepended to the prompt as in-context demonstrations, providing the LLM with a customized set of "hints" tailored to the specific query.

Experimental Evaluation

The framework was evaluated on four major RE benchmarks: FewRel, Wiki-ZSL, TACRED, and SemEval.

Key Results

The Self-Prompting framework consistently established new state-of-the-art (SoTA) benchmarks for zero-shot RE:

  • Wiki-ZSL: With 15 unseen relations, the framework achieved an F1 score of 68.70, vastly outperforming the vanilla prompt (59.01) and specialized methods like SumAsk (41.85).
  • FewRel: The method reached an F1 of 76.76, compared to 65.48 for standard prompting.
  • SemEval: Self-Prompting achieved an F1 of 52.7, the highest recorded among zero-shot RE methods.
  • Model Agnosticism: Testing on the Qwen model series (1.8B to 14B parameters) showed that smaller models benefited most significantly. The Qwen-1.8B model saw an average F1 improvement of 14.57%, suggesting that self-prompting is an effective way to enhance the capabilities of smaller, more efficient models.

Discussion and Insights

Quality Over Volume

A primary finding of this research is that the quality of synthetic data is more important than the quantity. The authors observed an "Unrefined Penalty": using raw, unfiltered synthetic data can actually result in worse performance than simple vanilla prompts. The Entity Filtering and Rephrasing steps are essential for creating a dataset that truly aids the model's reasoning.

Cost-Effectiveness

One of the most compelling aspects of the Self-Prompting framework is its efficiency. Generating a comprehensive synthetic dataset for 113 relations cost approximately $30 using the GPT-3.5 API. This represents a massive reduction in cost compared to traditional human-annotated datasets, which can cost thousands of dollars and take weeks to produce.

Limitations and Future Work

Despite its success, the framework faces challenges regarding retrieval noise. If the system retrieves irrelevant synthetic samples during inference, it can lead to incorrect predictions. Future work will focus on refining the similarity-based retrieval logic. Additionally, while the method excels in general domains like Wikipedia, its efficacy in highly specialized fields (e.g., medical or legal) remains to be tested, as LLMs may struggle to generate accurate synthetic data for niche technical relations.

Conclusion

The Self-Prompting framework demonstrates that LLMs can serve as their own teachers. By carefully curating synthetic demonstrations through filtering and rephrasing, researchers can significantly bridge the gap in zero-shot Relation Extraction, providing a scalable, cost-effective, and high-performance alternative to traditional supervised learning.

Summary updated

BibTeX
@inproceedings{liu2024unleashing,
  author = {Siyi Liu and Yang Li and Jiang Li and Shan Yang and Yunshi Lan},
  title = {{Unleashing the Power of Large Language Models in Zero-shot Relation Extraction via Self-Prompting}},
  booktitle = {Conference on Empirical Methods in Natural Language Processing},
  year = {2024},
  doi = {10.18653/v1/2024.findings-emnlp.769},
}
Figure