Cache-Augmented Inbatch Importance Resampling for Training Recommender Retriever

Jin Chen, Defu Lian, Yucheng Li, Baoyun Wang, Kai Zheng, Enhong Chen

Overview

Training large-scale recommender retrievers often relies on "inbatch sampling" for efficiency, but this method suffers from significant sampling bias. This paper introduces $\chi$IR (Cache-Augmented Inbatch Importance Resampling), a novel approach that makes negative sampling query-dependent and uses a dynamic cache to reuse "hard" negatives from previous training steps. This leads to faster convergence and significantly better recommendation accuracy.

The Challenge of Inbatch Sampling

In modern recommendation systems, the "retriever" is the first line of defense. Its job is to quickly narrow down millions of items to a few hundred candidates using a "two-tower" model (one tower for the user/query, one for the item). To train these models, we typically use a log-softmax loss, which requires comparing a positive item against all other items in the corpus—a task that is computationally impossible at scale.

The industry standard is inbatch sampling: taking the items already present in your training mini-batch and treating them as "negatives" for each other. While hardware-efficient, this has two major flaws:

  1. Selection Bias: Items that appear frequently in the training data (popular items) are over-sampled as negatives.
  2. Query Blindness: Most existing methods correct for popularity but treat every query in the batch the same way. In reality, a "hard" negative for a sports fan is very different from a hard negative for a gourmet chef.

The Proposed Solution: $\chi$IR

The authors propose a two-step solution to address these flaws:

  1. BIR (Inbatch Importance Resampling): Instead of just using all items in a batch as negatives, BIR calculates a query-specific "importance weight" for each item in the batch. It then resamples a subset of these items to act as negatives. This allows the model to distinguish between queries within the same mini-batch, providing more tailored (and thus more informative) gradients.
  2. $\chi$IR (Cache-Augmented IR): To further improve the quality of negatives, the authors introduce a Cache. They track how often items are selected during the BIR process. Items that are selected frequently are likely "hard negatives"—items that the model currently finds difficult to distinguish from positive matches. These hard negatives are stored in a fixed-size cache and mixed into future mini-batches.

By combining these, $\chi$IR creates a "query-dependent" proposal distribution that adaptively changes as the model learns, focusing the training effort on the most informative examples.

Key Results and Performance

The researchers evaluated their method on five diverse, real-world public datasets (Gowalla, Amazon, Ta-feng, Echonest, and Tmall). The proposed $\chi$IR method consistently outperformed state-of-the-art baselines, including Google's G-Tower and Mixed Negative Sampling (MNS).

Accuracy Boost: Across all datasets, $\chi$IR demonstrated superior retrieval metrics. For instance, on the Tmall dataset, $\chi$IR improved NDCG@10 by 17.12% and Recall@10 by 11.73% compared to standard inbatch sampling.

Recall@10 performance comparison across datasets

Faster Convergence: The models reached high performance levels in fewer training epochs. Because the query-dependent negatives provide a stronger, more accurate signal, the model learns underlying user preferences much faster than baseline methods.

NDCG@10 convergence over epochs on the Tmall dataset

Additional Insights

  • Hard Negatives are Dynamic: What constitutes a "hard" negative changes as the model improves. The cache mechanism acts as a "memory" of what the model recently struggled with, ensuring those items are revisited.
  • Efficiency via Resampling: Surprisingly, the authors found that you don't need to use the entire mini-batch as negatives. Resampling just 1/64th of the batch using their importance weights can achieve performance comparable to using the full batch, potentially saving significant computation during the gradient update.
  • Correcting the "Matthew Effect": By using importance resampling, the model avoids the trap of over-penalizing popular items just because they appear more often in the logs, leading to a more balanced and fair retriever.

Limitations and Future Work

While $\chi$IR significantly reduces bias, the authors acknowledge that it is still an approximation of the full softmax; a small amount of bias relative to the "ideal" distribution remains.

Future directions suggested by the work include automating the tuning of the hyperparameter ratio ($\lambda$) that balances the influence of the cache versus the current mini-batch, and exploring how this sampling strategy interacts with even more complex, deeper tower architectures.

Summary updated

BibTeX
@inproceedings{chen2022cache,
  author = {Jin Chen and Defu Lian and Yucheng Li and Baoyun Wang and Kai Zheng and Enhong Chen},
  title = {{Cache-Augmented Inbatch Importance Resampling for Training Recommender Retriever}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2022},
  url = {https://openreview.net/forum?id=XTd2TXbxJG},
}
Figure