Search Beyond What Can Be Taught
Evolving the Knowledge Boundary in Agentic Visual Generation
Haozhe Wang1 · Weijia Feng3 · Jinpeng Yu3 · Che Liu4 · Ping Nie2 · Fangzhen Lin1 · Jiaming Liu3✉ · Ruihua Huang3 · Jimmy Lin2 · Wenhu Chen2 · Cong Wei2✉
1 HKUST · 2 University of Waterloo · 3 Qwen Applications · 4 Imperial College London
✉ Corresponding authors: Jiaming Liu, Cong Wei
Enjoying SearchGen? Help us by upvoting and starring the project.
Image generators fabricate what they don't know. This one looks it up first—and knows when not to.
Two paradigms for knowledge-hungry prompts. Left: prompt rewriting inflates the text but still generates from stale weights. Right: SearchGen fetches live web and visual context, then conditions the generator—grounding facts a model cannot know.
TL;DR — Teach What You Can, Search the Rest
Modern image generators render gorgeously and lie fluently. Ask for the 2025 Osaka Expo mascot and you get a confident, wrong invention. The failure isn't the pixels—it's the knowledge. On AgentGen-Bench, open generators score just 17.5–31.6 out of 100 on search-intensive prompts—with a collapse of up to 41.4 points that standard benchmarks never register.
Search is the obvious fix, the way an illustrator consults references. But naive search backfires: it corrupts prompts the generator already handled. The real problem is a knowledge boundary—the line between what a generator can learn and what it must look up. That line is generator-specific, it moves during training, and it cannot be hand-drawn. It has to be discovered.
We discover it by co-training the generator and the search agent together. Below, we show how the collapse works, why naive search fails, what the knowledge boundary is, and how a co-trained 8B reasoner on a 4B generator matches a frontier reasoner on the same generator.
They Render Beautifully. They Just Make Things Up.
Ask a frontier image model for the mascot of the 2025 Osaka Expo. You get a polished, confident fabrication. Ask for a historically accurate Spartan phalanx and you get anachronistic armor, rendered in exquisite detail.
The lighting is right. The composition is right. The world is wrong.
This is not a rendering failure. It is a world-knowledge bottleneck. Generators train on fixed corpora with hard knowledge cutoffs; user requests draw on new characters, regional symbols, niche typography, historical artifacts, and events that postdate training.
Worse, generators have no way to flag their own ignorance. They are trained to always output an image—never to say, “I don't know what this looks like.” So they guess, beautifully, every time.
Ask for a specific person, a labeled scientific diagram, or live data and today's best generators confidently fabricate. These representative cases span SearchGen's 12 failure categories.
Finding 1 — A 41.4-Point Gap That No Benchmark Shows
Generators that score comparably on standard prompts diverge by up to 41.4 points when search-intensive world knowledge is required.
On NoSearch prompts, the strongest open generator reaches 70.0, overlapping the commercial range (66.3–78.9). Turn to prompts that need live world knowledge and the field splits: open generators span 17.5–31.6, while the five leading commercial systems score 63.6–75.5 and drop by only 2.0–9.7 points. Existing benchmarks test rendering inside known concepts, so they never see this gap at all.
To surface it, we built AgentGen-Bench (previously named SearchGen-Bench): 751 test prompts scored with separate dimensions for knowledge and rendering. The new name reflects the benchmark's broader use for evaluating agentic generation. The split is the whole point. When a generator scores poorly on knowledge checklists but remains strong on image quality, the diagnosis is unambiguous—it can draw; it just does not know.
AgentGen-Bench results. Generators score well on prompts they can answer from memory (gray). On prompts requiring external knowledge (blue), every open generator drops—by as much as 41.4 points—while the leading commercial systems remain comparatively stable. The bottleneck is missing knowledge, not rendering skill.
Overall AgentGen-Bench ranking. GPT-Image-2 leads, followed by Grok-Imagine-2.0-Low and Qwen-Image-3-Max. Scores use Overall9 from the finalized 3d5 evaluator.
Benchmark Leaderboards
Full evaluates all 751 benchmark prompts. Test-mini is the fixed,
published 200-prompt slice obtained by selecting rows whose subset array
contains the official testmini label—it is not a new random sample:
from datasets import load_dataset benchmark = load_dataset("JasperHaozhe/AgentGen-Bench", split="test") testmini = benchmark.filter(lambda row: "testmini" in row["subset"]) assert len(testmini) == 200
Scores are on a 0–100 scale. Each table reports Overall9 for the same 18
generators. Coverage is scored prompts / slice prompts, with missing
evaluator scores excluded from aggregation.
Full benchmark (751 prompts)
| Rank | Model | Coverage | Overall9 |
|---|---|---|---|
| 1 | GPT-Image-2 | 718/751 | 76.0 |
| 2 | Grok-Imagine-2.0-Low | 715/751 | 75.2 |
| 3 | Qwen-Image-3-Max | 738/751 | 68.4 |
| 4 | Grok-Imagine | 717/751 | 67.8 |
| 5 | Nano Banana Pro | 738/751 | 65.0 |
| 6 | Qwen-Image-2-Pro | 742/751 | 59.4 |
| 7 | Qwen-Image-2 | 741/751 | 56.4 |
| 8 | SeedDream-4.5 | 746/751 | 56.2 |
| 9 | SeedDream-4.0 | 750/751 | 52.5 |
| 10 | Nano-Banana | 740/751 | 49.7 |
| 11 | SenseNova-U1 | 750/751 | 35.7 |
| 12 | Qwen-Image | 751/751 | 34.1 |
| 13 | Mage-Flow | 751/751 | 32.8 |
| 14 | Flux.2-Klein-9B | 750/751 | 31.1 |
| 15 | Flux.2-Klein-4B | 751/751 | 27.7 |
| 16 | Bagel | 751/751 | 25.8 |
| 17 | OmniGen2 | 750/751 | 24.0 |
| 18 | Show-o2 | 751/751 | 19.8 |
Test-mini (200 prompts)
| Rank | Model | Coverage | Overall9 |
|---|---|---|---|
| 1 | GPT-Image-2 | 200/200 | 76.3 |
| 2 | Grok-Imagine-2.0-Low | 196/200 | 73.9 |
| 3 | Qwen-Image-3-Max | 195/200 | 68.2 |
| 4 | Grok-Imagine | 196/200 | 67.7 |
| 5 | Nano Banana Pro | 200/200 | 64.7 |
| 6 | Qwen-Image-2-Pro | 197/200 | 60.3 |
| 7 | Qwen-Image-2 | 197/200 | 56.9 |
| 8 | SeedDream-4.5 | 199/200 | 56.6 |
| 9 | SeedDream-4.0 | 200/200 | 51.8 |
| 10 | Nano-Banana | 200/200 | 48.4 |
| 11 | SenseNova-U1 | 200/200 | 35.4 |
| 12 | Qwen-Image | 200/200 | 32.7 |
| 13 | Mage-Flow | 200/200 | 31.4 |
| 14 | Flux.2-Klein-9B | 200/200 | 30.5 |
| 15 | Flux.2-Klein-4B | 200/200 | 27.1 |
| 16 | Bagel | 200/200 | 24.8 |
| 17 | OmniGen2 | 199/200 | 22.2 |
| 18 | Show-o2 | 200/200 | 19.1 |
testmini_easy and testmini_hard are independent official label slices;
they are not necessarily a partition of the 200-prompt testmini slice.
Mini-easy
| Rank | Model | Coverage | Overall9 |
|---|---|---|---|
| 1 | GPT-Image-2 | 100/100 | 79.7 |
| 2 | Grok-Imagine-2.0-Low | 98/100 | 79.5 |
| 3 | Qwen-Image-3-Max | 99/100 | 74.9 |
| 4 | Grok-Imagine | 98/100 | 73.4 |
| 5 | Qwen-Image-2-Pro | 99/100 | 69.3 |
| 6 | Nano Banana Pro | 100/100 | 66.5 |
| 7 | SeedDream-4.0 | 100/100 | 64.3 |
| 8 | SeedDream-4.5 | 99/100 | 63.9 |
| 9 | Qwen-Image-2 | 99/100 | 63.5 |
| 10 | Nano-Banana | 100/100 | 54.4 |
| 11 | SenseNova-U1 | 100/100 | 40.6 |
| 12 | Qwen-Image | 100/100 | 38.7 |
| 13 | Mage-Flow | 100/100 | 37.7 |
| 14 | Flux.2-Klein-9B | 100/100 | 34.8 |
| 15 | Flux.2-Klein-4B | 100/100 | 32.6 |
| 16 | Bagel | 100/100 | 29.3 |
| 17 | OmniGen2 | 100/100 | 26.5 |
| 18 | Show-o2 | 100/100 | 20.2 |
Mini-hard
| Rank | Model | Coverage | Overall9 |
|---|---|---|---|
| 1 | Grok-Imagine-2.0-Low | 96/100 | 71.9 |
| 2 | GPT-Image-2 | 100/100 | 71.3 |
| 3 | Qwen-Image-3-Max | 99/100 | 64.3 |
| 4 | Grok-Imagine | 94/100 | 61.8 |
| 5 | Nano Banana Pro | 100/100 | 60.8 |
| 6 | Qwen-Image-2-Pro | 100/100 | 50.6 |
| 7 | Qwen-Image-2 | 100/100 | 50.0 |
| 8 | SeedDream-4.5 | 100/100 | 49.0 |
| 9 | Nano-Banana | 100/100 | 44.4 |
| 10 | SeedDream-4.0 | 100/100 | 38.9 |
| 11 | SenseNova-U1 | 100/100 | 29.7 |
| 12 | Qwen-Image | 100/100 | 29.5 |
| 13 | Mage-Flow | 100/100 | 28.3 |
| 14 | Flux.2-Klein-9B | 100/100 | 27.3 |
| 15 | Bagel | 100/100 | 23.0 |
| 16 | Flux.2-Klein-4B | 100/100 | 21.9 |
| 17 | OmniGen2 | 100/100 | 21.9 |
| 18 | Show-o2 | 100/100 | 15.8 |
Full Benchmark Breakdown
Scores are reported on a 0–100 scale; higher is better. Checklist, Rubric, and Visual ref. are knowledge-sensitive measures that test whether requested facts are present. Image quality, Text rendering, and Physical plausibility capture rendering competence. Together, the components distinguish a model that cannot draw from one that can draw but lacks the required world knowledge.
| Stratum | Type | Generator | Overall9 | Checklist | Rubric | Prompt | Image quality | Text rendering | AI naturalness | Composition | Physical plausibility | Visual ref. |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| NoSearch | Commercial | GPT-Image-2 | 78.9 | 84.8 | 82.7 | 79.3 | 73.4 | 92.3 | 67.6 | 86.5 | 81.2 | 70.9 |
| NoSearch | Commercial | Grok-Imagine-2.0-Low | 76.9 | 83.0 | 80.0 | 75.9 | 72.5 | 85.5 | 66.3 | 84.0 | 80.8 | 68.7 |
| NoSearch | Commercial | Grok-Imagine | 74.8 | 81.3 | 78.3 | 72.7 | 72.3 | 83.9 | 65.6 | 79.7 | 77.2 | 66.9 |
| NoSearch | Commercial | Qwen-Image-3-Max | 73.7 | 79.1 | 76.2 | 69.8 | 70.3 | 86.2 | 63.9 | 82.5 | 78.3 | 64.0 |
| NoSearch | Commercial | Nano Banana Pro | 73.3 | 78.4 | 76.3 | 70.2 | 70.7 | 85.6 | 65.2 | 80.3 | 77.1 | 63.0 |
| NoSearch | Commercial | Qwen-Image-2-Pro | 71.2 | 76.8 | 74.1 | 67.3 | 70.5 | 77.8 | 61.8 | 78.3 | 75.3 | 61.2 |
| NoSearch | Commercial | Qwen-Image-2 | 71.1 | 76.2 | 73.1 | 67.5 | 70.2 | 79.5 | 63.8 | 79.2 | 74.2 | 60.3 |
| NoSearch | Commercial | SeedDream-4.0 | 70.7 | 76.4 | 73.3 | 65.8 | 69.0 | 76.0 | 61.7 | 80.8 | 75.5 | 58.5 |
| NoSearch | Open | Qwen-Image | 70.0 | 74.9 | 72.0 | 65.5 | 69.2 | 61.1 | 61.7 | 77.0 | 78.6 | 60.1 |
| NoSearch | Commercial | SeedDream-4.5 | 69.3 | 76.2 | 72.8 | 65.5 | 67.3 | 74.0 | 59.0 | 76.8 | 73.4 | 59.6 |
| NoSearch | Commercial | Nano-Banana | 66.3 | 70.8 | 68.5 | 61.8 | 67.7 | 49.0 | 59.7 | 77.5 | 70.5 | 56.2 |
| NoSearch | Open | SenseNova-U1 | 62.8 | 68.1 | 65.2 | 58.5 | 64.3 | 58.3 | 56.2 | 72.2 | 65.1 | 51.1 |
| NoSearch | Open | Mage-Flow | 61.2 | 64.2 | 61.8 | 54.5 | 64.7 | 51.2 | 56.3 | 71.8 | 67.4 | 47.1 |
| NoSearch | Open | Flux.2-Klein-9B | 58.5 | 63.7 | 60.7 | 49.5 | 63.2 | 30.0 | 53.5 | 71.0 | 67.0 | 41.1 |
| NoSearch | Open | Flux.2-Klein-4B | 52.3 | 55.8 | 52.6 | 42.3 | 59.7 | 16.1 | 49.8 | 67.7 | 60.1 | 35.3 |
| NoSearch | Open | Bagel | 49.1 | 51.5 | 49.2 | 37.7 | 56.2 | 16.1 | 48.8 | 62.8 | 58.5 | 32.1 |
| NoSearch | Open | OmniGen2 | 47.4 | 49.1 | 46.1 | 33.5 | 56.4 | 7.8 | 47.3 | 61.4 | 60.3 | 30.6 |
| NoSearch | Open | Show-o2 | 34.4 | 32.7 | 30.9 | 21.0 | 47.2 | 2.4 | 38.0 | 49.8 | 40.9 | 19.9 |
| SearchIntensive | Commercial | GPT-Image-2 | 75.5 | 74.4 | 73.7 | 72.2 | 77.4 | 77.7 | 68.9 | 83.9 | 84.9 | 70.4 |
| SearchIntensive | Commercial | Grok-Imagine-2.0-Low | 74.9 | 73.1 | 72.5 | 70.7 | 76.9 | 79.9 | 69.0 | 83.5 | 85.6 | 68.3 |
| SearchIntensive | Commercial | Qwen-Image-3-Max | 67.6 | 65.8 | 65.3 | 62.8 | 71.1 | 67.9 | 62.3 | 77.0 | 78.6 | 59.6 |
| SearchIntensive | Commercial | Grok-Imagine | 66.7 | 65.9 | 64.6 | 62.8 | 69.5 | 65.7 | 61.7 | 75.6 | 77.8 | 59.7 |
| SearchIntensive | Commercial | Nano Banana Pro | 63.6 | 60.7 | 60.1 | 56.4 | 68.1 | 61.3 | 60.0 | 72.7 | 78.1 | 55.4 |
| SearchIntensive | Commercial | Qwen-Image-2-Pro | 57.5 | 53.9 | 53.1 | 48.3 | 65.3 | 55.1 | 57.3 | 68.9 | 72.8 | 46.8 |
| SearchIntensive | Commercial | Qwen-Image-2 | 54.1 | 49.9 | 49.6 | 44.1 | 62.5 | 50.1 | 54.3 | 66.2 | 71.4 | 42.0 |
| SearchIntensive | Commercial | SeedDream-4.5 | 54.1 | 51.7 | 50.8 | 45.2 | 61.8 | 50.4 | 50.8 | 65.9 | 69.3 | 42.1 |
| SearchIntensive | Commercial | SeedDream-4.0 | 49.6 | 45.6 | 45.1 | 39.3 | 58.8 | 37.2 | 50.9 | 62.5 | 68.0 | 36.8 |
| SearchIntensive | Commercial | Nano-Banana | 47.1 | 43.0 | 42.3 | 36.1 | 56.9 | 31.2 | 48.9 | 60.5 | 67.0 | 35.9 |
| SearchIntensive | Open | SenseNova-U1 | 31.6 | 29.3 | 27.6 | 21.6 | 39.5 | 15.8 | 32.2 | 42.5 | 48.4 | 21.0 |
| SearchIntensive | Open | Qwen-Image | 28.6 | 25.0 | 23.8 | 17.4 | 37.9 | 9.2 | 29.9 | 41.0 | 45.5 | 17.7 |
| SearchIntensive | Open | Mage-Flow | 28.4 | 23.0 | 21.7 | 15.7 | 38.7 | 9.7 | 35.0 | 40.0 | 50.2 | 16.2 |
| SearchIntensive | Open | Flux.2-Klein-9B | 26.9 | 23.8 | 22.4 | 15.1 | 36.1 | 5.8 | 29.9 | 38.3 | 47.7 | 16.7 |
| SearchIntensive | Open | Flux.2-Klein-4B | 23.9 | 20.1 | 18.6 | 11.5 | 33.0 | 3.4 | 28.1 | 35.7 | 44.8 | 12.7 |
| SearchIntensive | Open | Bagel | 22.2 | 18.7 | 17.7 | 12.4 | 30.4 | 2.2 | 25.0 | 32.4 | 38.1 | 14.2 |
| SearchIntensive | Open | OmniGen2 | 20.4 | 16.4 | 14.9 | 8.8 | 29.2 | 2.5 | 24.3 | 31.4 | 40.8 | 9.5 |
| SearchIntensive | Open | Show-o2 | 17.5 | 8.1 | 8.0 | 4.2 | 30.2 | 0.7 | 26.5 | 34.3 | 31.7 | 3.4 |
NoSearch contains 100 prompts; Search-Intensive is the 651-row union of VisualSearch and TextualSearch. Scores use present-only aggregation.
Finding 2 — Search Should Help. Often It Hurts.
An illustrator handed an unfamiliar brief looks up references before drawing. Give the generator the same move—a reasoner spots knowledge gaps, search fills them, and the results feed generation—and you have agentic visual generation. Natural. And, done naively, harmful.
Naive search actively degrades prompts the generator already handles.
Search everything blindly, and every generator gets worse on prompts that never needed help. Qwen-Image-2 drops from 70.7 to 60.4 on the no-search stratum—a 14.6% relative loss on prompts it already aced.
| Need Search? | Generator | n | NoSearch | Reasoned | Blind |
|---|---|---|---|---|---|
| NoSearch | Qwen2 | 100 | 70.7 | 76.5 | 60.4 |
| Qwen1 | 99 | 67.5 | 75.0 | 59.5 | |
| Klein-9B | 58 | 57.9 | 66.4 | 52.3 | |
| VisualSearch | Qwen2 | 384 | 37.2 | 49.1 | 45.3 |
| Qwen1 | 384 | 32.8 | 44.4 | 39.7 | |
| Klein-9B | 338 | 29.6 | 39.4 | 36.0 | |
| TextualSearch | Qwen2 | 263 | 22.9 | 34.1 | 32.1 |
| Qwen1 | 263 | 20.5 | 28.5 | 25.3 | |
| Klein-9B | 264 | 18.9 | 26.6 | 24.0 |
Two distinct failures explain it. Concept corruption: search fires on something the model already knew, and the retrieved reference overrides correct internal knowledge—a gating failure. Copy effect: a reference contains so much detail that the generator copies it wholesale instead of borrowing the one missing fact—a filtering failure.
Search is not free. Fed raw, retrieved content leaks into the image—the model copies a reference boat verbatim or pastes a search-result caption into the artwork. Naive retrieval corrupts the very prompts a model could have answered alone.
The Knowledge Boundary
Some knowledge belongs inside the model. A character's canonical look or a flag's fixed geometry is stable, low-dimensional, and learnable once and for all. Fire search for it and you only add noise.
Other knowledge belongs outside. It changes faster than retraining cycles, sits too deep in the long tail to learn reliably, or needs per-request reasoning. For this, search is structurally necessary. The tail is enormous: 93.1% of the 31,537 entities in our data appear in just one prompt. No feasible training set covers that.
Some knowledge is internalizable and search should not fire for it; other knowledge is contextual and search is structurally necessary.
We call the divide between those sets the knowledge boundary. It is generator-specific, and it moves. As a generator learns, concepts migrate from “must search” to “already knows.” A search policy tuned for a weak generator is wrong for a strong one.
The boundary cannot be hand-specified. It is discoverable: it falls out of training the generator and searcher together.
Method — Gate, Filter, Integrate
The method has two halves: a searcher that does not poison the generator, and a training loop that finds and expands the boundary.
- Gate: decide whether to search. Only critical or important gaps trigger a query; the rest are dropped. Use at most three queries per prompt, or skip search entirely.
- Filter: decide what to keep. Choose the reference that fills the specific gap with the least extraneous baggage.
- Integrate: decide how it enters. Route visual references through language, not raw pixels, so the generator borrows exactly what is named and nothing else leaks in.
The teach-then-search co-training recipe acts on both sides of the boundary:
- Warm-start: supervised fine-tuning gives an 8B reasoner the gate–filter–integrate protocol.
- Teach the generator: online iterative Diffusion-DPO helps it internalize stable knowledge and use imperfect references robustly.
- Recalibrate the searcher: rejection-sampling fine-tuning rewards trajectories where search helps the improved generator and discards the rest.
Phase 1 moves the boundary outward; Phase 2 moves the search policy inward to match. The model is never told where the line is—it learns from which searches actually helped.
Two coupled loops. The agent gates each prompt, fetches and filters references only when a knowledge gap warrants it, then integrates them into an enriched prompt. Online DPO teaches the generator what it can internalize, expanding the knowledge boundary so the agent has less to fetch over time.
Finding 3 — The Boundary Is Discoverable
Co-training discovers the knowledge boundary: a calibrated 8B reasoner matches a frontier oracle on the same generator.
On Klein-4B, the full co-training progression climbs monotonically to 31.8 overall, matching the frontier Gemini oracle on the same generator (31.2). Both phases pull their weight: teaching the generator adds +2.8, and recalibrating the searcher adds +2.6.
| Phase | Configuration | n | NoSearch | Easy | Medium | Hard | Overall |
|---|---|---|---|---|---|---|---|
| Phase 0 | Gen-Agnostic (SFT-8B) + Klein-4B | 602 | 54.6 | 28.9 | 29.2 | 21.2 | 26.4 |
| Phase 1 | Gen-Agnostic (SFT-8B) + Klein-4B-DPO-v2 | 321 | 54.0 | 31.8 | 31.1 | 24.7 | 29.2 |
| Phase 2 | Gen-Adaptive (RFT-8B) + Klein-4B-DPO-v2 | 321 | 56.9 | 34.1 | 33.6 | 27.4 | 31.8 |
| ref | Oracle (frontier API) + Klein-4B-DPO-v2 | 750 | 55.7 | 33.7 | 33.9 | 26.0 | 31.2 |
| ref | No-Search + Klein-4B-DPO-v2 | 751 | 49.9 | 28.2 | 26.3 | 20.6 | 25.0 |
It is also selective, which is the hard part. On prompts that do not need search, the calibrated reasoner lifts the no-search baseline from 49.9 to 56.9—it learned when to stay quiet, exactly where naive search did damage. It is also generator-specific: a policy tuned for the strengthened generator scores worse on the base one, confirming that the boundary belongs to the generator–reasoner pair, not to the prompt alone.
The headline is calibration per dollar. An 8B reasoner on a 4B generator reaches the same quality as a frontier commercial reasoner on that generator, and the full recalibration cycle fits in 4 × 8 GPU-hours.
(a) Co-training compounds. Each round—reasoner SFT, generator DPO, reasoner RFT—lifts quality across all three difficulty tiers for Klein-4B and Bagel-7B. (b) Proof the boundary moved: after co-training, per-prompt no-search quality shifts right; more prompts clear a given quality bar without search.
This compares reasoners on a fixed 4B generator; it is not a claim of frontier absolute image quality. In absolute terms, 31.8 remains below GPT-Image-2's finalized full-benchmark Overall9 score of 76.0.
The Released Harness
Reproducing search-augmented generation usually means paying for a search engine and a fleet of generators—and watching results drift as those services change. We froze the whole thing.
We release SearchGen-20K (20,839 world-knowledge-grounded prompts across 12 failure categories and 22 domains, with 5.2 knowledge gaps per prompt on average), the co-training corpus (90,452 reasoning traces and 281,925 generations), and SearchGen-Corpus-1M (145,642 archived image and web search sessions, 559,973 unique URLs, and 370,733 cached downloads).
Because every search is pre-executed and frozen, the pipeline can be replayed offline. No live search API keys. No result drift. An expensive research workflow becomes a stable substrate for preference learning, reward modeling, search-policy design, and retrieval studies.
SearchGen-20K spans 22 real-world domains—from People & Professions and Screen & Performance Media down a long tail through Science, Fashion, and Infrastructure—mirroring how people actually prompt.
Repository Layout
./
├── README.md
├── LICENSE
├── agent/
│ ├── README.md # API and input/output contracts
│ ├── QUICKSTART.md # offline end-to-end demonstration
│ ├── pyproject.toml
│ ├── src/searchgen_agent/ # Agentic Reasoner and Image Generator
│ ├── examples/ # custom API adapter templates
│ └── tests/ # offline integration tests
└── evaluation/
├── evaluate.py # evaluation entry point
├── aggregate_scores.py # result aggregation
├── searchgen_eval/ # evaluator implementation
├── docs/ # protocol, schemas, and prompt reference
├── examples/ # manifest and environment templates
└── tests/ # regression and end-to-end tests
Agentic Reasoner with Search Tools and Image Generator
The agent/ package contains:
- an Agentic Reasoner with Search Tools that analyzes requests, conditionally performs web/image search, selects useful references, and writes a refined generation manifest;
- an Image Generator that consumes the manifest through a user-defined image API plugin; and
- user extension points for custom chat, search, authentication, and image-generation services.
The agent package defines the complete adaptation contracts:
- input dataset and reasoner output protocol;
- OpenAI-compatible chat-model protocol;
- custom web/image search request and response protocol;
s4_generation_manifest.jsonhandoff protocol;- custom Image Generator input and output protocol; and
- generated image and metadata output protocol.
Install it with Python 3.10 or newer:
cd agent python3 -m venv .venv source .venv/bin/activate python -m pip install -e .
Follow agent/QUICKSTART.md for a fully offline run. To connect real services, implement the search signer and image-generator callback shown in agent/examples/.
Evaluation Environment
For full reproducibility, we recommend the released AgentGen-Bench-Evaluator, which is trained on top of Qwen3.5-9B. The evaluator requires Python 3.10 or newer:
cd evaluation python3 -m venv .venv source .venv/bin/activate pip install -r requirements.txt cp examples/env.example .env
Set an OpenAI-compatible endpoint and judge model credentials in .env:
SEARCHGEN_EVAL_API_URL=https://your-openai-compatible-host.example/v1 SEARCHGEN_EVAL_API_KEY=replace_me
Then export them with set -a; source .env; set +a.
Serve the released evaluator with vLLM using the provided portable script:
pip install vllm
bash evaluation/serve_evaluator.sh
# Multi-GPU: one data-parallel replica per listed GPU
bash evaluation/serve_evaluator.sh --gpus 0,1,2,3The script enforces --chat-template-content-format openai, which is required
for the evaluator's multimodal OpenAI-style messages. For multiple GPUs it uses
vLLM data parallelism by default (--data-parallel-size), with tensor parallel
size one. See evaluation/serve_evaluator.sh
for optional model, port, DP, and TP overrides.
Evaluation Quick Start
Download AgentGen-Bench, then prepare a predictions manifest following evaluation/examples/generated_images_manifest.example.jsonl. From the repository's evaluation/ directory, validate all inputs without API calls, replacing the benchmark paths with the location of your download:
python evaluate.py \ --metadata /path/to/AgentGen-Bench/eval_metadata.jsonl \ --benchmark-root /path/to/AgentGen-Bench \ --predictions-manifest predictions.jsonl \ --output-dir results \ --model your-judge-model \ --preflight
Remove --preflight and add --workers 16 to run evaluation. Completed successful examples resume automatically. Use --dry-run to inspect pending jobs, or repeat --bench-id and --generator to select subsets.
Evaluation
AgentGen-Bench separates no-search and search-intensive prompts so evaluation can distinguish missing world knowledge from rendering failures and damage caused by unnecessary retrieval.
The released evaluation protocol reports checklist satisfaction, adaptive-rubric satisfaction, prompt faithfulness, image quality, text rendering, AI naturalness, composition and aesthetics, physical plausibility, visual-reference consistency, and text-reference consistency. Component scores use a 0–3 scale with half points; non-applicable fields remain unscored.
Aggregate completed results with:
python aggregate_scores.py results --missing-policy skip
See the evaluation/ folder and its README.md for the complete commands, input/output schema, evaluation protocol, prompt reference, and tests.
License
The code release is licensed under the Apache License 2.0.
Citation
@article{searchgen, title={Search Beyond What Can Be Taught: Evolving the Knowledge Boundary in Agentic Visual Generation}, author={Wang, Haozhe and Feng, Weijia and Yu, Jinpeng and Liu, Che and Nie, Ping and Lin, Fangzhen and Liu, Jiaming and Huang, Ruihua and Lin, Jimmy and Chen, Wenhu and others}, journal={arXiv preprint arXiv:2607.05382}, year={2026} }

