Probabilistic Label Trees for Extreme Multi-label Classification

Kalina Jasinska-Kobus, Marek Wydmuch, Krzysztof Dembczynski, Mikhail Kuznetsov, Róbert Busa-FeketearXiv 2020

Abstract

Extreme multi-label classification (XMLC) is a learning task of tagging instances with a small subset of relevant labels chosen from an extremely large pool of possible labels. Problems of this scale can be efficiently handled by organizing labels as a tree, like in hierarchical softmax used for multi-class problems. In this paper, we thoroughly investigate probabilistic label trees (PLTs) which can be treated as a generalization of hierarchical softmax for multi-label problems. We first introduce the PLT model and discuss training and inference procedures and their computational costs. Next, we prove the consistency of PLTs for a wide spectrum of performance metrics. To this end, we upperbound their regret by a function of surrogate-loss regrets of node classifiers. Furthermore, we consider a problem of training PLTs in a fully online setting, without any prior knowledge of training instances, their features, or labels. In this case, both node classifiers and the tree structure are trained online. We prove a specific equivalence between the fully online algorithm and an algorithm with a tree structure given in advance. Finally, we discuss several implementations of PLTs and introduce a new one, napkinXC, which we empirically evaluate and compare with state-of-the-art algorithms.

Introduction

In modern machine learning, Extreme Multi-label Classification (XMLC) represents a significant challenge. Tasks such as tagging Wikipedia articles or product recommendation involve selecting a few relevant labels from millions of possibilities. Traditional "1-vs-All" approaches, which train a separate classifier for every label, scale linearly with the number of labels ($m$), making them computationally prohibitive at this scale. Probabilistic Label Trees (PLTs) address this by organizing labels into a tree structure, achieving logarithmic scaling in both training and inference.

Probabilistic Label Trees (PLTs)

PLTs factorize the conditional probability of a label using the chain rule along a path from the root to a leaf. Instead of predicting all labels simultaneously, each internal node in the tree acts as a binary classifier, determining whether to proceed down a specific branch. This structure allows for efficient inference via tree search, using either a probability threshold or a priority queue to identify the top-$k$ most likely labels.

A label tree structure where labels $y_j$ are assigned to leaf nodes $l_j$.

Theoretical Consistency and the Coding Perspective

A core contribution of this work is the proof that PLTs are statistically consistent for a wide range of performance metrics, such as Precision@k and F-measure. This ensures that as training data increases, the PLT's predictions converge to the optimal Bayes classifier. This distinguishes PLTs from common heuristics, such as the "pick-one" approach used in Hierarchical Softmax (e.g., in fastText), which the authors prove to be inconsistent for multi-label tasks.

From an information-theoretic perspective, label paths in a PLT can be viewed as prefix codes. Each label is represented by a unique bit-string corresponding to the path from the root to the leaf, bridging the gap between classification and coding theory.

The coding perspective of PLTs, where each label path is represented by a unique bit-string.

Online Training and napkinXC

The authors introduce an Online PLT (OPLT) algorithm capable of building the tree structure and training node classifiers incrementally without prior knowledge of the label set. This is achieved through auxiliary classifiers that track label statistics before they are integrated into the tree.

To facilitate practical use, the authors released napkinXC, a high-performance C++ library. It implements these algorithms with optimizations for both sparse text features and dense embeddings, offering significant speedups over traditional methods.

Experimental Results

Evaluation on standard benchmarks (e.g., Amazon-3M with ~2.8 million labels) demonstrates that napkinXC matches or exceeds state-of-the-art accuracy (Precision@1) while being orders of magnitude faster. Training on the largest datasets takes hours rather than the hundreds of hours required by 1-vs-All methods. Furthermore, PLTs allow for aggressive weight pruning, reducing model size by up to 10x with minimal impact on accuracy.

Conclusion

Probabilistic Label Trees provide a mathematically grounded and computationally efficient framework for extreme classification. By establishing theoretical regret bounds and introducing a fully online training algorithm, this work advances the scalability of multi-label systems. Future research may explore optimal tree topology construction and improved handling of "long-tail" labels that appear infrequently in training data.

Summary updated

BibTeX
@misc{jasinskakobus2020probabilistic,
  author = {Kalina Jasinska-Kobus and Marek Wydmuch and Krzysztof Dembczynski and Mikhail Kuznetsov and Róbert Busa-Fekete},
  title = {{Probabilistic Label Trees for Extreme Multi-label Classification}},
  year = {2020},
  eprint = {2009.11218},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2009.11218},
}
Figure