TL;DR
CRAFTML is a novel tree-based algorithm designed for Extreme Multi-label Learning (XML) that handles datasets with millions of labels. By combining random projections with a fast clustering-based partitioning strategy, it achieves state-of-the-art accuracy while running on a fraction of the hardware required by competing methods (e.g., 5 cores instead of 100).
What Problem Does This Paper Address?
In the world of machine learning, "Extreme Multi-label Learning" (XML) is the final boss of classification. Imagine trying to tag a Wikipedia article or a product on Amazon where the pool of possible labels exceeds one million. Standard algorithms crumble under this scale due to massive memory requirements and glacial training times.
Existing solutions generally fall into two camps:
- Linear/Optimization-based: Very accurate but require massive compute clusters (100+ cores) and produce huge models.
- Tree-based: Faster and more scalable, but often sacrifice accuracy because they use overly simplified partitioning or fail to exploit the "wisdom of the crowd" found in random forests.
The authors of CRAFTML aim to bridge this gap, creating a tree-based method that is as fast as its peers but as accurate as the heavy-duty linear models.
Methods
CRAFTML (Clustering-based RAndom Forest of predictive Trees for extreme Multi-label Learning) introduces a unique three-step "node splitting" process to build its forest:
- Random Projection (The Hashing Trick): Instead of looking at all features and labels at every step, the algorithm uses a "hashing trick" to project them into a lower-dimensional space. This preserves the essential information while drastically reducing the computational load.
- Label Clustering: At each node in the tree, the algorithm performs $k$-means clustering on the projected labels. This groups similar instances together based on their outputs, which is much more efficient than trying to find a complex hyperplane in the feature space.
- Feature-based Assignment: Finally, it trains a simple, fast centroid-based classifier to map the features to these label clusters.
By repeating this recursively, the algorithm builds a forest of "deep" trees. Unlike traditional random forests that use "bootstrapping" (sampling data with replacement), CRAFTML trains each tree on the full dataset but relies on different random projections to ensure diversity between trees.
Datasets
The authors evaluated CRAFTML on nine diverse datasets from the XML repository, ranging from small-scale to truly "extreme":
- Small/Medium: Bibtex, Mediamill, Delicious, EURLex-4K.
- Large/Extreme: Wiki10-31K, WikiLSHTC-325K (1.7M instances), Delicious-200K, Amazon-670K (670k labels), and AmazonCat-13K.
Key Insights and Ideas
- Projections > Selection: Traditional random forests randomly select a subset of features. CRAFTML uses random projections, which the authors show preserve significantly more information for the same level of data compression.
- Output-Space Partitioning: Most trees try to split data based on input features. CRAFTML's "aha moment" is splitting based on label similarity first, then learning how features map to those splits. This is much more effective when the number of labels is huge.
- Efficiency is King: By replacing complex multi-objective optimization (used in methods like PFastReXML) with simple $k$-means and centroid calculations, the training complexity becomes linear relative to the number of instances, making it incredibly scalable.
Key Results
- Superior Accuracy: CRAFTML outperformed existing tree-based methods (like FastXML and PFastReXML) across almost all datasets in terms of Precision@k.
- Hardware Efficiency: One of the most striking results is that a parallelized version of CRAFTML running on just 5 cores was faster and more accurate than state-of-the-art linear models (like DISMEC) running on 100 cores.
- Model Size: The resulting models are significantly smaller. For example, on the EURLex dataset, CRAFTML’s model was 30MB, compared to 384MB for FastXML and 455MB for PFastReXML.
Limitations and Future Work
- Prediction Latency: While training is exceptionally fast, the paper notes that CRAFTML's prediction time can be slightly higher than some other tree-based methods, though it remains within a competitive complexity class.
- Hyperparameter Sensitivity: The performance relies on finding the right balance between the number of trees ($m_F$) and the projection dimensions ($d'_x$).
- Future Directions: The authors suggest that the simple learning blocks (k-means and centroid classifiers) leave room for "plug-and-play" extensions—potentially swapping in even more sophisticated fast classifiers as the field of extreme classification evolves.
Summary updated