Introduction
Few-Shot Text Classification (FSTC) has emerged as a critical capability for modern NLP, enabling models to categorize text with minimal supervision—often just a handful of examples per class. However, most existing meta-learning frameworks operate under a "single-source" assumption, where training and testing tasks are drawn from a uniform data distribution. In real-world applications, models encounter heterogeneous tasks from diverse sources, ranging from consumer reviews to professional news wires.
This paper introduces Self-Supervised Hierarchical Task Clustering (SS-HTC), a framework designed to disentangle complex task relations in multi-source environments. By organizing tasks into a hierarchical structure, SS-HTC allows models to leverage specialized knowledge from related domains while maintaining the flexibility to handle diverse data distributions.
The Problem: Task Heterogeneity and Unorganized Knowledge
Standard FSTC models often struggle when faced with multi-source data due to two primary limitations:
- Task Heterogeneity: Models trained on a single domain (e.g., news) often fail to generalize to domains with different linguistic styles or taxonomies (e.g., product reviews). A "globally shared" knowledge base becomes a "jack of all trades, master of none."
- Unorganized Knowledge: Without an explicit mechanism to capture task relations, models cannot effectively determine which historical knowledge is relevant to a new, unseen task. This lack of organization leads to negative transfer, where irrelevant information degrades performance.
The SS-HTC Framework
To address these gaps, the authors propose a three-pillar approach that focuses on representation, organization, and application.
1. Label-Oriented Mask Language Modeling (LOMLM)
Effective clustering requires high-quality task embeddings. Traditional methods often ignore the semantic information embedded in category labels. SS-HTC introduces LOMLM, a self-supervised objective that augments support text with its corresponding label names and then masks those labels. By training the model to recover these labels, it learns task embeddings that are deeply aware of category semantics, providing a more robust foundation for clustering.
2. Hierarchical Task Clustering (HTC)
Rather than employing a flat grouping mechanism, SS-HTC utilizes a top-down hierarchical tree structure. Tasks are "softly" assigned to clusters across multiple levels of granularity (e.g., a broad "News" cluster branching into specific "Finance" or "Sports" sub-clusters). This hierarchical approach allows the model to share coarse-grained knowledge among broadly related tasks while isolating fine-grained knowledge for highly specific domains. The soft assignment ensures the framework remains fully differentiable and end-to-end trainable.
3. Cluster-Specific Feature Transformation
Once a task is assigned to a cluster, the model applies a residual affine transformation to the data features. This transformation uses the "historical" knowledge stored within the cluster to warp the feature space, making it more discriminative for that specific task type. These transformed features are then passed to a Prototypical Network (ProtoNet) for final classification.
Experimental Evaluation
The researchers evaluated SS-HTC by constructing a challenging multi-source environment using five diverse benchmarks:
- Amazon Product Reviews: Consumer-oriented feedback.
- 20 Newsgroups: Informal discussion forum posts.
- HuffPost: Mainstream news headlines.
- Reuters & RCV1: Professional, structured news wire stories.
Key Results
SS-HTC demonstrated significant performance gains over state-of-the-art baselines, including Signature and DEM:
- Accuracy Improvements: The model achieved an average boost of +9.81% in 1-shot scenarios and +5.19% in 5-shot scenarios across all datasets.
- Scalability: As the number of classes (N-way) increased, the performance gap between SS-HTC and other models widened, suggesting that hierarchical organization is particularly effective for complex, high-dimensional tasks.
- Interpretability: Visualization of cluster assignments confirmed that the model naturally grouped similar datasets (e.g., Reuters and HuffPost), validating its ability to disentangle relationships between different data sources.
Discussion and Future Work
The success of SS-HTC highlights the importance of treating label names as rich semantic features rather than simple targets. By mimicking human-like taxonomies through hierarchical clustering, the model achieves a more nuanced understanding of task relations.
However, several avenues for future research remain. The current framework is optimized for text classification; extending this to other heterogeneous tasks like summarization or translation is a logical next step. Additionally, while the current tree structure is predefined, future iterations could explore dynamically learning the optimal hierarchy for a given set of data sources. Finally, expanding the framework to handle multi-lingual sources would further enhance its utility in global-scale applications.
Summary updated