Manuscript Offprint
arXiv:2609.00638It Takes Two to Match: Co-Evolving Generative Retriever with Reinforcement Learning
Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.
Runpeng Dai, Kaili Huang, Changsung Kang, Ciya Liao
University of North Carolina at Chapel Hill 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 objective: the query side receives retrieval directly, while the item side receives a counterfactual marginal reward measuring the change in query-side 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 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,
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 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 induced by its generated keywords, while the item-side generator receives a counterfactual marginal reward that measures the change in the same query-side 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 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.
2.1 Overview
Retrieval is a fundamental task for modern search systems. Given a query , the goal is to retrieve the set of relevant items from a fixed item universe . Depending on the scenario, the item may be an advertisement, an app, a product, or a document.
Our method generates keywords for both queries and items and performs keyword-based matching. We train two separate keyword generators: query-side and item-side generators , . Given a query and an item , the two generators produce sets of keywords, denoted by and , respectively. Then we get the retrieved item set , containing items whose keyword sets overlap. To enable retrieval ranking, we treat each side's keyword set as a bag of words and rank the retrieved items by their BM25 score.
CoGR contains two stages, as illustrated in Figure 2. First, a supervised fine-tuning (SFT) stage initializes both generators. Then, a reinforcement-learning stage alternately updates the query-side and item-side generators to optimize retrieval quality.
2.2 Phase 1 — Initialization with Supervised Fine-tuning
Phase 1 of CoGR serves two purposes. First, it establishes an aligned keyword space between the query and item generators. Second, it provides RL with a meaningful initialization, ensuring sufficient initial recall to produce informative reward signals rather than requiring exploration from scratch.
Algorithm 1 SFT initialization of both sides.
Require: Query and item sets , base LLM , budgets
1: for all items do 2: keywords sampled from 3: end for 4: for all queries do 5: multiset 6: most frequent keywords of 7: end for 8: 9:
The SFT data construction is summarized in Algorithm 1. We first use the original LLM to generate item-side keywords for each item , obtaining an initial keyword set . We then construct query-side targets using the relevance labels. For each query , we collect relevant items, pool their initial item-side keywords, and select the top- most frequent keywords as the query-side target keyword set . This construction ties each query-side keyword to keywords associated with its relevant items, thereby creating keyword overlap between relevant query-item pairs. Finally, we train the query-side generator on and the item-side generator on with SFT, yielding the initialized policies and .
2.3 Phase 2 — Co-Evolving Reinforcement Learning
After SFT, the RL stage further optimizes the two generators directly for retrieval quality. We adopt an alternating training paradigm: the query-side and item-side generators are updated in turn, while the inverted index constructed from the other side is kept frozen. This allows each generator to be optimized against a fixed retrieval environment rather than a moving target. In this section, we first introduce the specific reward design for each side, and then describe the alternating procedure that couples the two generators.
Query-Side RL. Given the item indexes generated by the frozen item-side LLM, query-side RL optimizes the query-side generator to improve retrieval quality. For each query , the query-side generator produces a keyword set . The generated keywords are then matched against the item indexes to obtain the retrieved item set . Ideally, the retrieved set should cover as many relevant items in while including as few irrelevant items as possible. We therefore use the score to evaluate retrieval quality:

Figure 2 Co-evolving reinforcement learning in CoGR. Training alternates between query-side and item-side optimization, with the opposite-side index kept frozen during each stage. Left: Query-side RL. The item LLM from the previous round constructs a frozen item index. For each query, the query LLM samples keyword sets, retrieves items through keyword matching, and is optimized with GRPO using the resulting retrieval as reward. Right: Item-side RL. The updated query LLM constructs a frozen query index. For each sampled keyword set , we construct a counterfactual item index by replacing only the reference keywords of item while leaving all other items unchanged. The item LLM is optimized with GRPO using the resulting marginal contribution to query-side retrieval quality, as defined in Equation 2.3.
In industrial retrieval systems, both precision and recall are closely tied to business outcomes. Precision reflects the system's ability to filter out irrelevant items and therefore directly affects the user experience. Recall measures the coverage of relevant candidates passed to downstream ranking and bidding stages and is thus closely related to potential revenue. The score balances these two objectives and serves as a good reward signal.
To constrain the number of generated keywords, we further impose a maximum keyword budget . A sampled keyword set receives a reward of 0 if it exceeds the budget constraint:
Following the GRPO training paradigm (Shao et al., 2024), we sample multiple keyword sets for each query and compute a terminal reward for each rollout. The rewards are then normalized within each rollout group to obtain relative advantage signals for optimizing the query-side generator.
Item-Side RL. Item-side RL aims to improve query-to-item retrieval by refining item keywords. Given a candidate keyword set for item , we evaluate its quality by the change it induces in the overall retrieval quality.¹ This requires isolating the contribution of from those of all other items.
Specifically, at the beginning of each item-side update round, we freeze the query-side index and take the current item-side index as the reference state. We then construct a counterfactual index by replacing only the reference keywords of item with , while leaving the keywords of all other items unchanged. For each query , let and denote the retrieved item sets under the reference and counterfactual
¹We measure overall retrieval quality by summing the per-query scores defined in equation 2.1.
indexes, respectively. We define the item-side reward as
The first term in equation 2.3 measures the aggregate retrieval quality under the counterfactual index, while the second measures that under the reference index. Their difference therefore isolates the effect attributable to . This difference-based formulation also enables efficient reward computation, as queries whose scores remain unchanged cancel out in equation 2.3. Rather than running retrieval and computing for every query, we use the query-side inverted index together with cached query retrieval results to identify the affected queries and calculate only their contributions. We provide further implementation details in Appendix D.
Co-Evolving & Discussion. Phase 2 of CoGR is an iterative approach between query-side and item-side RL starting from the post-SFT models. The first query-side RL phase uses the as index target. In later stages, each side is optimized against an index built by the latest model on the other side. This creates a co-evolution process in which the two generators progressively adapt to each other's keyword space and jointly evolve to improve the retrieval quality. The overall loop is summarized in Algorithm 2.
Algorithm 2 Co-evolving RL loop.
1: Initialize: Build item index from 2: for iteration do 3: Train against frozen item index 4: Build query index from 5: Train against frozen query index 6: Build item index from 7: end for
The framework also offers considerable flexibility. The same reward design can also be used with other RL algorithms such as PPO (Schulman et al., 2017). In applications where precision and recall have different business priorities, the standard reward can also be replaced by a weighted F-measure (Van Rijsbergen, 1979). Unless otherwise specified, we use the standard score throughout this work.
3 Experiment Setting
3.1 Datasets
We evaluate our method on two industrial search datasets. The first is an internal APP marketplace search dataset consisting of de-identified, randomly sampled user queries. Each item corresponds to an application and is represented by its title and description. The second is WANDS (Chen et al., 2022), a public product-search dataset from Wayfair, where each item corresponds to a product and is likewise represented by its title and description. Both datasets provide categorical relevance annotations for (query, item) pairs, which we binarize into relevant and irrelevant classes (see Appendix A for details). We split the data only along the query dimension while retaining the full item universe for both training and validation, so that performance on validation set reflects generalization to unseen queries. Dataset statistics, including the number of relevant items per query, are summarized in Table 1. We focus on these datasets because practical retrieval often involves many relevant items per query. In contrast, many conventional information retrieval datasets typically provide much sparser relevance annotations and thus less faithfully reflect this many-to-many setting.
Table 1 Key statistics of our Internal APP marketplace search (Internal) dataset and WANDS dataset.
| Dataset | Queries (Train / Evaluation) | Item universe | Relevant items per query |
|---|---|---|---|
| Internal | 13,500 / 1,500 | 39,600 Applications | 1,000 |
| WANDS | 430 / 50 | 42,994 Products | 200 |
3.2 Baseline Methods
We compare CoGR against three representative families of retrieval baselines, selecting widely used methods from each category. Additional implementation details are provided in Appendix B.
- Sparse (lexical) retrieval, which scores query-item matches over sparse term representations. We include the classical BM25 (Robertson and Zaragoza, 2009) and the learned sparse retriever SPLADE-v2 (Formal et al., 2022).
- Dense retrieval, which maps queries and items into a shared embedding space and retrieves items based on nearest-neighbor similarity. We include DPR (Karpukhin et al., 2020) and ANCE (Xiong et al., 2020). To provide a stronger dense baseline at a model scale comparable to CoGR, we additionally evaluate Qwen3-Embedding-4B (Yang et al., 2025) in both zero-shot and ANCE-finetuned settings.
- Generative retrieval, which directly generates item identifiers using a sequence model. We include DSI (Tay et al., 2022), DSI-QG (Zhuang et al., 2022), and RIPOR (Zeng et al., 2024a). We further include DeepRetrieval (Jiang et al., 2025a), which trains a query-rewriting language model with reinforcement learning and is therefore closely related to our query-side RL formulation.
3.3 Training Setup
We instantiate two separate generators, one for the query side and one for the item side, using the same backbone architecture at each model scale: Qwen3-4B-Instruct for CoGR-4B and Qwen3-1.7B for CoGR-1.7B. Both Phase 1 and Phase 2 use the same prompt template shown in Figure 5. We directly generate keywords without chain-of-thought prompting to avoid additional inference overhead. In Phase 1 (SFT), we set the query-side top-N to 15 and the item-side keyword budget to 10. In Phase 2 (co-evolving RL), we train both generators with GRPO (Shao et al., 2024) using the ver1 framework (Sheng et al., 2024), with the generated keyword set capped at on both sides. We alternate query- and item-side optimization for five rounds, training the query generator for 10 GRPO epochs and the item generator for 5 epochs per round. Unless otherwise specified, subsequent analyses use CoGR-4B. Additional training and implementation details are provided in Appendix B.
4 Experimental Results
4.1 Main Results
The main results are reported in Table 2, with additional results at different retrieval cutoffs provided in Appendix C. Table 2 reports precision, recall, and , together with MRR, NDCG, and precision, recall, and at the top-100 cutoff, while Table 7 provides corresponding results at cutoffs of 10 and 1000. For CoGR, retrieval rankings are obtained using BM25 over the generated keywords, as described in Section 2.1. For the precision, recall, and scores of baseline methods, we sweep over retrieval cutoffs on the training set, select the cutoff that yields the best training , and report the corresponding performance on the validation dataset. Overall, CoGR consistently achieves the highest score, demonstrating a clear advantage over strong baselines. The key observations of Table 2 are as follows:
- CoGR achieves the strongest and most consistent performance across datasets, obtaining the best overall on both datasets, with scores of 0.396 and 0.682, respectively. Among the baselines, dense retrieval is comparatively more stable across the two datasets, with ANCE-Qwen4B consistently serving as the strongest baseline. In contrast, sparse retrieval performs substantially worse on the more challenging Internal dataset, while generative retrieval baselines degrade notably on the smaller and simpler WANDS dataset.
- The co-evolving design of CoGR is necessary for strong retrieval performance. CoGR substantially outperforms both CoGR* and DeepRetrieval, which optimize only the query-side keyword generator or query rewriter while keeping the item-side representations fixed. This consistent gap indicates that improving only the query-side representation is insufficient, and that jointly adapting the query and item keyword spaces is important for learning a well-aligned retrieval system.
Table 2 Retrieval performance on the validation datasets. Columns suffixed with @100 (MRR@100, NDCG@100, P@100, R@100, @100) are computed on the top-100 retrieved items, while , , and are the macro-averaged precision, recall, and over the full retrieved set. denotes that the Item-side parameters are frozen. The best value in each column within a dataset is shown in bold. Metrics at cutoffs 10 and 1000 are reported in Appendix C.
| Dataset | Type | Method | MRR@100 | NDCG@100 | P@100 | R@100 | @100 | P | R | |
|---|---|---|---|---|---|---|---|---|---|---|
| Internal | Sparse | BM25 | 0.6728 | 0.2654 | 0.3630 | 0.0377 | 0.0611 | 0.2453 | 0.1141 | 0.1056 |
| SPLADE-v2 | 0.5741 | 0.3365 | 0.4152 | 0.0588 | 0.0943 | 0.2706 | 0.4486 | 0.3019 | ||
| Dense | Qwen3-4B emb. | 0.7255 | 0.4102 | 0.4436 | 0.0638 | 0.1022 | 0.2310 | 0.2689 | 0.2191 | |
| DPR | 0.5037 | 0.2860 | 0.3532 | 0.0504 | 0.0807 | 0.2408 | 0.4058 | 0.2700 | ||
| ANCE | 0.6158 | 0.3866 | 0.4544 | 0.0636 | 0.1026 | 0.2671 | 0.4396 | 0.2971 | ||
| ANCE-Qwen4B | 0.7572 | 0.4879 | 0.5691 | 0.0818 | 0.1312 | 0.3756 | 0.4354 | 0.3575 | ||
| Generative Retrieval | DSI | 0.6323 | 0.3393 | 0.4234 | 0.0581 | 0.0935 | 0.2882 | 0.4790 | 0.3220 | |
| DSI-QG | 0.6644 | 0.3560 | 0.4413 | 0.0599 | 0.0966 | 0.2901 | 0.4814 | 0.3241 | ||
| RIPOR | 0.6719 | 0.4146 | 0.4975 | 0.0674 | 0.1100 | 0.3371 | 0.3793 | 0.3167 | ||
| DeepRetrieval 4B | 0.7454 | 0.4437 | 0.5128 | 0.0715 | 0.1159 | 0.2907 | 0.3333 | 0.2750 | ||
| CoGR* 1.7B | 0.6450 | 0.3575 | 0.4310 | 0.0588 | 0.0958 | 0.3177 | 0.2289 | 0.2399 | ||
| CoGR 1.7B | 0.7055 | 0.4456 | 0.5244 | 0.0739 | 0.1190 | 0.3523 | 0.4169 | 0.3527 | ||
| CoGR* 4B | 0.7020 | 0.3958 | 0.4694 | 0.0661 | 0.1066 | 0.3335 | 0.2459 | 0.2617 | ||
| CoGR 4B | 0.7667 | 0.4930 | 0.5844 | 0.0844 | 0.1349 | 0.3976 | 0.4569 | 0.3963 | ||
| WANDS | Sparse | BM25 | 0.8575 | 0.7047 | 0.6508 | 0.4092 | 0.4263 | 0.4768 | 0.6149 | 0.4418 |
| SPLADE-v2 | 0.9090 | 0.7872 | 0.7340 | 0.4506 | 0.4678 | 0.5914 | 0.6050 | 0.4903 | ||
| Dense | Qwen3-4B emb. | 0.6471 | 0.4718 | 0.4270 | 0.2572 | 0.2599 | 0.3371 | 0.3408 | 0.2634 | |
| DPR | 0.8861 | 0.7259 | 0.6794 | 0.4071 | 0.4222 | 0.5612 | 0.5581 | 0.4520 | ||
| ANCE | 0.8903 | 0.7333 | 0.6932 | 0.4000 | 0.4218 | 0.5731 | 0.5485 | 0.4554 | ||
| ANCE-Qwen4B | 0.9085 | 0.7955 | 0.7506 | 0.4498 | 0.4717 | 0.6136 | 0.6092 | 0.5012 | ||
| Generative Retrieval | DSI | 0.5862 | 0.4706 | 0.4620 | 0.2396 | 0.2527 | 0.3994 | 0.3468 | 0.2890 | |
| DSI-QG | 0.8517 | 0.6594 | 0.6270 | 0.3659 | 0.3867 | 0.5051 | 0.5044 | 0.4023 | ||
| RIPOR | 0.7905 | 0.5966 | 0.5704 | 0.3044 | 0.3283 | 0.4760 | 0.4205 | 0.3595 | ||
| DeepRetrieval 4B | 0.8592 | 0.7029 | 0.6473 | 0.4072 | 0.4234 | 0.4802 | 0.6155 | 0.4431 | ||
| CoGR* 1.7B | 0.8332 | 0.4652 | 0.5945 | 0.2123 | 0.2686 | 0.5073 | 0.3751 | 0.3664 | ||
| CoGR 1.7B | 0.8903 | 0.6701 | 0.8398 | 0.3339 | 0.4236 | 0.7325 | 0.5503 | 0.5685 | ||
| CoGR* 4B | 0.8111 | 0.5710 | 0.6494 | 0.2941 | 0.3554 | 0.5691 | 0.4696 | 0.4662 | ||
| CoGR 4B | 0.9225 | 0.7146 | 0.8417 | 0.4059 | 0.4778 | 0.7940 | 0.6885 | 0.6819 |
4.2 Co-evolving Dynamics
Figure 3 shows the validation over the alternating RL process, starting from the SFT-initialized generators. The metric increases approximately from 0.16 before co-evolving to approximately 0.40 after five rounds of co-evolving alternation. The largest gain occurs in the first round of training, where RL begins to align the two generated keyword spaces. Subsequent query- and item-side updates provide smaller but steady improvements.
4.3 Ablation on Training Design
We ablate three design choices in CoGR: the marginal item-side reward in Equation 2.3, the use of separate query- and item-side generators, and the SFT initialization in Phase 1. Specifically, Transposed replaces the marginal item-side reward with a symmetric item-centric retrieval objective. Analogous to the query-side reward in Equation 2.2, we treat each item as a query and measure how well it retrieves its relevant queries:
Table 3 Ablation of training design choices on the Internal dataset. All experiments use Qwen3-4B as the base model.
| Variant | P | R | |
|---|---|---|---|
| Transposed | 0.3482 | 0.4462 | 0.3743 |
| Shared generator | 0.3678 | 0.4635 | 0.3798 |
| No SFT | 0.3800 | 0.4283 | 0.3751 |
| CoGR (full) | 0.3976 | 0.4569 | 0.3963 |

Figure 3 Evaluation over cumulative training steps on the Internal dataset, starting from the SFT-initialized generators. Training alternates between query-side and item-side RL phases and labels V1–V5 denote the successive co-evolving rounds on each side. Evaluation increases from approximately 0.16 before co-evolving RL to 0.40 after five rounds of alternation.
where denotes the set of queries retrieved for item , and denotes the set of queries relevant to . Shared generator uses a single generator for both query- and item-side keyword generation, so the co-evolving procedure alternately updates the same checkpoint for the two roles while maintaining separate reference policies. No SFT removes the Phase 1 initialization and starts co-evolving RL directly from the base Qwen3-4B checkpoint.
As shown in Table 3, all three variants underperform the full CoGR model, supporting the effectiveness of each design choice. At the same time, all variants remain stable and achieve reasonable retrieval performance, suggesting that the overall co-evolving framework is robust to these alternative training configurations.
4.4 Analysis of Keyword Evolution
In this section, we examine how the keyword space evolves during co-evolving RL. We compare the keyword distributions produced by the post-SFT generators with those obtained during five rounds of RL training as summarized in Figure 4.
The first trend is that the learned keywords become increasingly specific. Co-evolving RL consistently reduces the prevalence of broad unigrams while increasing the use of more descriptive multi-word phrases. As shown in Figure 4a, keywords that are removed during training are often generic terms such as “mobile” and “fun”, whereas newly introduced keywords tend to be longer and more informative. This pattern is further supported by Figure 4b: the proportion of unigrams decreases from 37% to 13%, while the proportion of phrases containing three or more words increases from 12% to 31%.
We also find that the query- and item-side keyword spaces become more balanced over the course of training. As shown in Figure 4c, the item-side vocabulary contracts during the early RL rounds, while the query-side vocabulary expands. The two keyword spaces then gradually converge to a similar number of unique keywords after approximately three to four rounds. This suggests that co-evolving RL not only refines the specificity of individual keywords, but also progressively aligns the query- and item-side vocabularies.
4.5 Ablation on Additional Information

(a)

(b)

(c)
Figure 4 Keyword vocabulary dynamics under co-evolving RL on the Internal dataset. (a) Keywords added (blue) and dropped (red) between the post-SFT vocabulary and that after five RL rounds; bubble area is proportional to the number of entities associated with each n-gram. (b) Distribution of distinct n-grams by length across training rounds. (a) and (b) are computed over the union of query- and item-side keywords. (c) Number of distinct indexed n-grams on the item (app) and query sides across rounds, shown on a log scale.
We further study how retrieval quality depends on the textual information available to each generator. The default item-side input contains both the application title and description; we either remove the description or augment the query-side prompt with search results from the existing search system.
Table 4 shows that richer context improves both sides of the system. Removing item descriptions reduces from 0.3963 to 0.3759, confirming that descriptions provide important lexical cues for items whose titles alone are underspecified. Conversely, adding search results
substantially improves both precision and recall, raising to 0.4379. As illustrated by the examples in Table 8, the gain primarily comes from resolving ambiguous, misspelled, entity-centric, or non-English queries before keyword generation. These results suggest that CoGR benefits naturally from external semantic information.
Table 4 Ablation on the information available to each generator. – description leaves the item side with the title only, and + search results additionally places search results in the query-side prompt. The experiments are performed on Internal data with Qwen3-4B-Instruct as the base model.
| Variant | P | R | |
|---|---|---|---|
| CoGR (default) | 0.3976 | 0.4569 | 0.3963 |
| – Description | 0.3875 | 0.4204 | 0.3759 |
| + Search Results | 0.4381 | 0.5002 | 0.4379 |
5 Related Works
Sparse and Dense Retrieval. Classical sparse retrieval uses lexical matching, such as TF-IDF and BM25 (Robertson and Zaragoza, 2009), while learned sparse methods retain the inverted-index interface but learn term weights or lexical expansions, including docTTTTTquery (Nogueira et al., 2019), DeepCT/DeepImpact (Dai and Callan, 2020; Mallia et al., 2021), uniCOIL (Lin and Ma, 2021), and SPLADE (Formal et al., 2021, 2022). Dense retrieval follows the two-tower paradigm, with representative methods including DPR
(Karpukhin et al., 2020), ANCE (Xiong et al., 2020) with ANN-mined hard negatives, RocketQA (Qu et al., 2021) with improved negative sampling and denoising, and GTR (Ni et al., 2022) with scaled pretrained encoders. Sparse and dense retrieval remain widely used paradigms in large-scale retrieval systems.
Generative Retrieval. Generative retrieval replaces nearest-neighbor search with autoregressive generation of document identifiers. One line uses numeric identifiers. DSI (Tay et al., 2022; Zhuang et al., 2022) assigns documents semantic IDs and trains a sequence-to-sequence model to generate them from queries; NCI (Wang et al., 2022) improves this framework with query augmentation and prefix-aware decoding. Later methods learn or optimize identifiers rather than fixing them beforehand: GENRET (Sun et al., 2023) jointly learns document tokenization and retrieval, ASI (Yang et al., 2023) and MEVI (Zhang et al., 2023) explore learned document indexing, while RIPOR (Zeng et al., 2024a) constructs identifiers from retrieval-oriented quantized representations and optimizes relevance across identifier prefixes.
A parallel line uses lexical identifiers in the pretrained vocabulary space. GENRE (De Cao et al., 2020) uses document titles, SEAL (Bevilacqua et al., 2022) uses document substrings with constrained generation, and MINDER (Li et al., 2023) combines multiple lexical views. More recent work moves beyond fixed lexical identifiers: GLEN (Lee et al., 2023) and NOVO (Wang et al., 2023b) learn lexical identifiers from retrieval supervision, while ACID (Li et al., 2024a) constructs abstractive identifiers such as generated keyphrases or summaries. Orthogonal to identifier design, prior work also improves generative retrieval through ranking-or relevance-aligned objectives (Li et al., 2024b; Zhou et al., 2023; Mekonnen et al., 2025; Tang et al., 2024), knowledge distillation (Zhou et al., 2024), and decoding strategies such as PAG (Zeng et al., 2024b).
LLMs and RL for Retrieval. Recent work incorporates LLMs into retrieval by leveraging their generation capabilities to improve query representations. Prompting-based methods generate pseudo-documents, hypothetical answers, or rewritten queries that are subsequently consumed by sparse or dense retrievers (Gao et al., 2023; Wang et al., 2023a; Ma et al., 2023; Shen et al., 2024; Lei et al., 2024; Liu et al., 2025). More recently, reinforcement learning with verifiable rewards (RLVR) has demonstrated strong empirical effectiveness across a range of domains (Guo et al., 2025; Dai et al., 2026), motivating its application to retrieval optimization. DeepRetrieval (Jiang et al., 2025a) trains an LLM query generator directly from retrieval-metric rewards, while subsequent work extends this paradigm to downstream RAG utility, query reformulation, and retrieval-augmented search agents (Jiang et al., 2025b; Qin et al., 2025; Ouyang et al., 2025; Jin et al., 2025). Related work further couples generation and retrieval by jointly training LLM-based query expansion and two-tower dense representations (Li et al., 2025a; Yao et al., 2025).
CoGR instead focuses on co-evolving generative lexical retrieval, jointly training keyword generators on both the query and item sides. The generated keywords directly serve as the retrieval index. The two generators are alternately optimized toward a shared retrieval objective, allowing the lexical representations to co-adapt over training. This formulation is also related in spirit to recent advances in self-evolving LLM systems (Huang et al., 2026a,b), where interacting roles improve against each other's evolving behavior.
6 Conclusion
We introduced CoGR, a co-evolving generative retrieval framework that trains LLMs to directly construct keyword-based retrieval representations on both query and item sides. By combining an aligned SFT initialization with alternating GRPO optimization against a frozen opposite-side index, CoGR enables the two keyword spaces to progressively co-adapt under a shared retrieval objective. Experiments on both an internal APP Marketplace dataset and WANDS demonstrate consistent gains over strong sparse, dense, and generative baselines.
More broadly, our work demonstrates the feasibility of a co-evolving keyword-matching framework in which query- and item-side representations are jointly adapted through retrieval feedback. This framework leaves several directions for future work. First, the reward can be extended beyond relevance metrics such as to downstream business objectives, including irrelevant ads percentage and revenue gain. Second, our current ranking stage uses BM25 over the generated keywords. Designing stronger retrieval ranking could further improve the overall retrieval quality.
References
Michele Bevilacqua, Giuseppe Ottaviano, Patrick Lewis, Scott Yih, Sebastian Riedel, and Fabio Petroni. Autoregressive search engines: Generating substrings as document identifiers. Advances in Neural Information Processing Systems, 35:31668–31683, 2022.
Yan Chen, Shujian Liu, Zheng Liu, Weiyi Sun, Linas Baltrunas, and Benjamin Schroeder. Wands: Dataset for product search relevance assessment. In European Conference on Information Retrieval, pages 128–141. Springer, 2022.
Gobinda G Chowdhury. Introduction to modern information retrieval. Facet publishing, 2010.
Runpeng Dai, Tong Zheng, Run Yang, Kaixian Yu, and Hongtu Zhu. R1-re: Cross-domain relation extraction with rlr. In Proceedings of the 64th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 34387–34401, 2026.
Zhuyun Dai and Jamie Callan. Context-aware term weighting for first stage passage retrieval. In Proceedings of the 43rd International ACM SIGIR conference on research and development in Information Retrieval, pages 1533–1536, 2020.
Nicola De Cao, Gautier Izacard, Sebastian Riedel, and Fabio Petroni. Autoregressive entity retrieval. arXiv preprint arXiv:2010.00904, 2020.
Thibault Formal, Benjamin Piowarski, and Stéphane Clinchant. Splade: Sparse lexical and expansion model for first stage ranking. In Proceedings of the 44th international ACM SIGIR conference on research and development in information retrieval, pages 2288–2292, 2021.
Thibault Formal, Carlos Lassance, Benjamin Piowarski, and Stéphane Clinchant. From distillation to hard negative sampling: Making sparse neural ir models more effective. In Proceedings of the 45th international ACM SIGIR conference on research and development in information retrieval, pages 2353–2359, 2022.
Luyu Gao, Xueguang Ma, Jimmy Lin, and Jamie Callan. Precise zero-shot dense retrieval without relevance labels. In Proceedings of the 61st Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 1762–1777, 2023.
Daya Guo, Dejian Yang, Haowei Zhang, Junxiao Song, Peiyi Wang, Qihao Zhu, Runxin Xu, Ruoyu Zhang, Shirong Ma, Xiao Bi, et al. Deepseek-r1: Incentivizing reasoning capability in llms via reinforcement learning. arXiv preprint arXiv:2501.12948, 2025.
Chengsong Huang, Haolin Liu, Tong Zheng, Runpeng Dai, Langlin Huang, Jinyuan Li, Zongxia Li, Zhepei Wei, Yu Meng, and Jiaxin Huang. G-zero: Self-play for open-ended generation from zero data. arXiv preprint arXiv:2605.09959, 2026a.
Chengsong Huang, Wenhao Yu, Xiaoyang Wang, Hongming Zhang, Zongxia Li, Ruosen Li, Jiaxin Huang, Haitao Mi, and Dong Yu. R-zero: Self-evolving reasoning llm from zero data. In International Conference on Learning Representations, volume 2026, pages 130770–130790, 2026b.
Pengcheng Jiang, Jiacheng Lin, Lang Cao, Runchu Tian, SeongKu Kang, Zifeng Wang, Jimeng Sun, and Jiawei Han. Deeppretrieval: Hacking real search engines and retrievers with large language models via reinforcement learning. arXiv preprint arXiv:2503.00223, 2025a.
Pengcheng Jiang, Xueqiang Xu, Jiacheng Lin, Jinfeng Xiao, Zifeng Wang, Jimeng Sun, and Jiawei Han. s3: You don't need that much data to train a search agent via rl. In Proceedings of the 2025 Conference on Empirical Methods in Natural Language Processing, pages 21610–21628, 2025b.
Bowen Jin, Hansi Zeng, Zhenrui Yue, Jinsung Yoon, Sercan Arik, Dong Wang, Hamed Zamani, and Jiawei Han. Search-r1: Training llms to reason and leverage search engines with reinforcement learning. arXiv preprint arXiv:2503.09516, 2025.
Vladimir Karpukhin, Barlas Oguz, Sewon Min, Patrick Lewis, Ledell Wu, Sergey Edunov, Danqi Chen, and Wentau Yih. Dense passage retrieval for open-domain question answering. In Proceedings of the 2020 conference on empirical methods in natural language processing (EMNLP), pages 6769–6781, 2020.
Sunkyung Lee, Minjin Choi, and Jongwuk Lee. Glen: Generative retrieval via lexical index learning. In Proceedings of the 2023 Conference on Empirical Methods in Natural Language Processing, pages 7693–7704, 2023.
Yibin Lei, Yu Cao, Tianyi Zhou, Tao Shen, and Andrew Yates. Corpus-steered query expansion with large language models. In Proceedings of the 18th Conference of the European Chapter of the Association for Computational Linguistics (Volume 2: Short Papers), pages 393–401, 2024.
Alan Li, Daniel Cheng, Phillip Keung, Jungo Kasai, and Noah A Smith. Summarization-based document ids for generative retrieval with language models. In Proceedings of the First Workshop on Advancing Natural Language Processing for Wikipedia, pages 126–135, 2024a.
Chaofan Li, Jianlyu Chen, Yingxia Shao, Chaozhuo Li, Quanqing Xu, Defu Lian, and Zheng Liu. Reinforced ir: A self-boosting framework for domain-adapted information retrieval. In Proceedings of the 63rd Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 22061–22073, 2025a.
Xiaoxi Li, Jiajie Jin, Yujia Zhou, Yuyao Zhang, Peitian Zhang, Yutao Zhu, and Zhicheng Dou. From matching to generation: A survey on generative information retrieval. ACM Transactions on Information Systems, 43(3):1–62, 2025b.
Yongqi Li, Nan Yang, Liang Wang, Furu Wei, and Wenjie Li. Multiview identifiers enhanced generative retrieval. In Proceedings of the 61st Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 6636–6648, 2023.
Yongqi Li, Nan Yang, Liang Wang, Furu Wei, and Wenjie Li. Learning to rank in generative retrieval. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 38, pages 8716–8723, 2024b.
Jimmy Lin and Xueguang Ma. A few brief notes on deepimpact, coil, and a conceptual framework for information retrieval techniques. arXiv preprint arXiv:2106.14807, 2021.
Tongtong Liu, Zhaohui Wang, Meiyue Qin, Zenghui Lu, Xudong Chen, Yuekui Yang, and Peng Shu. Real-time ad retrieval via llm-generative commercial intention for sponsored search advertising. In Proceedings of the 2025 Conference on Empirical Methods in Natural Language Processing, pages 28936–28948, 2025.
Xinbei Ma, Yeyun Gong, Pengcheng He, Hai Zhao, and Nan Duan. Query rewriting in retrieval-augmented large language models. In Proceedings of the 2023 conference on empirical methods in natural language processing, pages 5303–5315, 2023.
Antonio Mallia, Omar Khattab, Torsten Suel, and Nicola Tonellotto. Learning passage impacts for inverted indexes. In Proceedings of the 44th international ACM SIGIR conference on research and development in information retrieval, pages 1723–1727, 2021.
Kidist Amde Mekonnen, Yubao Tang, and Maarten de Rijke. Lightweight and direct document relevance optimization for generative information retrieval. In Proceedings of the 48th International ACM SIGIR Conference on Research and Development in Information Retrieval, pages 1327–1338, 2025.
Jianmo Ni, Chen Qu, Jing Lu, Zhuyun Dai, Gustavo Hernandez Abrego, Ji Ma, Vincent Zhao, Yi Luan, Keith Hall, Ming-Wei Chang, et al. Large dual encoders are generalizable retrievers. In Proceedings of the 2022 Conference on Empirical Methods in Natural Language Processing, pages 9844–9855, 2022.
Rodrigo Nogueira, Jimmy Lin, and AI Epistemic. From doc2query to docttttttquery. Online preprint, 6(2):1–3, 2019.
Yichen Ouyang, Lu Wang, Fangkai Yang, Pu Zhao, Chenghua Huang, Jianfeng Liu, Bochen Pang, Yaming Yang, Yuefeng Zhan, Hao Sun, et al. Token-level proximal policy optimization for query generation. In Proceedings of the 2025 Conference on Empirical Methods in Natural Language Processing, pages 31184–31198, 2025.
Xubo Qin, Jun Bai, Jiaqi Li, Zixia Jia, and Zilong Zheng. Reinforced query reasoners for reasoning-intensive retrieval tasks. In Proceedings of the 2025 Conference on Empirical Methods in Natural Language Processing, pages 21261–21274, 2025.
Yingqi Qu, Yuchen Ding, Jing Liu, Kai Liu, Ruiyang Ren, Wayne Xin Zhao, Daxiang Dong, Hua Wu, and Haifeng Wang. Rocketqa: An optimized training approach to dense passage retrieval for open-domain question answering. In Proceedings of the 2021 conference of the North American chapter of the association for computational linguistics: human language technologies, pages 5835–5847, 2021.
Stephen Robertson and Hugo Zaragoza. The probabilistic relevance framework: Bm25 and beyond. Foundations and trends® in information retrieval, 4(1-2):1–174, 2009.
John Schulman, Filip Wolski, Prafulla Dhariwal, Alec Radford, and Oleg Klimov. Proximal policy optimization algorithms. arXiv preprint arXiv:1707.06347, 2017.
Zhihong Shao, Peiyi Wang, Qihao Zhu, Runxin Xu, Junxiao Song, Xiao Bi, Haowei Zhang, Mingchuan Zhang, YK Li, Yang Wu, et al. Deepseekmath: Pushing the limits of mathematical reasoning in open language models. arXiv preprint arXiv:2402.03300, 2024.
Tao Shen, Guodong Long, Xiubo Geng, Chongyang Tao, Yibin Lei, Tianyi Zhou, Michael Blumenstein, and Daxin Jiang. Retrieval-augmented retrieval: Large language models are strong zero-shot retriever. In Findings of the Association for Computational Linguistics: ACL 2024, pages 15933–15946, 2024.
Guangming Sheng, Chi Zhang, Zilingfeng Ye, Xibin Wu, Wang Zhang, Ru Zhang, Yanghua Peng, Haibin Lin, and Chuan Wu. Hybridflow: A flexible and efficient rlhf framework. arXiv preprint arXiv: 2409.19256, 2024.
Weiwei Sun, Lingyong Yan, Zheng Chen, Shuaiqiang Wang, Haichao Zhu, Pengjie Ren, Zhumin Chen, Dawei Yin, Maarten Rijke, and Zhaochun Ren. Learning to tokenize for generative retrieval. Advances in Neural Information Processing Systems, 36:46345–46361, 2023.
Yubao Tang, Ruqing Zhang, Jiafeng Guo, Maarten de Rijke, Wei Chen, and Xueqi Cheng. Generative retrieval meets multi-graded relevance. Advances in neural information processing systems, 37:72790–72817, 2024.
Yi Tay, Vinh Tran, Mostafa Dehghani, Jianmo Ni, Dara Bahri, Harsh Mehta, Zhen Qin, Kai Hui, Zhe Zhao, Jai Gupta, et al. Transformer memory as a differentiable search index. Advances in neural information processing systems, 35:21831–21843, 2022.
C Van Rijsbergen. Information retrieval: theory and practice. In Proceedings of the joint IBM/University of Newcastle upon tyne seminar on data base systems, volume 79, pages 1–14. Butterworth-Heinemann Oxford, UK, 1979.
Liang Wang, Nan Yang, and Furu Wei. Query2doc: Query expansion with large language models. In Proceedings of the 2023 Conference on Empirical Methods in Natural Language Processing, pages 9414–9423, 2023a.
Yujing Wang, Yingyan Hou, Haonan Wang, Ziming Miao, Shibin Wu, Qi Chen, Yuqing Xia, Chengmin Chi, Guoshuai Zhao, Zheng Liu, et al. A neural corpus indexer for document retrieval. Advances in Neural Information Processing Systems, 35:25600–25614, 2022.
Zihan Wang, Yujia Zhou, Yiteng Tu, and Zhicheng Dou. Novo: Learnable and interpretable document identifiers for model-based ir. In Proceedings of the 32nd ACM International Conference on Information and Knowledge Management, pages 2656–2665, 2023b.
Lee Xiong, Chenyan Xiong, Ye Li, Kwok-Fung Tang, Jialin Liu, Paul Bennett, Junaid Ahmed, and Arnold Overwijk. Approximate nearest neighbor negative contrastive learning for dense text retrieval. arXiv preprint arXiv:2007.00808, 2020.
An Yang, Anfeng Li, Baosong Yang, Beichen Zhang, Binyuan Hui, Bo Zheng, Bowen Yu, Chang Gao, Chengen Huang, Chenxu Lv, et al. Qwen3 technical report. arXiv preprint arXiv:2505.09388, 2025.
Tianchi Yang, Minghui Song, Zihan Zhang, Haizhen Huang, Weiwei Deng, Feng Sun, and Qi Zhang. Auto search indexer for end-to-end document retrieval. In Findings of the Association for Computational Linguistics: EMNLP 2023, pages 6955–6970, 2023.
Sijia Yao, Pengcheng Huang, Zhenghao Liu, Yu Gu, Yukun Yan, Shi Yu, and Ge Yu. ExpandR: Teaching dense retrievers beyond queries with LLM guidance. In Christos Christodoulopoulos, Tanmoy Chakraborty, Carolyn Rose, and Violet Peng, editors, Proceedings of the 2025 Conference on Empirical Methods in Natural Language Processing, pages 19036–19054, Suzhou, China, November 2025. Association for Computational Linguistics. ISBN 979-8-89176-332-6. doi: 10.18653/v1/2025.emnlp-main.963. URL https://aclanthology.org/2025.emnlp-main.963/.
Hansi Zeng, Chen Luo, Bowen Jin, Sheikh Muhammad Sarwar, Tianxin Wei, and Hamed Zamani. Scalable and effective generative information retrieval. In Proceedings of the ACM Web Conference 2024, pages 1441–1452, 2024a.
Hansi Zeng, Chen Luo, and Hamed Zamani. Planning ahead in generative retrieval: Guiding autoregressive generation through simultaneous decoding. In Proceedings of the 47th International ACM SIGIR Conference on Research and Development in Information Retrieval, pages 469–480, 2024b.
Hailin Zhang, Yujing Wang, Qi Chen, Ruiheng Chang, Ting Zhang, Ziming Miao, Yingyan Hou, Yang Ding, Xupeng Miao, Haonan Wang, et al. Model-enhanced vector index. Advances in Neural Information Processing Systems, 36: 54903–54917, 2023.
Yujia Zhou, Zhicheng Dou, and Ji-Rong Wen. Enhancing generative retrieval with reinforcement learning from relevance feedback. In Proceedings of the 2023 Conference on Empirical Methods in Natural Language Processing, pages 12481–12490, 2023.
Yujia Zhou, Jing Yao, Zhicheng Dou, Yiteng Tu, Ledell Wu, Tat-Seng Chua, and Ji-Rong Wen. Roger: Ranking-oriented generative retrieval. ACM Transactions on Information Systems, 42(6):1–25, 2024.
Shengyao Zhuang, Houxing Ren, Linjun Shou, Jian Pei, Ming Gong, Guido Zuccon, and Daxin Jiang. Bridging the gap between indexing and retrieval for differentiable search index with query generation. arXiv preprint arXiv:2206.10128, 2022.
A Relevance Label Details
Both datasets provide categorical relevance labels for query–item pairs, which we convert into binary relevance labels for constructing the gold set. For the Internal dataset, labels are assigned by an internal LLM-as-a-judge on a five-level scale: excellent, good, acceptable, poor, and bad. We treat pairs rated acceptable or better as relevant, and all remaining pairs, including unlabelled pairs, as irrelevant. For WANDS (Chen et al., 2022), human annotators provide three-level labels: Exact, Partial, and Irrelevant. Following the same binary construction, we treat Exact and Partial as relevant, and treat Irrelevant and unlabelled pairs as irrelevant.
B Training Details
B.1 Prompts
The prompts used in phase 1 and 2 training are shown in Figure 5.
Query-side generator
System: You expand user search queries into matching keywords.
User: List keywords (synonyms, related terms, item categories) that the query should match against. Output only a comma-separated list of keywords, no explanation.
User query: {query}
Item-side generator
System: You extract search keywords from item titles and descriptions.
User: List keywords for lexical search matching. Output only a comma-separated list of keywords, no explanation.
Item title: {item}
Item Description: {description}
Figure 5 Prompts used to fine-tune the query-side () and item-side () generators.
B.2 Hyperparameters
We use the default sampling hyperparameters recommended for Qwen for Phase 1 Item keyword initialization (Section 2.2), as well as for model evaluation and index construction in Phase 2 (Section 2.3). During RL training, we instead use unconstrained stochastic sampling to encourage exploration. The decoding hyperparameters for each setting are summarized in Table 5. For GRPO training, we use 8 NVIDIA B200 GPUs. The key hyperparameters for query- and item-side optimization are summarized in Table 6. We adopt a fully online RL setup, generating fresh rollouts from the current policy at each update to avoid off-policy training.
Table 5 Decoding hyperparameters used for RL rollouts, initialization, evaluation, and index construction.
| Setting | Temp. | top-p | top-k | min-p |
|---|---|---|---|---|
| RL rollout | 1.0 | 1.0 | -1 | 0 |
| Initialization / Evaluation / Indexing | 0.7 | 0.8 | 20 | 0 |
Table 6 GRPO hyperparameters for item-side and query-side training. Hyperparameter names follow the original ver1 configuration fields.
| Hyperparameter | Item side | Query side |
|---|---|---|
| Advantage estimator | GRPO | GRPO |
| optim.lr | ||
| rollout.n | 8 | 8 |
| train_batch_size | 256 | 512 |
| ppo_mini_batch_size | 256 | 512 |
| ppo_micro_batch_size_per_gpu | 32 | 64 |
| n_gpu_per_node | 8 | 8 |
| max_response_length | 512 | 512 |
| use_kl_loss | False | False |
| Epochs | 5 | 10 |
B.3 Efficient Implementation of Item-Side Reward
Naively computing the item-side reward in Eq. 2.3 would require rebuilding the item index and rerunning retrieval over all queries for every sampled item-side rollout. We avoid this cost by exploiting the fact that each counterfactual rollout changes the representation of only a single item.
At the beginning of each item-side training round, we cache the retrieval state under the frozen reference item index. For each query , we store the number of retrieved items, the number of true positives, and the number of relevant items:
The reference score can then be computed directly from these cached counts:
We additionally cache, for each item , the set of queries that retrieve it under its reference keyword set, denoted by . Given a newly sampled keyword set , we perform a single lookup against the frozen query-side inverted index to obtain the set of queries matched by the candidate item representation, denoted by . Only queries for which the retrieval status of item changes can contribute to the reward. The affected query set is therefore
For each affected query , replacing the keyword set of a single item can only add or remove item from the retrieved set. Its candidate score can therefore be updated directly from the cached counts:
All unaffected queries have identical reference and candidate scores and therefore cancel in the reference-subtracted objective. The item-side reward can thus be computed only over the affected queries:
As a result, each sampled item-side rollout requires only one lookup against the frozen query-side index, followed by constant-time updates for the affected queries. This avoids rebuilding the full counterfactual index or rerunning query-to-item retrieval over the entire query set for every rollout.
C Retrieval Metrics at Additional Cutoffs
Table 7 Held-out query-side retrieval metrics at cutoffs 10 and 1000, using the same method grouping as Table 2. ❖ denotes that the Item-side parameters are frozen. The best value in each column within a dataset is shown in bold.
| Dataset | Type | Method | MRR@10 | NDCG@10 | P@10 | R@10 | F1@10 | MRR@1000 | NDCG@1000 | P@1000 | R@1000 | F1@1000 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Internal | Sparse | BM25 | 0.6682 | 0.3281 | 0.4815 | 0.0066 | 0.0128 | 0.6729 | 0.1640 | 0.2453 | 0.1141 | 0.1056 |
| SPLADE-v2 | 0.5683 | 0.2660 | 0.4471 | 0.0069 | 0.0133 | 0.5744 | 0.3938 | 0.3054 | 0.3523 | 0.2895 | ||
| Dense | Qwen3-4B emb. | 0.7212 | 0.4185 | 0.5653 | 0.0091 | 0.0176 | 0.7256 | 0.3339 | 0.2310 | 0.2689 | 0.2191 | |
| DPR | 0.4955 | 0.2250 | 0.3793 | 0.0057 | 0.0110 | 0.5041 | 0.3466 | 0.2677 | 0.3132 | 0.2551 | ||
| ANCE | 0.6109 | 0.3348 | 0.5156 | 0.0079 | 0.0153 | 0.6161 | 0.4023 | 0.3062 | 0.3490 | 0.2888 | ||
| ANCE-Qwen4B | 0.7544 | 0.4261 | 0.6445 | 0.0104 | 0.0201 | 0.7573 | 0.4989 | 0.3756 | 0.4354 | 0.3575 | ||
| Generative Retrieval | DSI | 0.6265 | 0.2838 | 0.4846 | 0.0069 | 0.0134 | 0.6325 | 0.4113 | 0.3201 | 0.3738 | 0.3053 | |
| DSI-QG | 0.6597 | 0.3020 | 0.5121 | 0.0073 | 0.0141 | 0.6647 | 0.4172 | 0.3234 | 0.3753 | 0.3077 | ||
| RIPOR | 0.6671 | 0.3460 | 0.5527 | 0.0079 | 0.0155 | 0.6722 | 0.4370 | 0.3371 | 0.3793 | 0.3167 | ||
| DeepRetrieval 4B | 0.7422 | 0.4044 | 0.6154 | 0.0097 | 0.0187 | 0.7456 | 0.3992 | 0.2907 | 0.3333 | 0.2750 | ||
| CoGR♣ 1.7B | 0.6402 | 0.3111 | 0.5046 | 0.0076 | 0.0147 | 0.6452 | 0.2747 | 0.3251 | 0.2068 | 0.2302 | ||
| CoGR 1.7B | 0.7019 | 0.3888 | 0.5966 | 0.0092 | 0.0177 | 0.7057 | 0.4146 | 0.3806 | 0.3408 | 0.3296 | ||
| CoGR♣ 4B | 0.6990 | 0.3578 | 0.5695 | 0.0090 | 0.0173 | 0.7022 | 0.2985 | 0.3431 | 0.2232 | 0.2517 | ||
| CoGR 4B | 0.7643 | 0.4198 | 0.6576 | 0.0106 | 0.0202 | 0.7668 | 0.4621 | 0.4269 | 0.3810 | 0.3716 | ||
| WANDS | Sparse | BM25 | 0.8556 | 0.7314 | 0.7816 | 0.0564 | 0.1006 | 0.8575 | 0.7907 | 0.3149 | 0.8330 | 0.3806 |
| SPLADE-v2 | 0.9090 | 0.7861 | 0.8780 | 0.0636 | 0.1125 | 0.9091 | 0.8530 | 0.2732 | 0.8818 | 0.3384 | ||
| Dense | Qwen3-4B emb. | 0.6442 | 0.5129 | 0.5780 | 0.0456 | 0.0800 | 0.6476 | 0.5478 | 0.1759 | 0.5915 | 0.2150 | |
| DPR | 0.8850 | 0.7539 | 0.8460 | 0.0631 | 0.1113 | 0.8861 | 0.8199 | 0.2692 | 0.8662 | 0.3318 | ||
| ANCE | 0.8900 | 0.7617 | 0.8580 | 0.0640 | 0.1125 | 0.8905 | 0.8133 | 0.2726 | 0.8467 | 0.3334 | ||
| ANCE-Qwen4B | 0.9067 | 0.7816 | 0.8620 | 0.0603 | 0.1072 | 0.9085 | 0.8591 | 0.2785 | 0.8883 | 0.3447 | ||
| Generative Retrieval | DSI | 0.5814 | 0.4717 | 0.5580 | 0.0343 | 0.0606 | 0.5867 | 0.5782 | 0.2244 | 0.6451 | 0.2632 | |
| DSI-QG | 0.8517 | 0.6827 | 0.7800 | 0.0548 | 0.0972 | 0.8521 | 0.7474 | 0.2544 | 0.7891 | 0.3067 | ||
| RIPOR | 0.7902 | 0.6476 | 0.7500 | 0.0514 | 0.0907 | 0.7907 | 0.6857 | 0.2416 | 0.7259 | 0.2889 | ||
| DeepRetrieval 4B | 0.8550 | 0.7320 | 0.7857 | 0.0570 | 0.1016 | 0.8592 | 0.7956 | 0.3280 | 0.8354 | 0.3915 | ||
| CoGR♣ 1.7B | 0.8315 | 0.6089 | 0.7236 | 0.0468 | 0.0841 | 0.8333 | 0.4293 | 0.5336 | 0.3713 | 0.3726 | ||
| CoGR 1.7B | 0.8903 | 0.7427 | 0.8391 | 0.0589 | 0.1050 | 0.8903 | 0.6188 | 0.7787 | 0.5515 | 0.5814 | ||
| CoGR♣ 4B | 0.8079 | 0.6462 | 0.7408 | 0.0527 | 0.0941 | 0.8111 | 0.5184 | 0.5848 | 0.4736 | 0.4732 | ||
| CoGR 4B | 0.9209 | 0.7537 | 0.8655 | 0.0595 | 0.1062 | 0.9225 | 0.7075 | 0.8115 | 0.6633 | 0.6703 |
D Example Generated Keywords
Table 8 shows how the generated keywords change over the alternating rounds, and how they change again when each side is given additional information beyond the query string or the item title: online search hints on the query side (Table 8a) and the application description on the item side (Table 8b).
E Baseline Methods
We compare against three families of retrieval baselines, with the base model used for each method summarized in Table 9. For all trainable baselines, we follow their standard training setups and use the same query- and item-side information available to CoGR whenever applicable, including the same item title and description fields and aligned prompting inputs. This ensures that performance differences are not driven by additional textual information or task-specific prompt engineering.
For unconstrained precision, recall, and , we tune the retrieval cutoff on the training split by selecting the value that maximizes training , and then apply this fixed cutoff to the validation dataset. Checkpoints are selected according to their validation under the same protocol. Unless otherwise specified, trained baselines use 8 GPUs with distributed data parallelism and otherwise follow their standard optimization configurations.
Table 9 Base models used for each baseline.
| Baseline | Base model |
|---|---|
| BM25 | — |
| DPR | bert-base-multilingual-uncased |
| ANCE | roberta-base |
| SPLADE-v2 | naver/splate_v2_max |
| Qwen3-4B emb. | Qwen3-Embedding-4B |
| ANCE-Qwen4B | Qwen3-Embedding-4B |
| DSI | mT5-base |
| DSI-QG | mT5-base |
| RIPOR | mT5-base |
| DeepRetrieval | Qwen3-4B-Instruct-2507 |
Table 8 Example generated keywords before and after co-evolving RL, and with additional information at the input.
(a) Query side. Round-5 keywords are also shown for a prompt that additionally contains online search hints for the query.
| Query | w/o Search | w/ Search |
|---|---|---|
| family search | album, anniversary, birthday, birthdays, digital, photo, search, sharing, tracker, ... | genealogy, family history, genealogy app, family calendar, ancestry, family tree, ... |
| 解压软件 | relaxation, mindfulness, meditation, relaxation app, stress relief, puzzle game, mental health, ... | archive, compress, compression, extract, extractor, file, files, manager, rar, unzip, zip, ... |
| zenless | mindfulness, meditation, relaxation, meditation app, mental health, mindfulness app, stress relief, ... | action, adventure, battle, combat, defense, fantasy, royale, rpg, ... |
| duch bros | action, multiplayer, action game, arcade game, adventure game, action shooter, arcade, action rpg, ... | burger, coffee, deals, delivery, drink, fast, food, local, order, pizza, ... |
(b) Item side. Round-5 keywords are also shown for a prompt that additionally contains the application description.
| Application | w/o Desc. | w Desc. |
|---|---|---|
| 10000000 | 10000000, 1000 | rpg, dungeon crawler, puzzle, action rpg, roguelike, adventure, ... |
| Compound Quest | crypto, decentralized finance, dapp, yield farming, blockchain | compound words, word puzzles, vocabulary building, spelling skills, reading skills, esl learning, picture match |
| Ultra Plunge Tracker | dive, dive log, diving, swim | cold plunge, sauna, steam room, ice bath, heart rate, recovery, wellness, ai coach, hyperbaric chamber |
| Life is Slow | life is slow, slow life | nature, simulation, nature simulation, puzzle, relaxation, nature theme, adventure, nature game, nature therapy |