Retrieval is the critical first step in modern search and advertising systems, where a candidate set is selected from a vast item universe for downstream ranking and auction. Recent advances have leveraged large language models (LLMs) to improve retrieval through query expansion, data synthesis, and retrieval-feedback training. However, these approaches typically use LLMs only for query-side augmentation, leaving the final matching to a separate retriever.
In a new paper, researchers from Hugging Face introduce CoGR (Co-evolving Generative Retrieval), a framework that trains LLMs to directly construct retrieval representations on both the query and item sides. Each generator produces a compact set of keywords, which are matched directly through an inverted index, preserving compatibility with existing keyword-based retrieval infrastructure.
CoGR employs a two-stage training pipeline. First, supervised fine-tuning establishes an aligned keyword space. Then, co-evolving reinforcement learning alternately optimizes the query- and item-side generators using GRPO, with each side's index frozen while the other is updated. Both sides optimize the same query-to-item retrieval F₁ objective: the query side receives retrieval F₁ directly, while the item side receives a counterfactual marginal reward measuring the change in query-side F₁ caused by its generated keywords.
Across 10 representative sparse, dense, and generative baselines, CoGR achieves the best performance on both an internal APP Marketplace dataset and the public WANDS benchmark, improving F₁ over the strongest baseline by 10.9% and 36.1%, respectively. Further analysis shows stable co-evolution and increasingly aligned query–item keyword spaces over training.