# Fanout V2: From Paraphrastic Collapse to Complementary Set

> Source: <https://dejan.ai/blog/fanout2/>
> Published: 2026-09-16 12:46:33+00:00

Google Research introduced R4T, an RL-trained diffusion retriever that optimizes fan-out query sets for diversity and speed, achieving up to 20x latency speedups.

[Darwin](https://www.linkedin.com/in/darwinsantos/) pinged me with [this paper](https://arxiv.org/pdf/2603.06397) by Google Research titled **Efficient, Property-Aligned Fan-Out Retrieval via RL-Compiled Diffusion** and [Greg](https://www.linkedin.com/feed/update/urn:li:activity:7505957975140933632?commentUrn=urn%3Ali%3Acomment%3A%28activity%3A7505957975140933632%2C7505961484791836674%29&dashCommentUrn=urn%3Ali%3Afsd_comment%3A%287505961484791836674%2Curn%3Ali%3Aactivity%3A7505957975140933632%29) later gave it a much better title, which I decided to use in this post.

The paper introduces R4T, a framework that trains a fan-out language model with reinforcement learning to optimize set-level properties like diversity and coverage, then distills those behaviors into a fast, single-pass diffusion model for deployment.

Set-level means evaluating the collective quality of the entire retrieved bundle of items as a whole rather than grading each item individually.

To build quick intuition for what is being talked about consider:

**Naive LLM Fan-Out:**

 **Result**: All nearly identical. Search returns 100 tents, 100 sleeping bags, 100 backpacks, same 3 items repeated.

**R4T with Rewards:**

 **Result**: Beginner gets a complete kit, shelter (tent), sleep system (bag), carry system (backpack), cooking (stove), lighting (headlamp), tools (rope, utensils), drink (mug), footwear (boots). Each sub-query branches into a different category.

The pipeline first trains a fan-out language model using reinforcement learning with composite set-level rewards, uses that model as a transducer to generate objective-aligned retrieval trajectories, and compiles those behaviors into a lightweight diffusion retriever that samples set embeddings in a single forward pass.

The compact 53.9M-parameter diffusion model generates all retrieval embeddings simultaneously to achieve a 12x to 20x latency speedup over autoregressive language models across batch sizes.

| Batch | LLM | Diffusion Model | Speedup | 
|---|---|---|---|
| 8 | ~1.46 s | 0.07 s | ~20x | 
| 16 | ~1.65 s | ~0.10 s | ~16x | 
| 32 | ~1.75 s | ~0.18 s | ~10x | 
| 64 | ~2.00 s | ~0.35 s | ~6x | 
| 128 | ~4.50 s | ~0.60 s | ~7.5x | 
| 256 | ~10.0 s | ~1.10 s | ~9x | 
| 512 | ~22.0 s | ~2.10 s | ~10.5x | 
| 1024 | ~49.5 s | 4.21 s | ~12x | 

The diffusion retriever uses a 6-layer Coherent Transformer denoiser conditioned on the query via cross-attention to generate candidate sets directly in continuous embedding space under a variance exploding EDM scheme.

**How does nearest-neighbor mapping work on the output tensor?**

After the diffusion model solves the probability flow stochastic differential equation, the resulting tensor is sliced into L embeddings that independently query the database using standard nearest-neighbor retrieval.

**Impact of embedding dimension on retrieval accuracy**

The authors balance retrieval accuracy against computational efficiency by using Matryoshka representation learning truncated to an embedding dimension of 128.

**Polyvore vs Music benchmark results**

On both Polyvore fashion and Music benchmarks, R4T achieves higher retrieval quality than zero-shot and Best-of-N baselines in open-ended abstract retrieval, while striking a superior balance between coverage and diversity in weakly supervised compositional retrieval.

**How do the composite reward functions prevent shortcut exploitation?**

Jointly balancing Vendi Score diversity, a groundedness penalty, and a cosine alignment term prevents the policy from collapsing into repetitive query paraphrases or degenerate nonsensical strings that exploit isolated database neighbors.

The framework defines set-level quality using **three mathematical components**: **groundedness** penalizes Euclidean distance from each generated sub-query embedding to its nearest database item manifold, and **alignment** measures mean cosine similarity between individual sub-queries and the root query embedding to prevent semantic drift. Meanwhile, the Vendi Score computes **diversity** via the effective rank of the similarity matrix across representative retrieved content embeddings, and these components are combined into a weighted composite reward that prevents mode collapse.

Interestingly, omitting any of the three components causes immediate collapse: groundedness alone produces degenerate text strings, while groundedness plus alignment yields identical paraphrases.

**Diffusion denoiser architecture**

The diffusion model uses a 6-layer Coherent Transformer architecture conditioned via cross-attention on query embeddings to denoise the full target embedding tensor in a single continuous matrix.
