Real-Time Hard Negative Sampling via LLM-based Clustering for Large-Scale Two-Tower Retrieval

2026-07-01Information Retrieval

Information RetrievalArtificial Intelligence
AI summary

The authors looked at a common recommendation model that learns by comparing good and bad examples but noticed the bad examples were often too easy, so the model didn’t learn much from them. To fix this, they used a large language model to create harder, more challenging bad examples from similar groups during training. This new method works well with huge datasets and can be added to real systems without much extra computing power. Tests showed their approach beats popular current methods and helps reduce biases like only recommending popular items.

two-tower modelrecommendation systemsnegative samplinghard negativeslarge language modelself-supervised learningpopularity biasfeedback loopsreal-time samplingmedia representations
Authors
Ivan Ji, Liuyi Hu, Harrison, Zhao, Lei Huang, Qunshu Zhang, Max, Fan, Aameek Singh
Abstract
The two-tower model has been widely used for large-scale recommendation systems, particularly in the retrieval stage. Industry standards for training two-tower models typically involve in-batch and/or out-of-batch negative sampling. However, these methods often produce easy negatives that models can quickly learn, failing to sufficiently challenge the model. To address this issue, a novel self-supervised hard negative sampling technique is proposed that leverages a large language model (LLM) to generate hard negatives from the same cluster during model training. By utilizing the LLM to learn media representations, the proposed approach ensures that the generated negatives are more challenging and informative. This real-time sampling framework is designed for seamless integration into production models, capable of handling billions of training data points with minimal computational complexity. Experiments on public datasets, along with deployment to a large-scale online system, demonstrate that the proposed negative sampling technique outperforms widely used industry methods. Furthermore, analysis in industrial applications reveals that this sampling method can help break inherent feedback loops in recommendations and significantly reduce popularity bias.