Abstract
Extreme Multi-Label Text Classification (EMTC) involves assigning relevant labels to a text query from a pool of millions. While Large Language Models (LLMs) offer superior semantic understanding for this task, their deployment is often hindered by massive data volumes and high hardware requirements. We present QUEST (Quantized and Efficient Learning with Sampling Technique), a framework that enables state-of-the-art EMTC performance using a single consumer-grade GPU. By integrating diversity-aware hash sampling with quantized prompt-tuning, QUEST reduces training data volume by 75% and fits a Llama-7B model into 24GB of VRAM, outperforming existing BERT-based and LLM-based baselines.
Introduction
EMTC is critical for applications like product recommendation and document categorization. However, two primary challenges persist:
- Data Scalability: Training on millions of query-label pairs is computationally prohibitive and often redundant due to label clustering.
- Hardware Barriers: Standard LLMs like Llama-7B require significant memory (approx. 28GB in full precision), typically necessitating expensive A100/H100 clusters for fine-tuning.
Existing methods often rely on BERT-style encoders, which, while efficient, lack the deep semantic nuance required to distinguish between millions of closely related labels. QUEST addresses these bottlenecks to bring high-performance EMTC to commodity hardware.
Methodology
The QUEST framework introduces two core innovations to optimize both data ingestion and model training:
Diversity-Aware Hash Sampling
Rather than training on the entire dataset, QUEST employs a MinHash-based algorithm to identify representative data. It treats labels as clusters and calculates a "Jaccard Kernel Density." By sampling the inverse of this density, the model prioritizes diverse and representative query-label pairs. This approach effectively reduces the training data volume to 25% of its original size without sacrificing accuracy.
Quantized Prompt-Training
To operate within the 24GB VRAM limit of an Nvidia RTX 3090, QUEST utilizes 4-bit NormalFloat (NF-4) quantization to compress model weights. Instead of full-parameter fine-tuning, the framework uses Prompt-Tuning, where only a small set of "soft prompt" tokens (approx. 20,000 parameters) are trained while the base LLM remains frozen.
Key Insights
Addressing Label Redundancy
A significant observation in EMTC is that labels are highly clustered (e.g., multiple editions of the same book series). Training on every instance is inefficient. The t-SNE visualization below demonstrates how labels naturally group into semantic clusters, justifying QUEST's "smart filter" sampling approach.
Autoregressive Embeddings
Unlike traditional BERT models that use a specific [CLS] token, QUEST extracts the last token vector from the final hidden layer of the Llama model. This captures a comprehensive summary of the entire input sequence, leveraging the LLM's autoregressive architecture for better feature representation.
Experimental Results
QUEST was evaluated on four large-scale benchmarks: Amazon-131K, Amazon-1M, Wikipedia-500K, and WikiAlsoSee-320K.
- Superior Accuracy: On Amazon-131K, QUEST achieved a Precision@1 of 25.48%, significantly higher than the previous state-of-the-art (18.74%).
- Long-Tail Performance: The model showed marked improvements in finding niche labels, with Recall@100 reaching 64.30%.
- Efficiency Gains: QUEST successfully trained on the Amazon-1M dataset (nearly 1 million labels) in just 48 hours on a single RTX 3090. Previous methods often required multi-GPU clusters for over a week to reach comparable results.
Conclusion and Future Work
QUEST demonstrates that with intelligent sampling and quantization, extreme-scale classification is possible on consumer hardware. While 4-bit quantization is highly effective, future work will explore making 2-bit or 3-bit models viable, as current tests at those levels show significant performance degradation. Additionally, reducing inference latency for real-time deployment in million-label spaces remains a key area for optimization.
Summary updated