PECOS: Prediction for Enormous and Correlated Output Spaces

Hsiang-Fu Yu, Kai Zhong, Jiong Zhang, Wei-Cheng Chang, Inderjit S Dhillon

TL;DR

This paper introduces PECOS, a flexible framework for tackling prediction problems with massive output spaces, like eXtreme Multi-label Ranking (XMR). PECOS uses a three-stage approach (indexing, matching, ranking) to efficiently handle millions or billions of potential outputs, addressing data sparsity by leveraging correlations between items.

What Problem Does This Paper Address?

Many real-world applications, such as product recommendation or search query suggestion, involve predicting from an enormous number of potential outputs. These "enormous output spaces" can contain millions, billions, or even infinite possibilities. A significant challenge is the "long-tail" problem: training data is often scarce for many of these potential outputs. Fortunately, these outputs are often correlated, offering an opportunity to improve predictions. The paper aims to build a scalable and effective framework for these problems, specifically focusing on the eXtreme Multi-label Ranking (XMR) task.

Methods

PECOS is a modular, three-stage framework:

  1. Semantic Label Indexing: The vast output space is organized using a semantic indexing scheme. This typically involves clustering similar labels together, reducing the effective search space. For example, they use hierarchical label trees (HLTs) constructed via recursive B-ary partitioning.
  2. Machine-Learned Matching: A learned model narrows down the potential candidates from the indexed space to a much smaller subset. This stage leverages the clusters identified in the first phase. They explore both linear and neural (Transformer-based) matchers.
  3. Ranking: A final ranking model scores and orders the shortlisted candidates from the matching phase.

The framework's modularity allows for plug-and-play of different techniques for each stage, enabling practitioners to balance performance and computational cost. They also propose efficient inference procedures and techniques for handling sparse data.

Datasets

The paper evaluates PECOS on six real-world extreme multi-label text classification datasets:

  • Eurlex-4K
  • Wiki10-31K
  • AmazonCat-13K
  • Wiki-500K
  • Amazon-670K
  • Amazon-3M

These datasets are standard benchmarks in the XMR field.

Key Insights and Ideas

  • Leveraging Correlations is Key: The core idea is that items in large output spaces are correlated. PECOS exploits this by organizing labels into clusters, allowing information to be transferred from "head" labels (with more data) to "tail" labels (with less data), mitigating sparsity.
  • Three-Stage Scalability: The indexing, matching, and ranking stages break down a massive problem into manageable sub-problems, drastically reducing computational complexity for both training and inference.
  • Recursive Structure for Deeper Hierarchies: The XR-LINEAR and XR-TRANSFORMER models recursively apply the PECOS framework, creating hierarchical label trees. This allows for more nuanced partitioning and potentially better performance on very large label spaces.
  • Transformer Matchers for Text: For text-based XMR tasks, fine-tuning pre-trained Transformer models (like BERT, XLNet, RoBERTa) as matchers yields state-of-the-art results, demonstrating their power in capturing rich semantic information.
  • Trade-offs are Explicit: The paper clearly highlights the trade-offs between different PECOS variants, particularly between the highly efficient XR-LINEAR and the more accurate but computationally intensive XR-TRANSFORMER. This empowers users to choose based on their specific needs.

Key Results

  • State-of-the-Art Performance: XR-TRANSFORMER, a recursive Transformer-based realization of PECOS, achieves state-of-the-art results on several XMR benchmarks, especially on datasets with large output spaces. For example, on Amazon-3M, it achieved 54.2% precision@1.
  • Efficiency of XR-LINEAR: XR-LINEAR, a linear realization, offers significantly faster training times (e.g., 2x-5x faster than TFN+MAN) and inference speeds (e.g., <1ms per input on a 2.8M label dataset) while still providing competitive performance.
  • Training Time Reduction: The recursive nature and efficient indexing/matching significantly reduce training time compared to naive approaches. For instance, a PECOS model for a 0.5M label dataset was trained in 5 hours on a 16-CPU machine, whereas a simple OVR approach would take months.
  • Inference Speed: PECOS enables real-time inference, with speeds as low as <1ms per input on large datasets.

Limitations and Future Work

  • Computational Cost of Transformers: While achieving state-of-the-art accuracy, Transformer-based matchers (XR-TRANSFORMER) are significantly more computationally expensive to train (orders of magnitude more) than linear models (XR-LINEAR).
  • Hyperparameter Tuning: The authors note that the best choices for negative sampling schemes and transform functions are data-dependent and require proper hyperparameter tuning.
  • Future Work:
    • Exploring alternative semantic label indexing strategies (e.g., overlapping label clustering, approximate nearest neighbor search).
  • Investigating more sophisticated ranker choices (e.g., gradient boosting, neural networks).
  • Extending PECOS to handle infinite output spaces with structure, potentially by incorporating generative models.
  • Developing distributed computation for further scalability.

Summary updated

BibTeX
@article{yu2022pecos,
  author = {Hsiang-Fu Yu and Kai Zhong and Jiong Zhang and Wei-Cheng Chang and Inderjit S Dhillon},
  title = {{PECOS: Prediction for Enormous and Correlated Output Spaces}},
  journal = {J. Mach. Learn. Res.},
  year = {2022},
  url = {https://openreview.net/forum?id=D29VrThBFJ},
}
Figure