Abstract
Few-shot learning (FSL) presents a significant challenge in natural language processing, requiring models to generalize from a minimal number of labeled examples. Traditional Prototypical Networks (PROTO) often struggle with noise and instability due to their reliance on randomly sampled support sets. This paper presents Meta-SN, a Meta-Learning Siamese Network framework that stabilizes class representations using external knowledge and refines the embedding space through contrastive learning. By implementing a hard-task sampling strategy and dynamic weighting, Meta-SN achieves state-of-the-art results across multiple benchmarks, significantly outperforming traditional metric-based meta-learning approaches.
1. Introduction
Few-shot text classification aims to categorize text into novel classes using only one or a few examples. A common paradigm is the Prototypical Network, which computes a class "prototype" by averaging the embeddings of available support samples. While effective in some contexts, this approach is highly sensitive to the quality of the selected samples. If a support sample is an outlier, the resulting prototype becomes inaccurate, leading to poor generalization. Meta-SN addresses these limitations by introducing external knowledge as a stable anchor for class representations and utilizing a Siamese architecture to optimize the discriminative power of the embedding space.
2. Limitations of Prototypical Networks
The authors identify three primary flaws in the standard Prototypical Network (PROTO) approach:
- Randomness Sensitivity: The accuracy of a prototype is entirely dependent on the specific samples drawn for the support set. In 1-shot or 5-shot scenarios, a single outlier can drastically shift the class representation.
- Equal Weighting: PROTO treats every sample in a support set as equally representative. In reality, some samples are more central to the class identity than others.
- Task Simplicity: Standard meta-learning training tasks are constructed randomly. This often results in "easy" tasks that do not sufficiently challenge the model, limiting its ability to learn fine-grained distinctions between semantically similar classes.
3. The Meta-SN Framework
Meta-SN introduces four key innovations to overcome the weaknesses of traditional FSL models:
3.1 External Knowledge Prototypes
Instead of deriving prototypes solely from noisy support samples, Meta-SN initializes class representations using external descriptive text, such as class names and Wikipedia definitions. This provides a "true" semantic anchor that remains stable regardless of which specific samples are drawn during a meta-test episode.
3.2 Siamese Network Refinement
The model employs a Siamese architecture consisting of two identical sub-networks. These networks map both the input samples and the external knowledge prototypes into a shared low-dimensional space. A contrastive loss function is applied to explicitly pull samples toward their correct class prototypes while pushing them away from dissimilar classes, creating a more robust and discriminative embedding space.
3.3 Hard-Task Sampling Strategy
To improve generalization, Meta-SN utilizes a "greedy" sampling strategy to construct difficult meta-tasks during training. The model prioritizes classes that are semantically close to one another and selects samples that are distant from their respective class prototypes. This curriculum-like approach forces the model to learn the subtle nuances required to distinguish between challenging categories.
3.4 Dynamic Weighting Mechanism
To address the issue of equal weighting, Meta-SN includes a weight generator. This component assigns higher importance to labeled samples that are semantically closer to the current "query" instance being classified, making the final prediction more robust to outliers within the support set.
4. Experimental Setup and Results
Meta-SN was evaluated on six diverse benchmark datasets, including HuffPost (news), Amazon (reviews), Reuters-21578, 20 Newsgroups, RCV1, and FewRel (relation classification).
4.1 Performance Gains
The model achieved state-of-the-art results across all datasets in both 1-shot and 5-shot scenarios. On average, Meta-SN outperformed the standard Prototypical Network by 27.0% in 1-shot tasks and 34.1% in 5-shot tasks. Furthermore, it surpassed the previous state-of-the-art model, MLADA, by 3.8% in 1-shot accuracy.
4.2 Qualitative Analysis
t-SNE visualizations of the embedding space confirmed that Meta-SN creates significantly tighter and more distinct class clusters compared to previous methods. While earlier models often resulted in "entangled" class embeddings, Meta-SN successfully separated semantically similar classes into clear, non-overlapping regions.
5. Conclusion and Future Work
Meta-SN demonstrates that anchoring class representations in external knowledge and focusing on difficult training tasks can drastically improve few-shot text classification. The stability provided by Wikipedia-style descriptions effectively mitigates the "noisy prototype" problem. Future research will explore the application of this external knowledge approach to other domains, such as computer vision, and investigate the integration of Meta-SN with a wider variety of meta-learning algorithms beyond metric-based frameworks.
Summary updated