Get Started
Home
Topics
Search
Library
Agents · Image Generation · Jul 9, 2026

Search Beyond What Can Be Taught: Evolving the Knowledge Boundary in Agentic Visual Generation

Source: research paper via Hugging Face Daily Papers
0:00 / 6:40
SearchGen attacks blind retrieval in image generation: always-on search corrupts prompts the model already handles, dropping Qwen-Image-2 from 70.7 to 60.4. Co-training the generator via DPO then the search-agent via RFT teaches abstention, since the knowledge boundary moves whenever the generator learns.
TL;DR
SearchGen co-trains an image generator and a search-agent reasoner so the agent learns to retrieve only what the generator cannot render from parameters, closing a ~40-point benchmark collapse that appears on long-tail, post-cutoff, and culturally specific prompts.
Why It Matters
You’ve shipped a product that turns user requests into images. A user asks for the mascot of the 2025 Osaka Expo or a Oaxacan alebrije dragon. Your generator produces something confident and wrong, because the entity postdates training or sits deep in the long tail. Today your fix is prompt rewriting: an LLM expands the request into a longer text prompt and hopes the generator fills the gap.
The dominant baseline in this space is Retrieval-Augmented Generation adapted to images, plus prompt-rewriting agents. Both assume search is always helpful. The authors show that flipping search on for every prompt actively degrades outputs the generator already handled correctly.
How It Works
The system has two pieces that get trained against each other. A reasoner (an 8B Qwen3-VL-8B) sits in front of the generator and runs a three-stage loop the authors call gate-filter-integrate. Gate: inspect the prompt, list knowledge gaps, decide per gap whether to call image search, web search, or nothing. Filter: from returned results, keep only the one reference that fills the specific gap without dragging in style or background. Integrate: don’t hand raw pixels to the generator. Instead, write an enriched text prompt that names what to borrow (“following Image 1, render the character in a teal-and-gold robe”) and attach the reference.
The key concept is the knowledge boundary: the split between what a specific generator has internalized and what must come from context. This boundary is generator-specific and shifts as the generator improves. So they co-train in two phases. Phase 1 uses Diffusion-DPO on the generator: sample multiple images per prompt with search-augmented inputs, score them with a VLM judge, build preference pairs from best and worst. This teaches the generator to absorb stable knowledge and to tolerate noisy references. Phase 2 uses RFT on the reasoner: roll out search trajectories, score the resulting images, keep only trajectories with positive group-relative advantage, retrain the reasoner on those. The reasoner learns to abstain on prompts the strengthened generator now handles alone.
# Phase 1: teach generator for prompt in batch: enriched = reasoner.gate_filter_integrate(prompt) imgs = [generator(enriched) for _ in range(M)] scores = [vlm_judge(prompt, x) for x in imgs] dpo_update(generator, chosen=argmax(scores), rejected=argmin(scores)) # Phase 2: recalibrate reasoner to new boundary for prompt in batch: trajs = [reasoner.rollout(prompt) for _ in range(N)] imgs = [generator(t) for t in trajs] adv = group_relative_advantage([vlm_judge(prompt, x) for x in imgs]) sft_update(reasoner, keep=[t for t, a in zip(trajs, adv) if a > 0])
Core Insight
The prevailing assumption in retrieval-augmented generation is that search is a monotonic improvement: turn it on for every query, engineer better rankers, done. This paper shows the opposite. The search policy is a joint property of the generator-reasoner pair, and calibrating it requires training the generator first so the reasoner has a stable boundary to aim at. The sharpest evidence is the cross-check where a reasoner calibrated to the Direct Preference Optimization-strengthened generator drops from 31.8 to 26.8 when paired back with the base generator. The optimal policy literally moves when the generator moves.
What They Found
The load-bearing finding is that naive search hurts prompts the generator already handles. On the NoSearch stratum, forcing blind search on Qwen-Image-2 drops it from 70.7 to 60.4. The co-trained reasoner, in contrast, learns to abstain: on NoSearch it scores 56.9 vs 49.9 for the no-search baseline paired with the same DPO-strengthened generator. That’s the mechanism working. Then the headline numbers:
•
On SearchGen-Bench, frontier open generators collapse to 21-28 out of 100 on search-intensive prompts, while commercial systems with integrated search barely drop. Rendering-quality components stay high; the collapse is purely knowledge absence.
•
Co-training on Flux.2-Klein-4B reaches 31.8 overall, slightly beating a Gemini-3-Flash frontier-API reasoner (31.2) paired with the same generator. An 8B open reasoner matches a frontier VLM once it’s calibrated to the specific generator.
•
Both phases contribute independently: generator DPO alone adds +2.8, reasoner RFT adds another +2.6. The same monotonic pattern holds on Bagel-7B, ruling out architecture-specific effects.
•
The gap to GPT-Image-2 (71.0) reflects the 4B generator’s ceiling, not the framework.
What’s Useful
Reach for this when you’re building an agent that calls an image generator behind a verifier or judge, and your users ask for things past the training cutoff or deep in the long tail. Today you either always-search (and corrupt easy prompts) or never-search (and fabricate). The recipe here: train the generator on search-augmented preference pairs first, then use rejection sampling to teach your search agent when to shut up. The routing-visual-references-through-language trick is independently useful: it stops reference images from leaking background and style into outputs.
The release is substantial. SearchGen-20K (20,839 prompts, 22 domains, bilingual English/Chinese), SearchGen-Bench (751-prompt eval), and SearchGen-Corpus-1M with 145,642 cached search sessions and 370,733 cached downloads. Because every search is pre-executed, you can replay the whole pipeline offline without paying for SERP APIs. They also release 90,452 reasoning traces and 281,925 generated images for preference and distillation work. Code and models are released alongside.
Takeaway
Search is a tool, not a default. Teach the model first, then teach the agent when to reach for the tool. The knowledge boundary moves every time the generator learns something new, so any always-on retrieval policy is miscalibrated by construction. Co-training exists because the two components need to agree on where that line currently sits.
Caveats
•
Only one DPO pass and one RFT pass are evaluated. The authors frame recursive self-improvement as the payoff, but they don’t show what happens at iteration 3 or 5, including whether the boundary keeps moving or the reasoner over-abstains.
•
All rewards come from a Gemini-3-Flash judge with Spearman 0.87 vs humans. If your product’s notion of “good image” diverges from that judge (typography-heavy outputs, brand fidelity, NSFW policies), the co-training signal points somewhere else.
•
The generator ceiling is real: a 4B model with perfect search still trails GPT-Image-2 by ~39 points. The mechanism extracts the maximum from a fixed generator; it does not substitute for generator capacity on prompts where even correct references cannot be rendered.
Topics
Don't miss new content
Log in to follow topics and personalize your feed.
By content type
Research Paper178 episodes
AI178 episodes