Abstract
Few-Shot Learning (FSL) aims to mimic the human ability to learn new concepts from minimal examples. However, traditional FSL models often rely on "episodic training," requiring thousands of labeled instances from background classes—a requirement that diverges from human cognitive processes. This paper introduces Constrained Few-Shot Learning (CFSL), a paradigm where training data is strictly limited to just a few instances per class ($M \le K$). We propose the Category2Vector (Cat2Vec) model, which utilizes a novel Categorical Contrastive (CC) loss to maintain natural similarities between training and test sets. Our results show that Cat2Vec-BERT outperforms standard FSL baselines by up to 17.14% in extreme low-data scenarios.
Introduction: The Gap in Few-Shot Learning
While standard FSL evaluates models on a small number of "shot" examples, the training phase typically involves massive labeled datasets to learn generalizable features. This "episodic" approach is a data hog and does not reflect how humans learn; we do not need to see 1,000 examples of various animals to identify a new species.
To address this, we define Constrained Few-Shot Learning (CFSL). In CFSL, the number of training instances per class ($M$) is constrained such that $M \le K$. This constraint makes traditional episodic training impossible, as there are insufficient samples to construct valid episodes without immediate repetition, forcing a shift back toward global classification objectives.
Methodology: Cat2Vec and Categorical Contrastive Loss
The proposed model, Category2Vector (Cat2Vec), is grounded in cognitive psychology theories such as Fuzzy Trace Theory and Prototype Theory.
Model Architecture
The architecture employs a standard encoder (Bi-LSTM or BERT) to generate document embeddings. These embeddings are compared against a "Categorical Memory"—a set of learned embeddings representing class prototypes. Classification is performed by identifying the nearest category embedding in Euclidean space.
Categorical Contrastive (CC) Loss
A key innovation is the Categorical Contrastive (CC) Loss. Standard contrastive losses treat all negative samples uniformly. In contrast, CC loss splits negative sampling into two distinct cases: anchors from test classes only sample negatives from other test classes, and anchors from training classes only sample negatives from other training classes. This strategy prevents the model from "un-learning" inherent similarities between training and test categories, allowing training classes to serve as more effective reference points for unseen test data.
Experimental Setup
We evaluated the model using a custom training pipeline based on Wikipedia data (Wiki500 to Wiki4000), where each page serves as a unique class with very few samples. Evaluation was conducted on four benchmarks: DBpedia, AG News, 20News, and Yahoo! Answers.
Results and Discussion
The Cat2Vec-BERT model consistently outperformed baselines across all tasks. In the most challenging 5-shot 1-tshot scenario (one training sample per class), the model improved accuracy by 4.58% to 17.14% compared to the next best baseline.
Key Insights
- Information Overload: Increasing training data (e.g., from Wiki2000 to Wiki4000) sometimes decreased accuracy. This suggests that excessive irrelevant categorical information can cause "indecision," a phenomenon observed in human cognition.
- Robustness in Extremes: The model is particularly effective when $M=1$, where traditional meta-learning methods often fail to find a meaningful signal.
- Cognitive Alignment: By focusing on prototypes (gist representations) rather than verbatim comparisons, the model remains robust against the noise typical of tiny datasets.
Conclusion and Future Work
While Cat2Vec shows significant promise, it still struggles with high-similarity datasets like 20News, where a single example may not suffice to define a distinct prototype. Future work will focus on improving the model's adaptive capabilities to better handle distribution shifts between general training data (Wikipedia) and specific target domains.
Summary updated