Abstract
Extreme Multi-label Text Classification (XMC) entails selecting the most relevant labels for an instance from a vast label set. Extreme Zero-shot XMC (EZ-XMC) extends this challenge by operating without annotated data, relying only on raw text instances and a predefined label set, making it particularly critical for addressing cold-start problems in large-scale recommendation and categorization systems. State-of-the-art methods, such as MACLR and RTS, leverage lightweight bi-encoders but rely on suboptimal pseudo labels for training, such as document titles (MACLR) or document segments (RTS), which may not align well with the intended tagging or categorization tasks. On the other hand, LLM-based approaches, like ICXML, achieve better label-instance alignment but are computationally expensive and impractical for real-world EZ-XMC applications due to their heavy inference costs. In this paper, we introduce LMTX (Large language Model as Teacher for eXtreme classification), a novel framework that bridges the gap between these two approaches. LMTX utilizes an LLM to identify high-quality pseudo labels during training, while employing a lightweight bi-encoder for efficient inference. This design eliminates the need for LLMs at inference time, offering the benefits of improved label alignment without sacrificing computational efficiency. Our approach achieves superior performance and efficiency over both LLM and non-LLM based approaches, establishing a new state-of-the-art in EZ-XMC.
Introduction
Extreme Multi-label Text Classification (XMC) involves assigning the most relevant labels to a document from a massive pool of possibilities, often reaching millions of labels. The "Extreme Zero-shot" (EZ-XMC) variant is a critical challenge for cold-start problems in large-scale recommendation systems, where no annotated training data is available.
Current approaches are generally split into two categories: traditional bi-encoders (like MACLR and RTS) which are fast but rely on noisy, self-supervised pseudo-labels, and LLM-based approaches which are accurate but computationally prohibitive for real-world inference. LMTX bridges this gap by using an LLM as a "teacher" during the training phase to supervise a fast, lightweight bi-encoder student.
The LMTX Framework
LMTX (Large language Model as Teacher for eXtreme classification) utilizes an open-source LLM (such as WizardLM or Llama2) exclusively during training. At inference time, the LLM is removed, and only the lightweight bi-encoder (DistilBERT) is used for prediction.
The framework employs an iterative, three-stage curriculum learning process:
- Shortlisting (Stage I): The bi-encoder embeds the document and labels, using Approximate Nearest Neighbor Search (ANNS) to retrieve a small shortlist of candidate labels.
- LLM Feedback (Stage II): The LLM evaluates this shortlist via point-wise prompts, providing binary "yes/no" feedback on the relevance of each label.
- Bi-encoder Training (Stage III): The bi-encoder is updated using a triplet loss function, treating the LLM's "yes" labels as positive ground truths.
As the bi-encoder improves, it provides higher-quality shortlists to the LLM, creating a compounding effect that steadily increases the alignment between the model and the actual ground truth.
Experimental Results
LMTX was evaluated on five standard tagging datasets, including EURLex-4K, Wiki10-31K, and LF-Wikipedia-500K. To demonstrate data efficiency, LMTX was trained on only a 30,000-document subset for the largest datasets, while baselines utilized the full training sets.
Key Findings
- State-of-the-Art Accuracy: LMTX significantly outperformed non-LLM baselines, achieving a 37% relative improvement in Precision@1 (P@1) on AmazonCat-13K and a 31% improvement on LF-Wikipedia-500K.
- Inference Efficiency: LMTX maintains the speed of traditional bi-encoders. On the LF-WikiSeeAlso-320K dataset, LMTX required only 0.032 hours for inference on a single GPU, compared to the 15-35 hours required by LLM-based baselines across multiple GPUs.
- Quality Over Quantity: The results prove that training on a small subset of high-quality, LLM-verified pseudo-labels is more effective than training on massive amounts of noisy, self-supervised data.
- Negative Sampling Insights: Interestingly, using labels explicitly rejected by the LLM as "hard negatives" during training actually degraded performance, likely due to occasional false negatives from the LLM teacher disrupting the learning process.
Conclusion
LMTX establishes a new state-of-the-art for EZ-XMC by effectively distilling the reasoning capabilities of LLMs into efficient bi-encoders. While the point-wise prompting strategy remains a training-time bottleneck, the framework's massive gains in accuracy and inference speed make it a highly practical solution for large-scale categorization tasks. Future work will explore list-wise prompting to further accelerate the training process.
Summary updated