Introduction
In traditional machine learning, the standard assumption is that the number of classes ($k$) is small and fixed while the number of training examples ($m$) grows. However, modern "extreme" classification tasks—such as tagging every page on the web or categorizing the 1.5 million categories on Wikipedia—invert this relationship. In these scenarios, the number of classes scales with the data, often leading to a situation where $k \ge \Omega(m)$. This creates significant statistical and computational challenges, as most classes have very few examples, making separate one-vs-all classifiers impractical.
Methodology
To address these challenges, we propose a two-stage pipeline designed for both efficiency and statistical robustness:
- Initial Classification: We employ a simple, scalable algorithm to generate a "rough draft" of labels. In our experiments, we use Label Propagation over a "click graph" (a network connecting search queries to web pages). This allows labels to flow from known Wikipedia articles to unlabeled web pages based on user behavior.
- Label Pruning: This core innovation involves using a validation set to count true positives and false positives for each class. We then apply a pruning rule: discard any label where the ratio of false positives to true positives exceeds a specific threshold.
Theoretical Foundation: The Power Law
A key insight of this work is that the distribution of labels in real-world systems typically follows a power-law distribution (Zipf’s Law). We provide a rigorous theoretical proof showing that if labels follow this distribution, the pruning process remains statistically valid even when $k > m$. Because class frequencies follow a power law, the aggregate error of the pruning rule stays low; most "bad" labels are rare enough that pruning them based on even minimal evidence improves the overall system performance.
Experimental Evaluation
We evaluated our approach on a massive real-world task: categorizing the entire web using the 1.5 million categories defined by Wikipedia. We used search engine logs to create a bipartite click graph between millions of queries and web pages. The dataset consisted of 2.9 million Wikipedia articles, split into 50% training, 30% validation (for pruning), and 20% test.
Results
We compared our pruning algorithm against the original (unpruned) labeling and a random pruning baseline across four different labeling scenarios (A, B, C, and D), which varied based on the extent of label propagation.
As shown in the figures above, our algorithm significantly outperformed both the original labeling and the random baseline in all scenarios. The performance, measured by the test loss ratio, remained consistently high as the parameter $\gamma$ (representing the weight of false negatives) was adjusted. Notably, our simple empirical pruning rule achieved results very close to a theoretical "oracle" baseline. Furthermore, the entire experiment was computationally efficient enough to be performed on a single server, despite the millions of classes involved.
Conclusion
This research demonstrates that label pruning is a powerful, model-agnostic tool for extreme classification. By leveraging the statistical properties of power-law distributions, we can effectively filter out harmful labels even when data for individual classes is sparse. Future work will explore accounting for class dependencies and more complex label transformation rules beyond simple pruning.
Summary updated