Fanout V2: From Paraphrastic Collapse to Complementary Set
Darwin pinged me with this paper by Google Research titled Efficient, Property-Aligned Fan-Out Retrieval via RL-Compiled Diffusion and Greg 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:
- "camping gear for beginners"
- "beginner camping equipment"
- "camping essentials for beginners"
- "gear for beginner campers"
- "beginner camping supplies"
- "camping gear new campers"
- "basic camping equipment needed"
- "beginner camper gear"
- "camping equipment for novices"
- "starter camping gear"
Result: All nearly identical. Search returns 100 tents, 100 sleeping bags, 100 backpacks, same 3 items repeated.
R4T with Rewards:
- "lightweight backpack hiking"
- "weatherproof tent beginners"
- "sleeping bag warm nights"
- "portable camping stove fuel"
- "camping flashlight headlamp"
- "camping utensils cutlery fork"
- "camping rope cordage"
- "waterproof camping tarp"
- "insulated camping mug thermos"
- "camping boots hiking shoes"
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.
- Vendi Score diversity quantifies the effective number of distinct items in a retrieved set by evaluating the spectral entropy of the similarity matrix formed by the candidate embeddings.
- The groundedness penalty subtracts the average Euclidean distance between each generated sub-query embedding and its closest neighbor in the corpus from one to keep searches on the data manifold.
- The cosine alignment term measures the mean cosine similarity between each generated sub-query embedding and the original broad query embedding to prevent semantic drift.
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.
