The research framework moves query planning into offline training, then uses a compact model to generate a full result set in one pass.

When someone searches for “camping gear,” a useful system should return more than several versions of the same tent. It might assemble a set containing a tent, sleeping bag, portable stove and headlamp.

That requires query fan-out: breaking one broad search into several narrower searches. Retrieve-for-Train, a research framework described by Google Research, proposes doing the expensive discovery work before users search.

At search time, the system uses a smaller model to produce a complete set of search directions in parallel. The goal is to preserve the variety of carefully planned search without making a large language model reason through every request.

Training first, searching later

Ordinary language models generate text one piece at a time. This is called autoregressive generation. If a model must plan ten related searches, it may need to produce many intermediate tokens before returning useful sub-queries.

That can create delays, especially when the system must make results diverse, relevant to the original request and tied to items that actually exist in a database.

Retrieve-for-Train treats this as an offline training problem. During training, a language model explores different groups of sub-queries and receives a reward based on the quality of the group as a whole. Google Research describes this as using reinforcement learning to discover “reward-aligned fan-outs,” then compiling those results into training data.

The final search system does not repeat that exploration from scratch. Instead, it learns from examples created before deployment.

The pipeline has three main parts:

  1. A fan-out language model creates several sub-queries and receives a set-level reward.
  2. That model produces query-to-target-set examples offline, without human labels.
  3. A compact diffusion model learns to map one query embedding directly to a complete set of target embeddings.

An embedding is a numerical representation of meaning. In this case, the diffusion model works in that numerical space rather than writing each search phrase one after another.

Google Research describes the diffusion model as having 53.9 million parameters. It generates the target set in one non-autoregressive pass, meaning it does not produce each item sequentially.

That answers the central question: the system shifts difficult search planning into offline reinforcement learning and data generation. It then trains a model to reproduce the useful behavior quickly during search.

Three rewards push search beyond repetition

The method’s reward combines three goals.

Groundedness keeps generated searches close to the database’s contents. An expansion should point toward items the system can actually retrieve, not merely describe something that sounds plausible.

Diversity pushes the system toward different useful directions. Retrieve-for-Train uses the Vendi Score, a measure of diversity across a collection, rather than judging each result alone.

Alignment keeps every sub-query connected to the original broad request. Without that guardrail, a system could generate varied results that no longer answer the user’s question.

These goals matter because optimizing only one can create shortcuts. Google Research reports that a model focused mainly on database proximity produced meaningless strings that still mapped near database items. Adding alignment encouraged repetitive paraphrases. Diversity helped counter both behaviors.

For example, a basic model might turn “bohemian festival style” into “bohemian festival fashion” and “bohemian festival clothes.” Retrieve-for-Train is designed to branch into different directions, such as boots, fringe jackets or crochet dresses, while remaining tied to the database.

The framework therefore evaluates the whole collection, not just whether each individual query looks relevant. That is important for searches where users need a useful mix of results rather than ten near-duplicates.

What the reported tests found

The researchers evaluated the framework in two types of set-valued retrieval. The first had no single correct answer and judged the result set on diversity, alignment and database groundedness. The second used a weak reference set as one possible interpretation of a query.

The tests covered a fashion dataset using a CLIP-based image retrieval system and a proprietary music-playlist dataset using MuLan. In the reported setup, Gemma3-4B and Qwen3-4B language models generated exactly ten sub-queries for each main prompt.

Google Research reports that Retrieve-for-Train outperformed single-query search, zero-shot expansion and a Best-of-N comparison across both tasks. The researchers also report a 12-to-20-fold speedup for the diffusion model compared with autoregressive approaches.

Those quality and speed figures come from the researchers’ reported experiments, not an independent evaluation. Their account does not provide the hardware, batch sizes, retrieval-set sizes or benchmark tables needed to know how the comparison would change in another system.

The source describes a research evaluation rather than a confirmed production search deployment. The researchers report that autoregressive fan-out could approach 50 seconds under large context batches, while the diffusion approach ranged from sub-second to a few seconds in their setup. Those latency results depend on the workload and implementation used.

The engineering tradeoff moves upstream

The important design choice is not simply “use diffusion.” It is the separation of responsibilities.

A language model explores what good search behavior looks like while training can afford to spend more computation. A smaller retrieval model then performs the learned behavior at user time, producing a whole set of directions together.

Google Research characterizes this use of reinforcement learning as a one-time “objective transducer”: training converts a product goal into data and model behavior, instead of making the live system rediscover that goal for every query.

That could help search and recommendation products where one answer is not enough, including outfit discovery, music playlists and product collections. It may also reduce the need for costly human labels when teams can define useful rewards mathematically.

The hard engineering work moves rather than disappears. A product team must decide whether its database, embeddings and reward measures truly capture useful diversity and relevance. It must also test what happens when the database changes or when users want results outside the training setup.

For now, Retrieve-for-Train is a research framework, not a consumer product people can buy. Its next practical test is independent reproduction across different databases and workloads, where the claimed speed and search quality can be measured under real operating conditions.