NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

MatchXML: An Efficient Text-label Matching Framework for Extreme Multi-label Text Classification

Hui Ye, Rajshekhar Sunderraman, Shihao JiarXiv 2023

TL;DR

MatchXML is a highly efficient framework for Extreme Multi-label text Classification (XMC) that reformulates the problem as a text-label matching task in a bipartite graph. By introducing dense label embeddings (label2vec) and fusing fine-tuned Transformer features with static sentence embeddings, it achieves state-of-the-art accuracy on five out of six benchmarks while delivering the fastest training speeds in its class.

What Problem Does This Paper Address?

Extreme Multi-label text Classification (XMC) involves assigning the most relevant labels to a text sample from a massive pool that can scale to millions of choices. This technology powers real-world applications like product recommendations, web searches, and document tagging.

To make this computationally feasible, state-of-the-art methods organize labels into a Hierarchical Label Tree (HLT), reducing search complexity from linear $O(L)$ to logarithmic $O(\log L)$. Traditionally, these trees are built using sparse TF-IDF features aggregated from positive training instances. However, sparse features are computationally inefficient to process, fail to capture deep semantic relationships between labels, and are not always available in real-world applications. MatchXML addresses these limitations by introducing dense label representations and optimizing how text models are fine-tuned for extreme label spaces.

Fig. 2. Label distributions of Amazon-670K and Amazon-3M follow the power (Zipf’s) Law, as shown in (a) and (b). Text distributions of Amazon-670K and Amazon-3M don’t follow a particular standard form, as shown in (c) and (d).

Methods

MatchXML splits the XMC pipeline into four distinct stages:

  1. label2vec: Inspired by Word2Vec, the authors treat the labels assigned to a text sample as an unordered sequence of tokens. They use a modified Skip-gram model to learn dense semantic label embeddings. Crucially, they remove the standard context window constraint (since label order doesn't matter) and disable frequent-label subsampling to ensure rare labels are adequately represented.
  2. Hierarchical Label Tree (HLT) Construction: A balanced K-means clustering algorithm uses these dense label2vec vectors to build a tree structure, grouping semantically similar labels together.
  3. Text-Label Matching: Instead of standard multi-label classification, the authors model the task as a bipartite graph matching problem. They fine-tune a pre-trained Transformer encoder using a supervised contrastive loss function that optimizes both text-to-label and label-to-text alignments within a mini-batch.
  4. Feature Fusion & Linear Ranker: Finally, the system extracts three complementary text representations: sparse TF-IDF features (capturing global statistics), fine-tuned dense text representations from the Transformer, and static dense sentence embeddings from a pre-trained Sentence-T5 model. A linear ranker is trained on this concatenated feature set to make the final predictions.
Fig. 1. Architecture of text-label matching in a bipartite graph. When fine-tuning a pre-trained encoder Transformer for the t-th layer of HLT, we consider the input text set U (i.e., training samples) as the text modality, while the label set V (t) (i.e., training labels Y (t)) as the label modality.

Datasets

The authors evaluated MatchXML on six widely accepted public XMC benchmarks, categorized by scale:

  • Medium-scale: EURLex-4k, AmazonCat-13k, Wiki10-31k
  • Large-scale: Wiki-500k, Amazon-670k, Amazon-3M

These datasets exhibit a classic power-law (Zipf's) distribution, where a small fraction of head labels account for the majority of instances, making tail-label prediction exceptionally challenging.

Statistics of the six public XMC datasets used for evaluation

Key Insights and Ideas

  • Dense Vectors Outperform Sparse Aggregations: Shifting from sparse TF-IDF label aggregations to dense label2vec embeddings dramatically compresses the tree-building memory footprint while capturing richer semantic label relationships.
  • Bipartite Graph Formulation: Treating XMC as a cross-modal matching problem (aligning the text modality with the label modality) via contrastive learning forces the Transformer to learn more robust text representations than standard hinge or cross-entropy losses.
  • The Power of Static Sentence Embeddings: Fine-tuned Transformer models often suffer from text truncation due to strict token limits (e.g., 512 tokens). Integrating static embeddings from models like Sentence-T5 acts as an effective complement because they can support much longer text sequences, preserving broader semantic context.

Key Results

Classification Accuracy

MatchXML achieved state-of-the-art precision (P@k) and ranking quality (nDCG@k) on five out of the six datasets. On the three largest and most challenging benchmarks, it outperformed the previous best method (XR-Transformer) by notable margins in P@1:

  • Wiki-500K: +1.70%
  • Amazon-670K: +1.73%
  • Amazon-3M: +1.62%

Computational Efficiency

  • Training Speed: MatchXML recorded the fastest training times among all deep learning-based competitors across all six datasets. For instance, on the massive Amazon-3M dataset, MatchXML completed training in 8.3 hours, outperforming XR-Transformer (9.7 hours) and AttentionXML (18.27 hours).
  • Memory Footprint: The dense label2vec approach reduced label embedding storage requirements significantly. On Wiki-500k, the embedding size shrank by 35× (from 7,109.2 MB down to 200.4 MB), streamlining downstream tree-clustering operations.

Limitations and Future Work

While MatchXML delivers impressive speed and accuracy, its pipeline remains multi-staged (label embedding $\rightarrow$ tree construction $\rightarrow$ Transformer fine-tuning $\rightarrow$ linear ranker training). The authors note that a promising future direction is to explore an end-to-end training framework that can jointly optimize these components simultaneously.

Summary updated

BibTeX
@misc{ye2023matchxml,
  author = {Hui Ye and Rajshekhar Sunderraman and Shihao Ji},
  title = {{MatchXML: An Efficient Text-label Matching Framework for Extreme Multi-label Text Classification}},
  year = {2023},
  eprint = {2308.13139},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2308.13139},
}
Figure