Why this matters Most retrieval pipelines treat matching as a one-sided problem: queries are expanded or rewritten while item representations remain fixed and matching is handed to a separate retriever. That split makes end-to-end optimization for retrieval quality difficult and leaves a persistent misalignment between query and item representations, which in turn causes irreversible candidate misses. This paper shows an alternative: train LLMs to produce the actual retrieval representations on both sides and co-optimize them under a single retrieval objective.
Key Findings
- Joint generative representations: Two LLM-based generators produce compact keyword bags for queries and items; retrieval is performed by keyword overlap and BM25 ranking, preserving compatibility with existing inverted-index infrastructure. This avoids relying on a separate dense retriever for final matching.
- Two-stage training with co-evolution: A supervised fine-tuning (SFT) initialization aligns the two keyword spaces, then alternating GRPO-based reinforcement learning updates each side against the other's frozen index. The query generator is rewarded by retrieval F1; the item generator receives a counterfactual marginal reward measuring its keywords' impact on query-side F1. This alternating setup yields stable co-adaptation instead of chasing a moving target.
- Empirical gains: Across an internal APP Marketplace dataset and the public WANDS benchmark, the method substantially improves retrieval F1 over strong sparse, dense, and generative baselines, demonstrating that co-evolving both sides is critical for performance and alignment.
How it works (concise)
- Representation: Each side outputs a compact set of keywords; an item is retrieved if generated keyword sets overlap with the query's keywords (optionally including the raw query/item text). Retrieved items are ranked by BM25 on the generated tokens.
- Optimization: SFT constructs initial query targets from relevant items' keywords. During RL, updates alternate: freeze the opposite-side index, optimize one generator with GRPO to maximize a group-based retrieval F1 objective, then swap. The item-side reward is computed as a counterfactual marginal effect on query F1 when replacing its keywords.
Who it's for and trade-offs
Great fit if you need higher end-to-end retrieval accuracy while remaining compatible with keyword/inverted-index infrastructure, or if you want to leverage LLMs to synthesize interpretable retrieval representations rather than opaque dense vectors. Look elsewhere if you require purely dense embedding pipelines, sub-word-level semantic matching without explicit keywords, or if latency/storage constraints prohibit storing generated keyword sets and maintaining an inverted index. The alternating RL stage adds training complexity and requires labeled relevance data or a reliable proxy F1 signal for reward computation.