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

HyperNetwork-based Decoupling to Improve Model Generalization for Few-Shot Relation Extraction

Liang Zhang, Chulun Zhou, Fandong Meng, Jinsong Su, Yidong Chen, Jie Zhou

Introduction

Relation Extraction (RE) is a fundamental task in Natural Language Processing, aimed at identifying semantic connections between entities in text—for instance, recognizing that "Paris" is the capital of "France." In the "Few-Shot" Relation Extraction (FSRE) paradigm, models must learn to identify new, unseen relations using only a handful of labeled examples. While metric-learning approaches like Prototypical Networks have become standard, they often struggle with a critical issue: overfitting to the specific relations seen during the training phase.

The Overfitting Bottleneck

The authors of this paper identify that a major bottleneck in current FSRE models is their tendency to become hyper-specialized. Through a preliminary study, they analyzed "class separation" ($Sep^l$) across the layers of a BERT-based encoder. Their findings showed that while lower layers retain general linguistic knowledge, the upper layers exhibit increasingly high separation for training classes as training progresses. This specialization makes the model "brittle," hindering its ability to generalize when it encounters entirely different relations during testing or in cross-domain scenarios.

Class separation across BERT layers over training steps. Higher layers (e.g., $l=12$) show significantly more specialization to training classes, indicating a loss of generalizability.

Proposed Method: HyperNetwork-based Decoupling (FSRE-HDN)

To combat this specialization, the authors propose a HyperNetwork-based Decoupling framework. The core philosophy is to explicitly separate the roles of the model components: the encoder provides general, transferable features ("the what"), while a dynamically generated classifier handles the specific relation mapping for a given task ("the which").

Comparison between the standard Prototypical Network (left) and the proposed HyperNetwork-based Decoupling model (right). The latter uses a Generator to produce task-specific classifiers.

The architecture consists of three main parts:

  1. Encoder: A BERT-based backbone that transforms input text into high-dimensional vector representations.
  2. Network Generator (HyperNetwork): A Multi-Layer Perceptron (MLP) that takes relation descriptions as input and generates the initial weights for a task-specific classifier. By "freshly producing" a classifier for every episode, the model avoids locking into a global set of relation parameters.
  3. Class-Agnostic Aligner: To prevent the encoder from biasing itself toward the specific relations in a training batch, the authors added a global MLP layer trained with a contrastive loss. This aligner remains constant across all episodes, acting as a "north star" that encourages the encoder to produce stable, universal representations regardless of the specific task.

The training process employs a Two-Step Strategy. In the first step, the generated classifier is fine-tuned on the "support set" (the few labeled examples) to acquire relation-specific knowledge. In the second step, the encoder and generator are updated based on the model's performance on the "query set" across multiple episodes. This meta-learning approach forces the encoder to focus on learning features that are useful across many different types of relations.

Experimental Evaluation

The proposed model, FSRE-HDN, was evaluated on two gold-standard benchmarks:

  • FewRel 1.0: A large-scale dataset based on Wikipedia, containing 100 relations. FSRE-HDN achieved 95.21% accuracy in the 5-way 1-shot setting (without extra pre-training), a significant jump over the standard Prototypical Network's 80.68%.
  • FewRel 2.0: A more challenging version designed to test domain generalization, where the model is trained on Wikipedia but tested on a completely different Biomedical domain. On this difficult test set, the model achieved 78.37% in the 5-way 1-shot setting, outperforming the previous best model (LPD) by approximately 0.5%.

The results demonstrate that the model's greatest gains occur in "1-shot" scenarios, where data is scarcest. This confirms that the decoupling strategy effectively enhances the model's ability to generalize from minimal information.

Conclusion

By decoupling general linguistic knowledge from specific relation mapping through a HyperNetwork and a class-agnostic aligner, the FSRE-HDN framework significantly improves generalization in few-shot settings. While currently focused on relation extraction, the authors suggest that this decoupling logic could be extended to other few-shot NLP tasks. Future work will also need to address "none-of-the-above" scenarios, where query instances may not belong to any of the provided relation classes.

Summary updated

BibTeX
@inproceedings{zhang2023hypernetwork,
  author = {Liang Zhang and Chulun Zhou and Fandong Meng and Jinsong Su and Yidong Chen and Jie Zhou},
  title = {{HyperNetwork-based Decoupling to Improve Model Generalization for Few-Shot Relation Extraction}},
  booktitle = {Conference on Empirical Methods in Natural Language Processing},
  year = {2023},
  doi = {10.18653/v1/2023.emnlp-main.381},
}
Figure