Abstract
Few-shot relation classification aims to recognize semantic relations between entity pairs using very few samples. While Prototypical Networks offer a simple and effective approach, they often suffer from "biased prototypes" when data is scarce—where the calculated class center deviates significantly from the true distribution. To address this, we propose Hybrid Enhancement-Based Prototypical Networks (HEPN). Our model incorporates three main enhancement modules: a query-guided prototype enhancement module to refine representations using interactive information, a query enhancement module to align distributions between support and query sets, and a support enhancement module utilizing a pseudo-label strategy to expand available data. These are integrated via a novel prototype attention fusion mechanism. Experimental results on the FewRel dataset demonstrate that HEPN achieves state-of-the-art performance by improving both data scale and utilization efficiency.
Introduction
Relation Classification (RC) is a fundamental task in Information Extraction, identifying semantic links between entities (e.g., identifying that "Microsoft" and "Bill Gates" share a founder relationship). While deep learning models excel with abundant data, they struggle in "few-shot" scenarios where only one or five examples per relation are available.
Standard Prototypical Networks represent a relation by averaging the embeddings of its few available samples. However, this average often fails to capture the true essence of the relation class, leading to classification errors. HEPN addresses this by treating the query instance not just as a target to be classified, but as a source of information to refine the class prototypes themselves.
The Challenge of Biased Prototypes
The primary hurdle in few-shot learning is the discrepancy between the available support samples and the broader population of the class. When we only have a handful of sentences for a relation like date_of_birth, the resulting "prototype" is often skewed toward the specific context of those few sentences rather than the general concept of the relation.
As illustrated above, the biased prototype (computed from the limited support set) can be far from the expected prototype (the true center of the class). This gap, combined with the distribution difference between the support set and the query set, significantly degrades model accuracy.
The HEPN Architecture
To mitigate these biases, the HEPN model utilizes a BERT-based sentence encoder followed by a multi-stage enhancement pipeline. Unlike traditional models that use static prototypes, HEPN dynamically adjusts class representations based on the specific query being evaluated.
Core Enhancement Modules
- Query-Guided Prototype Enhancement (QGPE): Instead of treating all support samples equally, QGPE assigns weights to support instances based on their semantic relevance to the current query. This ensures that the prototype is "tuned" to the specific context of the instance being classified.
- Query Enhancement (QE): This module addresses the distribution gap. By calculating a "shifting term"—the difference between the mean of the support set and the query set—the model aligns the query embeddings more closely with the support distribution.
- Support Enhancement (SE): To combat data scarcity, HEPN employs a semi-supervised pseudo-labeling strategy. High-confidence query instances are assigned temporary labels and added to the support set, effectively increasing the sample size for prototype calculation.
- Prototype Attention Fusion: Finally, the model fuses the "basic" prototype (from original data) with the "enhanced" prototype (from pseudo-labeled data). An attention mechanism weights these components to ensure that potentially noisy pseudo-labels do not overwhelm the reliable original data.
Notably, the QE and SE modules are only activated during the inference stage, allowing the model to benefit from increased data scale without complicating the initial training process.
Experimental Results
HEPN was evaluated on the FewRel benchmark, which consists of 100 relations and 70,000 instances. The model demonstrated superior performance across multiple standard configurations:
- 5-way 1-shot: Achieved 94.93% accuracy, a 1.17% improvement over previous state-of-the-art models like HCRP.
- 5-way 5-shot: Reached 97.17% accuracy.
Ablation studies confirmed that the Support Enhancement (SE) module provided the most significant performance boost (averaging a 2.04% gain), highlighting the critical importance of expanding the data scale in few-shot settings. Furthermore, the query-guided approach was found to accelerate model convergence during training.
Conclusion
HEPN effectively addresses the biased prototype problem in few-shot relation classification by maximizing both data scale and utilization efficiency. By treating the query as an active participant in the classification process and leveraging unlabeled data through pseudo-labeling, the model creates more robust and accurate class representations. Future work will explore the integration of external knowledge, such as relation descriptions, and the use of contrastive self-supervised learning to further enhance discriminative power.
Summary updated