Manuscript Offprint

arXiv:2610.07731

Learning to Retrieve via Reinforcement Learning in Embedding Space

Qi Liu, Fengming Liang, Yiqun Chen, Erhan Zhang, Jiaxin Mao

ABSTRACT

Dense retrieval models are typically trained with contrastive objectives that learn effective representations but do not directly optimize retrieval metrics or downstream task performance. To address this problem, we introduce RELER (REinforcement LEarning for Retrieval), a reinforcement learning framework that enables existing embedding models to learn to retrieve directly in embedding space and align to task-specific rewards. We train RELER by sampling unit-length query and document embedding actions from von Mises–Fisher (vMF) distributions centered on normalized encoder outputs, scoring the resulting retrieval or downstream outcomes as rewards, and updating the encoder with REINFORCE using a leave-one-out baseline (RLOO). As exploration in the high-dimensional embedding space is prone to sampling noise, we further propose conditional-mean projection (CMP), which projects each sampled embedding onto the low-dimensional subspace spanned by its encoder output and the candidate embeddings it is compared against, reducing noise in the policy gradient while preserving its expectation. We evaluate RELER on BRIGHT, a benchmark with reasoning-intensive queries that remain challenging for existing embedding models. RELER consistently outperforms InfoNCE and LambdaLoss in average nDCG@10 when post-training BGE-M3 and Qwen3-Embedding backbones. We further evaluate downstream utility through retrieval-augmented generation (RAG), where we adapt only the query encoder while keeping the document index and generator fixed. Across seven QA datasets, jointly optimizing retrieval and answer rewards improves both average retrieval performance and answer quality in RAG.

1 INTRODUCTION

Dense retrieval models enable large-scale semantic retrieval by encoding queries and documents into a shared embedding space, where relevance is modeled by vector similarity (Karpukhin et al., 2020; Zhang et al., 2025). They support applications including web search (Huang et al., 2013), retrieval-augmented generation (RAG) (Lewis et al., 2020), agentic search (Jin et al., 2025a), and memory recall for long-horizon agents (Packer et al., 2023). Despite these varied uses, most text embedding models are trained with large-scale contrastive learning, encouraging relevant query–document pairs to have higher similarity than irrelevant ones (Zhan et al., 2020; Wang et al., 2022). This training objective, however, is only indirectly related to retrieval metrics such as nDCG or downstream task performance such as answer accuracy in RAG. Reducing the contrastive loss therefore does not necessarily translate into better retrieval quality or downstream utility (Zhang et al., 2024).

This objective mismatch is analogous to that in language model alignment: next-token prediction does not directly optimize human preferences or task success. Reinforcement learning (RL) provides a principled approach by optimizing rewards derived from human preferences or task outcomes (Ouyang et al., 2022; DeepSeek-AI, 2025). This motivates using RL to align retrieval models directly with retrieval and downstream metrics, as RL can optimize such non-differentiable objectives by sampling retrieval decisions, evaluating their outcomes with the target metrics, and estimating policy gradients without differentiating through the retrieval process or the downstream evaluator (Williams, 1992). Recent work has explored RL for embedding and retrieval models through poli-

Code: https://github.com/liuqi6777/RELER cies over generated text (Sun et al., 2026; Jiang et al., 2026) or discrete document selections (Salemi et al., 2024; Liu et al., 2025c; Zhang et al., 2026). These policies explore text or document choices; the query and document vectors used for similarity scoring are not themselves sampled as actions.

In this work, we revisit reinforcement learning for dense retrieval by treating embeddings as learnable retrieval actions. Because their similarities determine which documents are retrieved, exploring alternative embeddings allows task feedback to guide the representations themselves. We introduce RELER (REinforcement LEarning for Retrieval), a framework for post-training embedding models to learn to retrieve: sample embedding actions, evaluate the retrieval results or downstream answers they produce, and update the encoder to favor actions with higher rewards. The framework explores both query and document embeddings, and also supports query-only adaptation against a fixed document index. Inference retains deterministic single-vector retrieval.

To turn this view into a practical learning algorithm, RELER places a von Mises–Fisher (vMF) policy around each normalized encoder output, enabling exploration on the unit sphere used for cosine retrieval (Bendada et al., 2025). To optimize retrieval, RELER independently samples query and document embeddings and uses product rollouts (Kuntz et al., 2022) to pair every sampled query with every document bundle. Averaging rewards across these pairings gives each action feedback from multiple retrieval outcomes without additional encoder passes. REINFORCE with a leave-one-out baseline (Kool et al., 2019) then converts this feedback into updates to the shared encoder. High-dimensional exploration, however, also introduces random components that leave retrieval scores unchanged but add gradient noise. Building on document-space projection (Wang et al., 2019), we develop conditional-mean projection (CMP): for each reward term, sampled actions are projected onto the subspace spanned by their policy mean and the directions that determine the reward. Applied only in gradient computation, CMP averages out this irrelevant randomness while preserving the relevant scores and the expected policy gradient.

We evaluate RELER as a post-training method for existing embedding models, first on reasoning retrieval and then on downstream RAG tasks. Existing embeddings receive extensive training on tasks represented in MTEB (Muennighoff et al., 2023) and already perform strongly (Chen et al., 2024; Zhang et al., 2025). We therefore focus on BRIGHT (Su et al., 2025), whose reasoning-intensive queries expose remaining weaknesses, to test whether limited additional supervision can improve these models. Using fewer than 5k queries, RELER consistently outperforms supervised baselines trained on the same data across BGE-M3 and Qwen3-Embedding backbones. For downstream RAG, we test whether task feedback improves answer quality by adapting only the query encoder with the index and generator frozen. Combining retrieval and answer rewards improves average retrieval and answer quality over the pretrained encoder across seven QA datasets.

References (100)