Abstract
Extreme Multi-label Text Classification (XMC) involves tagging documents with relevant labels from a massive set, often reaching millions of possibilities. Traditional XMC approaches rely on bulky, multi-stage pipelines and static negative sampling, which are computationally expensive and prone to overfitting. We introduce LightXML, a streamlined Transformer-based framework that replaces these complex pipelines with an efficient end-to-end process. By utilizing generative cooperative networks for dynamic negative sampling and a multi-layer text representation, LightXML achieves state-of-the-art accuracy while reducing model size by up to 72% compared to previous leaders like AttentionXML.
Introduction
The primary challenges in XMC are computational complexity and the limitations of static negative sampling. Scoring every label for every document is infeasible at scale, and fixed sets of negative labels often cause models to overfit to specific "hard" negatives, hindering generalization. Existing solutions like AttentionXML or X-Transformer address these issues with multi-stage pipelines (recalling then ranking), but these are often massive, slow to train, and resource-heavy. LightXML addresses these hurdles by providing a more agile, unified architecture.
Architecture and Methodology
LightXML's design focuses on efficiency without sacrificing representational power. The architecture consists of three main components:
- Multi-Layer Text Representation: Instead of using only the final layer of a Transformer (e.g., BERT), LightXML concatenates the
[CLS]token representations from the last five layers. This provides a richer semantic snapshot of the text. - Generative Cooperative Networks: The system employs two networks working in tandem. A Generator predicts likely relevant label clusters (label recalling), while a Discriminator distinguishes true positive labels from the candidates suggested by the generator (label ranking).
- Dynamic Negative Sampling: Unlike previous models, LightXML's generator provides a fresh set of negative samples during every training epoch. This "moving target" prevents overfitting and forces the model to learn nuances between similar labels.
- Hidden Bottleneck Layer: To maintain a small footprint, a bottleneck layer projects high-dimensional text features into a lower-dimensional space before final prediction, significantly reducing the parameters in the output layer.
Experimental Results
The authors evaluated LightXML on five standard XMC benchmarks: Eurlex-4K, Wiki10-31K, AmazonCat-13K, Wiki-500K, and Amazon-670K.
Performance and Efficiency
LightXML outperformed all baselines on four out of five datasets in terms of Precision@k (P@1, P@3, P@5). Notably, it achieved massive compression; on the Amazon-670K dataset, the model size is only 1.53 GB, a 72% reduction from AttentionXML's 5.52 GB. Inference is also highly efficient, with a prediction speed of roughly 4ms per sample.
Impact of Multi-Layer Representation
A key insight of the work is the effectiveness of multi-layer features. By aggregating information across multiple Transformer layers, the model captures more robust semantic signals than single-layer approaches.
Conclusion
LightXML demonstrates that high-performance XMC does not require massive, multi-stage pipelines. By combining dynamic negative sampling with efficient feature extraction and a bottlenecked architecture, LightXML provides a scalable, end-to-end solution that is both more accurate and significantly smaller than its predecessors. Future work may explore even more efficient backbones like DistilBERT to further reduce training time and resource requirements.
Summary updated