NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Disentangling Task Relations for Few-shot Text Classification via Self-Supervised Hierarchical Task Clustering

Juan Zha, Zheng Li, Ying Wei, Yu Zhang

Abstract

Few-shot text classification (FSTC) typically assumes tasks are drawn from a uniform distribution. However, real-world applications often involve heterogeneous tasks from multiple sources, where a "one-size-fits-all" meta-learning approach underperforms. We propose SS-HTC (Self-Supervised Hierarchical Task Clustering), a framework designed to handle task heterogeneity by disentangling task relations. SS-HTC utilizes label-oriented self-supervision to learn semantic task embeddings and organizes tasks into a hierarchical tree structure. This allows for cluster-specific feature transformations that tailor the model to diverse domains. Our experiments across five major benchmarks demonstrate that SS-HTC significantly outperforms existing methods, achieving up to a 9.8% improvement in 1-shot classification accuracy.

Introduction: The Challenge of Task Heterogeneity

Traditional Few-Shot Text Classification (FSTC) models are often trained on a single data source, assuming that the underlying distribution of tasks is homogeneous. In practice, a robust model must handle diverse datasets—ranging from financial news (Reuters) to consumer reviews (Amazon). This task heterogeneity poses a significant challenge: a single global set of meta-parameters may not be optimal for all domains. If a model cannot distinguish between a "politics" task and a "product category" task, it fails to effectively leverage relevant prior knowledge.

Methods: The SS-HTC Framework

To address these challenges, we introduce the Self-Supervised Hierarchical Task Clustering (SS-HTC) model. The architecture is built upon three primary pillars:

  1. Label-Oriented Mask Language Modeling (LOMLM): Most models treat category labels as arbitrary indices. SS-HTC treats labels as meaningful text. By appending label names to training samples and using a masking-and-recovery objective, the model is forced to learn the semantic relationship between the text content and the category names (e.g., "Crime" or "Arts").
  2. Hierarchical Task Clustering (HTC): Rather than using flat clustering, SS-HTC organizes tasks into a tree structure. This hierarchy captures both broad similarities (e.g., all news datasets) and fine-grained differences (e.g., Reuters vs. HuffPost), allowing the model to share knowledge at the appropriate level of abstraction.
  3. Cluster-Specific Feature Transformation: Based on a task's position within the hierarchical tree, the model applies a custom transformation (scaling and shifting) to its features. This "tunes" the internal representation to be more effective for that specific task cluster.
The SS-HTC architecture featuring LOMLM, Hierarchical Task Clustering, and the Prototypical network.

Experimental Setup

We evaluated SS-HTC on a multi-source environment combining five diverse public benchmarks: Amazon Product Reviews, 20 Newsgroups, HuffPost headlines, Reuters, and RCV1. This setup tests the model's ability to generalize across significantly different linguistic styles and label spaces.

Key Results

SS-HTC establishes a new state-of-the-art for multi-source few-shot classification. As shown in the results below, the model achieves substantial gains over competitive baselines like Signature and DEM.

  • 1-Shot Performance: SS-HTC reached an average accuracy of 70.34%, representing a +9.81% improvement over the previous best baseline.
  • 5-Shot Performance: The model achieved 80.44% accuracy, a +5.19% lead over the nearest competitor.
Performance comparison of SS-HTC against various baselines across five heterogeneous datasets.

Ablation studies confirmed that both the LOMLM and HTC components are critical. Removing the hierarchical structure or the label-learning objective led to significant performance degradation, proving that understanding labels and organizing task relationships are both essential for handling heterogeneous data.

Conclusion and Future Work

SS-HTC demonstrates that disentangling task relations through hierarchical clustering and semantic label learning is a powerful strategy for few-shot learning in the real world. By moving away from "one-size-fits-all" models, we can create more adaptable and interpretable AI systems. Future research will focus on extending this framework to more complex NLP tasks like Named Entity Recognition and exploring dynamic tree structures that can evolve as the model encounters new data sources.

Summary updated

BibTeX
@inproceedings{zha2022disentangling,
  author = {Juan Zha and Zheng Li and Ying Wei and Yu Zhang},
  title = {{Disentangling Task Relations for Few-shot Text Classification via Self-Supervised Hierarchical Task Clustering}},
  booktitle = {Conference on Empirical Methods in Natural Language Processing},
  year = {2022},
  doi = {10.18653/v1/2022.findings-emnlp.383},
}
Figure