Candidate Generation with Binary Codes for Large-Scale Top-N Recommendation

Wang-Cheng Kang, Julian John McAuleyCIKM 2019 · DOI

TL;DR

This paper introduces CIGAR, a novel framework for large-scale Top-N recommendation that combines efficient candidate generation using learned binary codes with accurate re-ranking using standard models. CIGAR achieves significant speedups (orders of magnitude) over existing methods while maintaining or even improving recommendation accuracy, addressing a critical bottleneck in real-world recommender systems.

What Problem Does This Paper Address?

Generating personalized recommendations, especially the "Top-N" items a user is most likely to interact with, is a computationally intensive task for large platforms with millions of users and items. Traditional approaches that exhaustively score every item for every user become prohibitively slow. While many industrial systems use a two-stage approach (candidate generation followed by re-ranking) to improve efficiency, there's a lack of systematic study on how well candidate generation approximates full rankings and how to generate high-quality candidates efficiently. Existing hashing-based methods offer speed but often sacrifice accuracy, while accurate real-valued models are too slow for large-scale candidate generation. This paper aims to bridge this gap by developing a framework that leverages the efficiency of binary codes for candidate generation and the accuracy of real-valued models for re-ranking.

Methods

The core of CIGAR is a two-stage process:

  1. Candidate Generation with HashRec: The authors propose a new method called HashRec to learn preference-preserving binary embeddings for users and items. Unlike previous hashing methods, HashRec directly learns binary codes that capture user preferences and uses a novel approximation of the sign function (tanh) to enable training with stochastic gradient descent (SGD). These learned binary codes are then used to build Multi-Index Hash (MIH) tables. MIH allows for efficient retrieval of a small set of candidate items (e.g., 200) for a given user in sub-linear time, significantly faster than exhaustive search.
  2. Candidate-Oriented Re-ranking: The retrieved candidates are then passed to a standard ranking model (like BPR-MF, CML, or NeuMF). Crucially, CIGAR introduces a candidate-oriented sampling strategy during the re-ranking model's training. This strategy biases the training process to focus on learning to rank the generated candidates effectively, rather than uniformly sampling all items. This is achieved by a weighted sampling scheme where candidates are given a higher probability of being sampled.

Datasets

The authors evaluated CIGAR on four public benchmark datasets and one proprietary dataset:

  • MovieLens-20M: A large dataset for collaborative filtering.
  • Amazon Books: A subset of Amazon product reviews.
  • Yelp: Business metadata and user reviews.
  • GoodReads: Book metadata and user actions.
  • Flipkart: User sessions from a large e-commerce platform.

These datasets vary in size, domain, and sparsity, allowing for a comprehensive evaluation of scalability and performance.

Key Insights and Ideas

  • Binary Codes for Preference: The idea of directly learning binary codes that preserve user preferences is powerful. It moves beyond simple quantization of real-valued embeddings and allows for efficient, hash-table-based retrieval.
  • Tanh Approximation for Differentiability: Using tanh(βx) as a differentiable approximation for the sign function (sgn(x)) is a clever way to enable end-to-end training of binary codes with gradient-based methods. The gradual increase of β during training helps bridge the gap between continuous embeddings and discrete binary codes.
  • Candidate-Oriented Training is Crucial: Simply using a standard ranking model on a small set of candidates is suboptimal. The proposed candidate-oriented sampling strategy significantly boosts performance by making the re-ranking model specialize in discriminating among the generated candidates, leading to better accuracy than even models trained on all items.
  • Model-Agnostic Efficiency: CIGAR's efficiency gains are not tied to a specific ranking model architecture. By reducing the problem to re-ranking a small candidate set, it can accelerate almost any existing recommendation model, including complex neural ones.

Key Results

  • Accuracy: CIGAR consistently outperforms state-of-the-art recommendation models, including those that rank all items, on various datasets. For example, on MovieLens-20M, CIGAR (HashRec + BPR-MF+) achieves a 28.4% improvement in MRR@10 compared to BPR-MF.
  • Efficiency: CIGAR achieves dramatic speedups, reducing query time by orders of magnitude. On the largest dataset (Flipkart), CIGAR is at least 1,000 times faster than linear scan and around 100 times faster than tree-based methods. The retrieval time of CIGAR increases very slowly with the number of items.
  • Candidate Quality: The HR@200 of HashRec (candidate generation) is significantly higher than the HR@10 of many full-ranking methods, indicating that the generated candidates are of high quality and provide a strong basis for re-ranking.
  • Hyperparameter Sensitivity: The number of bits (r) for binary codes positively impacts performance, especially on larger datasets. The sampling ratio (h) for candidate-oriented re-ranking is most effective around 0.5, demonstrating the importance of balancing candidate focus with general item knowledge.

Limitations and Future Work

  • Cold-Start: The current approach relies on learned embeddings, which can be problematic for new users or items with limited interaction data. The authors suggest learning hash functions (e.g., based on DNNs) to map user/item features to binary codes as a future direction to address cold-start issues.
  • Hyperparameter Tuning: While the paper provides default values and discusses sensitivity, optimal hyperparameter selection (especially for MIH's m and the regularization parameters) might still require careful tuning for specific datasets.
  • Fixed Candidate Set Size: The current framework uses a fixed number of candidates (c). Future work could explore adaptive candidate set sizes based on user or item characteristics.

Summary updated

BibTeX
@inproceedings{kang2019candidate,
  author = {Wang-Cheng Kang and Julian John McAuley},
  title = {{Candidate Generation with Binary Codes for Large-Scale Top-N Recommendation}},
  booktitle = {ACM International Conference on Information and Knowledge Management},
  year = {2019},
  doi = {10.1145/3357384.3357930},
}
Figure