Introduction
Extreme Multi-label Text Classification (XMTC) involves assigning a subset of relevant labels to a document from a massive label space, often containing thousands or millions of candidates. Current state-of-the-art models leverage Transformer architectures like BERT or XLNet, typically relying on the final layer's [CLS] token embedding as a "global" representation of the document. However, this high-level summary often overlooks fine-grained "local" features—specific keywords or phrases—essential for predicting niche, specific labels.
Methodology: The GLOCALXML Framework
To address the limitations of purely global representations, we introduce GLOCALXML, a dual-pathway framework that integrates both global and local features.
Dual-Pathway Architecture
- Global Pathway: Utilizes the standard
[CLS]embedding from the final layer of a Transformer to capture abstract, high-level document semantics. - Local Pathway: Extracts individual word embeddings from a lower layer (specifically Layer 1). This preserves the distinct identities of words before they become heavily contextualized in deeper layers.
Label-Word Attention and Joint Prediction
Within the local pathway, a label-word attention mechanism is employed. Each potential label acts as a query to identify and weight the most relevant keywords in the document. The final prediction is an ensemble of the probabilities generated by both pathways, trained with independent losses to encourage specialization.
Experimental Results
GLOCALXML was evaluated on three benchmark datasets: EURLex-4K, Wiki10-31K, and AmazonCat-13K. The model achieves state-of-the-art performance across these benchmarks, consistently outperforming existing statistical and neural models in Precision@k (P@k) metrics.
The Importance of Early-Layer Features
A key finding is the "contextualization trap": as information progresses through Transformer layers, local word features converge toward the global summary. The authors utilized Jensen-Shannon Divergence (JSD) to measure the similarity between local and global predictions across layers.
As illustrated in the figure above, the relative improvement provided by local features is highest at lower layers (e.g., Layer 1), where JSD is also high. This indicates that the raw, less-processed information in early layers provides unique, complementary signals that the global summary lacks. As layers increase, the local features become more similar to the global representation, reducing their unique contribution.
Conclusion
GLOCALXML demonstrates that incorporating local features from early Transformer layers significantly enhances XMTC performance. By balancing abstract global summaries with fine-grained local keyword attention, the model achieves superior precision, particularly on datasets where specific terminology is critical for label assignment. Future work will explore scaling this approach to datasets with millions of labels using tree-based or two-stage architectures.
Summary updated