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

Ivan Ji, Liuyi Hu, Harrison, Zhao, Lei Huang +4 more
7/1/2026
cs.IRcs.AI

No confident code implementation found for this paper. 1 possible match can be shown below.

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.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. 1 weaker match is hidden by default — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{ji2026realtime,
  title  = {Real-Time Hard Negative Sampling via LLM-based Clustering for Large-Scale Two-Tower Retrieval},
  author = {Ivan Ji and Liuyi Hu and Harrison and Zhao and Lei Huang and Qunshu Zhang and Max and Fan and Aameek Singh},
  year   = {2026},
  eprint = {2607.00448},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2607.00448v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2607.00448.svg)](https://codeofpaper.com/paper/2607.00448)

Discussion