Random Label Forests: An Ensemble Method with Label Subsampling For Extreme Multi-Label Problems

Sheng-Wei Chen, Chih-Jen LinEMNLP 2024

Introduction

Extreme Multi-Label (XML) classification is a cornerstone of modern digital systems, from tagging millions of products in e-commerce to categorizing vast digital libraries. The primary challenge in XML is the sheer scale: models must often predict from a pool of millions of potential labels ($m$) using millions of features ($n$). Traditional "One-Versus-Rest" (OVR) approaches, which train an independent classifier for every label, are computationally prohibitive at this scale.

While state-of-the-art tree-based linear methods like Parabel or Bonsai have improved efficiency by using $K$-means clustering to build label hierarchies, they encounter a "memory wall." These methods typically require centralized clustering on a single machine, creating a bottleneck. Furthermore, the resulting clusters are often imbalanced, leading to unpredictable memory requirements in distributed environments. Storing millions of linear models can easily exceed the RAM of standard server hardware.

The Random Label Forest (RLF) Framework

To address these scalability issues, we present Random Label Forests (RLF), a natively parallel ensemble framework. RLF bypasses the need for a global label hierarchy by utilizing random label subsampling and independent tree construction.

Label Subsampling and Tree Construction

Instead of processing the entire label set $m$ on a single node, RLF distributes the workload across a cluster. Each machine is assigned a random subset of labels—for instance, 10% of the total label space. Each machine then independently constructs a standard tree-based model (utilizing $K$-means and linear classifiers) specifically for its assigned labels.

Hierarchical label partitioning in RLF

Because each sub-model only "sees" a fraction of the labels, the memory footprint and training time per node are drastically reduced. At inference time, an input instance is passed to all sub-models in the forest. Each model estimates probabilities for its known labels, and these are aggregated to form the final prediction.

Negative Sampling Strategy

A critical technical insight of RLF is the handling of "empty" instances. When training on a label subset, many training examples may not have any positive labels within that specific subset. A naive approach might discard these instances to save time. However, RLF demonstrates that keeping these "empty" instances as negative examples is vital for unbiased probability estimation.

Impact of negative sampling strategies on decision boundaries

As shown in the figure above, omitting negative sampling (a) or sampling incorrectly can lead to distorted decision boundaries. By maintaining the full set of training instances as potential negatives, RLF ensures that the sub-models remain accurate "partial experts."

Experimental Evaluation

RLF was evaluated against six standard XML benchmarks, including amazon-670k, wiki-500k, and the massive amazon-3m (containing 2.8 million labels). These datasets are characterized by a "long-tail" distribution, where the majority of labels have very few positive instances, posing a significant challenge for subsampling methods.

Key Results

  • Memory Efficiency: On the amazon-3m dataset, a standard full-tree model required approximately 135.89 GB of RAM. RLF, using a 0.1 sampling rate, reduced this requirement to just 12.69 GB per machine—a nearly linear scaling with the sampling rate.
  • Training Speed: Training time for amazon-3m dropped from over 139 hours for a standard tree to roughly 6.4 hours per RLF sub-model.
  • Predictive Performance: Despite the subsampling, RLF maintains competitive accuracy. On the amazoncat-13k dataset, RLF achieved a Precision@1 (P@1) of 94.11%, actually outperforming the standard tree's 93.19%. The ensemble effect effectively recovers the information lost during random subsampling.

Discussion and Limitations

The success of RLF suggests that a single, perfect global hierarchy is not a prerequisite for high-performance XML classification. An ensemble of "partial experts" can achieve comparable results with much lower resource overhead.

However, RLF does have limitations. It showed lower performance on the wiki-500k dataset, where labels have strong inherent hierarchical correlations (e.g., specific historical figures nested under broader historical categories). Randomly splitting these labels can break these semantic relationships. Additionally, while RLF reduces memory per machine, it necessitates a distributed cluster to realize its full potential as an ensemble.

Conclusion

Random Label Forests provide a practical, scalable solution for extreme multi-label problems. By replacing complex global clustering with simple random subsampling and robust negative sampling, RLF enables the training of massive models on standard hardware. Future work may explore replacing the base linear classifiers with neural networks to further enhance the forest's representative power.

Summary updated

BibTeX
@inproceedings{chen2024random,
  author = {Sheng-Wei Chen and Chih-Jen Lin},
  title = {{Random Label Forests: An Ensemble Method with Label Subsampling For Extreme Multi-Label Problems}},
  booktitle = {Conference on Empirical Methods in Natural Language Processing},
  year = {2024},
  doi = {10.18653/v1/2024.findings-emnlp.825},
}
Figure