Abstract
Few-shot relation classification (RC) aims to identify semantic relationships between entities using only a few labeled examples. While Distant Supervision (DS) provides a way to generate large-scale data, it introduces significant noise that degrades the performance of standard few-shot models. We present HATT-Proto, a hybrid attention-based prototypical network that incorporates instance-level and feature-level attention. This dual-attention mechanism allows the model to filter out noisy instances and focus on discriminative features. Experimental results on the FewRel dataset demonstrate that HATT-Proto significantly outperforms baseline models, particularly in high-noise scenarios, and exhibits faster convergence.
Introduction
Relation Classification (RC) is a fundamental task in information extraction, identifying relationships such as founder or place_of_birth between entities in text. Traditional supervised methods require extensive manual labeling, which is often impractical. Distant Supervision (DS) offers an automated alternative by aligning knowledge bases with text, but it frequently produces "noisy" labels where the target relation is not actually expressed.
Few-Shot Learning (FSL) is a promising paradigm for handling "long-tail" relations with sparse data. However, existing FSL models, often designed for clean image datasets, struggle with the inherent noise and diversity of textual data. When provided with noisy support sets, standard prototypical networks fail to form accurate class representations.
Methodology: Hybrid Attention-Based Prototypical Networks
The proposed HATT-Proto model enhances vanilla Prototypical Networks by introducing two attention layers designed to mitigate noise and handle data sparsity.
Instance-Level Attention
In a standard prototypical network, a class prototype is the simple mean of its support instance embeddings. A single noisy outlier can significantly skew this mean. HATT-Proto employs instance-level attention to calculate the relevance of each support sentence relative to a query sentence. Noisy or irrelevant sentences receive lower weights, ensuring the resulting prototype is representative of the true relation.
Feature-Level Attention
Not all dimensions of a word embedding are equally informative for every relation. Feature-level attention identifies and weights the most discriminative dimensions for a specific relation. By learning a custom distance metric for each class, the model can better distinguish between semantically similar relations even with limited data.
Experimental Setup
The model was evaluated using the FewRel dataset, comprising 100 relations and 70,000 instances. The dataset was split into 64 relations for training, 16 for validation, and 20 for testing. To rigorously test robustness, noise was manually injected into the support sets at rates of 10%, 30%, and 50%.
Results and Discussion
HATT-Proto consistently outperformed baselines, including GNNs and vanilla Prototypical Networks, across all noise levels.
Robustness to Noise
On clean data (0% noise), HATT-Proto achieved 90.12% accuracy in 5-way 5-shot tasks. In the high-noise scenario (50% noise), the performance gap widened: HATT-Proto maintained 76.57% accuracy, while the vanilla model dropped to 72.91%. This demonstrates the effectiveness of instance-level attention in filtering out misleading examples.
Training Efficiency
HATT-Proto exhibited significantly faster convergence. As shown in the validation accuracy plots, the model required approximately half the iterations (15,000 vs. 30,000) to surpass the baseline's peak performance. The attention mechanisms likely provide a clearer gradient signal during backpropagation.
Conclusion
HATT-Proto addresses the critical challenge of noise in few-shot relation classification. By combining instance-level filtering with feature-level weighting, the model creates robust class prototypes that excel in low-data, high-noise environments. Future work includes integrating more advanced encoders like BERT and extending the hybrid attention framework to zero-shot learning tasks.
Summary updated