Label-semantics Aware Generative Approach for Domain-Agnostic Multilabel Classification

Subhendu Khatuya, Shashwat Naidu, Saptarshi Ghosh, Pawan Goyal, Niloy Ganguly

Introduction

Multi-label text classification (MLTC) is a fundamental task in Natural Language Processing, requiring the assignment of multiple relevant tags to a single document. This task is critical across various domains, including medical coding, sentiment analysis, and document categorization. Traditionally, MLTC models treat labels as "atomic symbols" or discrete indices (e.g., Label #1, Label #2). This approach, while computationally efficient, ignores the inherent semantic meaning of label names and the relationships between them—for instance, the conceptual proximity between "Joy" and "Optimism" compared to "Joy" and "Anger."

Existing methods that attempt to incorporate label metadata often rely on rigid hierarchies or domain-specific knowledge graphs, which lack scalability and struggle with the "long tail" of rare labels. To address these limitations, this paper introduces LAGAMC (Label-semantics Aware Generative Approach for Multilabel Classification), a domain-agnostic framework that leverages the reasoning capabilities of Large Language Models (LLMs) to understand label semantics directly.

Methodology

LAGAMC redefines MLTC as a generative task rather than a discriminative one. The framework operates in two distinct phases: a generative phase and a label matching phase.

1. Generative Phase

Instead of utilizing a standard classification head, LAGAMC employs FLAN-T5, fine-tuned via LoRA (Low-Rank Adaptation) for parameter efficiency. The model is prompted to generate the full textual descriptions of relevant labels for a given input text.

A critical innovation in this phase is the Hybrid Loss Function. The authors combine two distinct objectives:

  • Cross-Entropy Loss: Ensures token-level accuracy during text generation.
  • Semantic Similarity Loss: Utilizes a sentence transformer to ensure the meaning of the generated text aligns with the target label descriptions, even if the exact wording varies. This prevents the model from becoming overly brittle to specific phrasing.

2. Label Matching Phase

During inference, the LLM’s output is parsed into individual sentences. A fine-tuned Sentence-BERT model acts as a "Label Matcher," calculating the cosine similarity between the generated sentences and a predefined bank of label descriptions. This allows the system to map the generative output back to the final label assignments.

To ensure the model functions even when datasets lack detailed label definitions, the authors developed an automated pipeline using GPT-3.5 and Wikipedia to generate context-aware descriptions, providing the model with high-quality semantic targets.

Experimental Setup

The framework was evaluated across five diverse domains to demonstrate its domain-agnostic capabilities:

  • CAVES: Anti-vaccine tweets (Social Media).
  • SemEval-2018: Emotion detection (Social Media).
  • Reuters-21578: News articles (Newswire).
  • AAPD: Computer science paper abstracts (Academic).
  • PubMed: Medical subject headings (Healthcare).

Key Results and Insights

LAGAMC established a new state-of-the-art (SOTA) across all tested datasets, demonstrating significant improvements over existing discriminative and generative baselines.

Performance Gains

Compared to strong baselines like DeepXML or Renee, LAGAMC achieved an average improvement of 13.94% in Micro-F1 and a substantial 24.85% in Macro-F1. Notably, LAGAMC outperformed much larger models, including vanilla GPT-3.5, proving that task-specific generative fine-tuning is more effective than general-purpose prompting for MLTC.

Zero-Shot and Long-Tail Robustness

By prioritizing semantics over symbols, LAGAMC excels at zero-shot classification, achieving a 70.61 Macro-F1 on labels not seen during training. Furthermore, the model improved performance on the least frequent labels by 22% compared to the best baselines. This suggests that generative models are better equipped to "understand" a rare category from its description than discriminative models are at "learning" it from a limited number of examples.

Ablation and Efficiency

Ablation studies confirmed that label descriptions are the "secret sauce" of the architecture; removing them resulted in a 36.04% drop in Macro-F1. Additionally, by using LoRA, the authors updated only 0.08% of the model's parameters, making the framework relatively efficient for deployment.

Limitations and Future Work

While LAGAMC represents a significant step forward, it faces certain challenges:

  • Description Dependency: The quality of the classifier is inherently capped by the quality of the label descriptions.
  • Scalability: While tested against XMC (Extreme Multi-label Classification) frameworks, the label matching phase may become a computational bottleneck when dealing with hundreds of thousands of labels.
  • Inference Latency: As a generative model, LAGAMC is naturally slower at inference time than traditional linear classifiers, though the authors have optimized the matching phase using matrix operations.

Conclusion

LAGAMC demonstrates that treating labels as rich semantic entities rather than arbitrary IDs allows for a more robust, domain-agnostic approach to multi-label classification. By combining generative LLMs with semantic similarity matching, the framework provides a powerful solution for handling complex, long-tail, and zero-shot classification tasks across diverse fields.

Summary updated

BibTeX
@inproceedings{khatuya2025label,
  author = {Subhendu Khatuya and Shashwat Naidu and Saptarshi Ghosh and Pawan Goyal and Niloy Ganguly},
  title = {{Label-semantics Aware Generative Approach for Domain-Agnostic Multilabel Classification}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2025},
  doi = {10.18653/v1/2025.findings-acl.1145},
}
Figure