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

Graph-based Model Generation for Few-Shot Relation Extraction

Wanli Li, Tieyun Qian

Introduction

Relation Extraction (RE) is a fundamental task in natural language processing, focused on identifying semantic relationships between entities in text. While deep learning has significantly advanced RE, traditional models require vast amounts of labeled data. Few-Shot Relation Extraction (FSRE) addresses this by requiring models to identify new relations after seeing only a handful of examples (the "support set"). Researchers from Wuhan University have introduced GM_GEN, a novel framework that shifts away from static, global models toward dynamic, task-specific model generation.

The "One-for-All" Problem

Most existing FSRE models follow a "one-for-all" scheme, where a single, large embedding function maps all sentences into a shared space. However, a fundamental discrepancy exists between the complexity of global relation spaces and the specific nuances of a single few-shot task (e.g., a 5-way-1-shot task). A single global model often fails to find the optimal classification boundary for every specific sub-task.

Comparison between existing FSRE methods and the proposed task-specific generation approach.

As illustrated above, GM_GEN decouples universal knowledge from task-specific logic. Instead of using one massive model for every task, it uses a general model to "generate" tiny, task-specific models custom-tailored to the specific entities and relations at hand.

The GM_GEN Framework

The GM_GEN (Graph-based Model Generation) architecture consists of three primary stages designed to capture both semantic attributes and relational topology:

  1. Encoder: A Pre-trained Language Model (PLM), such as BERT, transforms raw sentences and relation descriptions into initial vector representations (embeddings).
  2. Graph-based Generation Module: This module acts as the core "generator." It constructs a graph where nodes represent support instances, query samples, and relation descriptions. By utilizing bilinear transformations and graph convolutions, it captures the complex relationships (topology) and semantic features (attributes) of the specific task.
  3. Task-Specific Model Generation: Rather than outputting a direct classification, the general model outputs a set of weights. These weights constitute a "tiny" classification model specifically optimized for the current few-shot task.
Overview of the GM_GEN model architecture and the internal graph-based generation module.

The "Secret Sauce": Task-Specific Fine-Tuning

A critical component of the framework is the testing phase. The generated tiny models are further fine-tuned on the provided support samples. This "last-mile" adaptation allows the task-specific model to reach an optimal state for its specific domain without losing the universal knowledge embedded by the general generator.

Experimental Results

The framework was evaluated on two major benchmarks: FewRel 1.0 (in-domain Wikipedia data) and FewRel 2.0 (cross-domain data, testing on biomedical PubMed text).

  • State-of-the-Art Performance: GM_GEN achieved 94.89% accuracy on FewRel 1.0 (5-way 1-shot) and 96.96% on 5-way 5-shot tasks.
  • Robustness to Domain Shift: On the challenging FewRel 2.0 biomedical task, the model reached 76.67% accuracy, significantly outperforming previous baselines like HCRP and demonstrating superior generalization to new vocabularies.
  • Ablation Insights: Removing the graph module or the fine-tuning step led to significant performance drops, confirming that both relational topology and the decoupling strategy are essential for success.

Conclusion

GM_GEN represents a paradigm shift in Few-Shot Relation Extraction. By moving from a static "one-size-fits-all" model to a dynamic generation framework, the system avoids the performance plateaus of global models. While future work may address hyperparameter sensitivity and computational overhead during inference, GM_GEN sets a new standard for how models can "learn to learn" in data-scarce environments.

Summary updated

BibTeX
@inproceedings{li2022graph,
  author = {Wanli Li and Tieyun Qian},
  title = {{Graph-based Model Generation for Few-Shot Relation Extraction}},
  booktitle = {Conference on Empirical Methods in Natural Language Processing},
  year = {2022},
  doi = {10.18653/v1/2022.emnlp-main.5},
}
Figure