Exploring Space Efficiency in a Tree-based Linear Model for Extreme Multi-label Classification

He-Zhe Lin, Cheng-Hung Liu, Chih-Jen Lin

Abstract

Extreme Multi-label Classification (XMC) often faces significant memory constraints due to the massive scale of labels and features. While tree-based linear models are frequently perceived as memory-intensive, this research identifies a "sparsity paradox" where these models naturally ignore unused features. This inherent pruning results in models that are significantly smaller than standard One-vs-Rest (OVR) approaches—often less than 10% of the size—without compromising predictive accuracy.

Introduction

XMC involves assigning relevant labels to objects from a set containing thousands or millions of possibilities. The baseline approach, One-vs-Rest (OVR), trains independent classifiers for every label. However, for large datasets like Wikipedia or Amazon, OVR models can exceed 5 Terabytes, necessitating high-performance hardware. To mitigate this, label trees are used to decompose the problem. Conventional wisdom suggested that trees, containing more classifiers than OVR, would be even more memory-intensive, leading to the widespread use of performance-degrading weight pruning. This paper challenges that assumption by investigating the inherent space complexity of tree-based models.

Methodology

The authors analyze the space complexity of tree-based linear models in the context of sparse text data. The central mechanism is Inherent Pruning: as a tree node processes only a subset of labels, it only encounters a fraction of the total feature set.

A hierarchical label tree structure illustrating how labels are partitioned across depths.

The study introduces a mathematical framework to estimate model size using a "feature reduction ratio" ($\alpha$), representing the rate at which active features decrease with tree depth. This allows for a pre-training estimation of memory requirements, facilitating better resource planning. The analysis covers both Fixed-K and Varied-K tree structures across six benchmark datasets, including Wiki-500k and Amazon-3m.

Key Insights

  • The Sparsity Paradox: Despite having more weight vectors, tree models are sparser. Each vector in the tree is significantly more sparse than those in OVR, leading to a lower total count of non-zero values.
  • The Benefit of Depth: Contrary to intuition, increasing tree depth often reduces the overall model size. The reduction in features per node at greater depths outweighs the increase in the number of nodes.
  • Predictability: Model size can be accurately bounded before training by analyzing the feature distribution across the constructed label tree.

Empirical Results

The empirical evaluation demonstrates substantial space savings on large-scale benchmarks. For instance, on the Wiki-500k dataset, the tree model achieved a size ratio of just 0.025 compared to OVR.

Model-size ratio vs. tree depth for the Wiki-500k dataset, showing a significant reduction in size as depth increases.

On Amazon-670k, the tree model required only ~28 GB compared to the ~675 GB required by OVR. Crucially, these savings were achieved through inherent pruning rather than manual weight thresholding, allowing the models to maintain high precision (P@k) scores while fitting on standard commodity servers.

Conclusion

This research refutes the notion that tree-based XMC models are inherently memory-inefficient. By leveraging the natural sparsity of feature subsets within label trees, practitioners can deploy high-performance models with a fraction of the memory footprint required by OVR baselines. Future work may refine size estimation by accounting for variable feature reduction rates across different tree levels.

Summary updated

BibTeX
@inproceedings{lin2024exploring,
  author = {He-Zhe Lin and Cheng-Hung Liu and Chih-Jen Lin},
  title = {{Exploring Space Efficiency in a Tree-based Linear Model for Extreme Multi-label Classification}},
  booktitle = {Conference on Empirical Methods in Natural Language Processing},
  year = {2024},
  doi = {10.18653/v1/2024.emnlp-main.909},
}
Figure