Manuscript Offprint

arXiv:2609.00638

It Takes Two to Match: Co-Evolving Generative Retriever with Reinforcement Learning

Runpeng Dai, Kaili Huang, Changsung Kang, Ciya Liao

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Runpeng Dai1,2,†^{1,2,\dagger}, Kaili Huang2^{2}, Changsung Kang2^{2}, Ciya Liao2^{2}

1^{1}University of North Carolina at Chapel Hill 2^{2}Apple

Retrieval is the first stage of modern search and advertising systems, selecting a candidate set from a large item universe for downstream ranking and auction. Recent work increasingly leverages LLMs to improve retrieval through query expansion, data synthesis, and retrieval-feedback training. However, the generative component is typically used for query-side augmentation, while final matching is still delegated to a downstream retriever. We introduce CoGR, a retrieval framework that instead trains LLMs to directly construct retrieval representations on both 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 uses a two-stage training pipeline. Supervised fine-tuning first establishes an aligned keyword space, after which co-evolving reinforcement learning alternately optimizes the query- and item-side generators with GRPO against the opposite side's frozen index. Both sides optimize the same query-to-item retrieval F1F_1 objective: the query side receives retrieval F1F_1 directly, while the item side receives a counterfactual marginal reward measuring the change in query-side F1F_1 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 F1F_1 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.

Correspondence: Runpeng Dai: runpeng@unc.edu; Ciya Liao: ciya.liao@apple.com

1 Introduction

Retrieval is the first stage of modern search and recommendation systems. Given a query, it selects a candidate set from a large item universe for downstream ranking and auction. This stage is consequential because its errors are largely irreversible. An item not retrieved cannot be recovered by later models while irrelevant candidates increase the burden on downstream stages. An effective retriever must therefore maintain broad coverage while keeping the candidate set precise, reflecting the fundamental trade-off between recall and precision (Chowdhury, 2010).

Classical lexical retrieval methods such as BM25 (Robertson and Zaragoza, 2009) match queries and items through explicit terms and inverted indexes. Within this paradigm, keyword-based retrieval is especially prevalent in sponsored search, where advertisers directly bid on keywords. However, lexical representations can be limited in capturing deeper semantic relationships. To move beyond exact lexical overlap, dense retrieval maps queries and items into a shared continuous representation space and matches them through vector similarity (Karpukhin et al., 2020; Xiong et al., 2020; Ni et al., 2022). More recently, generative retrieval offers another alternative by directly generating semantic identifiers, replacing similarity-based matching with autoregressive prediction (Tay et al., 2022; Wang et al., 2022; Sun et al., 2023; Zeng et al., 2024a). However,

†^{\dagger}Work done during the internship at Apple.

Apple and the Apple logo are trademarks of Apple Inc., registered in the U.S. and other countries and regions.

Figure

Figure 1 The overall CoGR training pipeline and performance. CoGR consists a SFT stage and a co-evolving RL stage looping between Item and Query LLMs. CoGR achieves strong performance gains on both internal APP marketplace and public item search benchmarks.

generative retrieval often depends heavily on identifier design and faces challenges in decoding scalability and generalization (Li et al., 2025b).

Recent work has explored the use of LLMs for retrieval, leveraging their strong capabilities in semantic understanding. Earlier approaches prompt LLMs for query expansion, data synthesis, or keyword generation to improve retrieval (Gao et al., 2023; Wang et al., 2023a; Ma et al., 2023; Liu et al., 2025). More recent methods further train LLMs using feedback from downstream retrievers (Jiang et al., 2025a; Li et al., 2025a; Yao et al., 2025). However, these methods typically train generator of one side, most often the query side and they still rely on a separate downstream retriever for matching. This raises a natural question: can we instead train LLMs to jointly construct retrieval representations for both sides and directly match queries and items in the resulting representation space?

To this end, we propose CoGR, a retrieval framework that trains separate LLMs to generate keywords for queries and items. Given a query or an item, the corresponding generator produces a compact set of keywords, and retrieval is performed directly by matching the generated keyword sets through an inverted index. The generated keywords thus serve directly as retrieval representations. This design also preserves compatibility with existing keyword-based retrieval infrastructure.

The key challenge is to align the two generated keyword spaces so that semantically relevant query-item pairs can be reliably matched. CoGR addresses this with a two-stage training pipeline consisting of supervised fine-tuning (SFT) followed by co-evolving reinforcement learning (RL). The SFT stage establishes an aligned initialization by constructing query-side targets from the keywords of relevant items. Starting from this initialization, we alternately optimize the query- and item-side generators with GRPO (Shao et al., 2024). The query-side generator is rewarded directly by the retrieval F1F_1 induced by its generated keywords, while the item-side generator receives a counterfactual marginal reward that measures the change in the same query-side F1F_1 objective caused by replacing its keyword set. During each update, the index produced by the opposite side is kept frozen, allowing each generator to optimize against a fixed retrieval environment while the two keyword spaces progressively co-evolve.

Empirically, we compare CoGR against 10 representative baselines spanning sparse, dense, and generative retrieval. On both the internal APP Marketplace dataset and the public WANDS product-search benchmark (Chen et al., 2022), CoGR achieves the best overall retrieval performance, improving F1F_1 over the strongest baseline by 10.9% and 36.1%, respectively. We further find that alternating query-item optimization is dynamically stable, that co-evolving both sides is important for strong performance, and that the generated keyword spaces become increasingly specific and aligned over training.

References (64)