Introduction
Training capable information-seeking (IS) agents requires complex, multi-hop search data, which is currently scarce and difficult to synthesize. This paper introduces WebShaper, a novel data synthesis framework that uses set theory to formalize search tasks, allowing an agent to systematically construct logically sound, highly complex training trajectories. Models trained on WebShaper data achieve state-of-the-art performance among open-source agents on the notoriously difficult GAIA benchmark.
The Information-Seeking Challenge
Large Language Models (LLMs) are increasingly being used as autonomous research agents. To build these agents, developers need high-quality "trajectory" data—examples of a complex question, the iterative web searches required to solve it, and the final answer.
Currently, developers synthesize this data using an information-driven approach: they scrape web pages, feed the text to an LLM, and ask it to generate a question. However, this often results in messy data. The LLM might generate a question where the reasoning structure doesn't match the information structure, leading to logical inconsistencies, redundant clues, or "reasoning shortcuts" where the agent can guess the answer without actually performing the required multi-step search.
Methodology: Formalization-Driven Synthesis
WebShaper tackles these issues by flipping the paradigm to be formalization-driven. Instead of starting with raw text, WebShaper starts with mathematical formalization. The authors model information-seeking tasks using set theory, defining basic search units as Knowledge Projections (KPs).
The synthesis pipeline works in three main steps:
- Seed Generation: The system performs random walks across an offline Wikipedia database to generate basic, single-hop seed questions.
- Agentic Expansion: An autonomous "Expander" agent iteratively makes the seed questions more complex. Crucially, it uses a Layer-wise Expansion Strategy. Instead of randomly adding facts to a question, it takes "leaf nodes" (constants) in the logic graph and turns them into variables that require further search. The Expander actively searches the web and validates the logic at each step to ensure the new, complex question is sound.
- Trajectory Construction: A ReAct-based agent is deployed to solve these newly minted, highly complex questions using
SearchandVisittools. The successful, filtered trajectories are then used to train the final IS models via Supervised Fine-Tuning (SFT) and Reinforcement Learning (RL) using the GRPO algorithm.
Experimental Results
The authors generated the WebShaper dataset, starting with 18k seed questions and distilling them down to 5,000 high-quality, verified search trajectories. The resulting models were evaluated on GAIA (a highly challenging benchmark for general AI assistants) and WebWalkerQA.
Key Insights
- Logic over Language: By formalizing the task as a mathematical graph of Knowledge Projections, WebShaper ensures the resulting multi-hop questions are logically watertight and strictly require the intended search steps.
- State-of-the-Art Performance: A Qwen-2.5-72B model trained on WebShaper achieves an average score of 60.19 on GAIA, making it the top open-source model and placing it within striking distance of OpenAI's closed-source Deep Research system (67.4).
- Massive RL Gains: Applying RL on top of SFT yielded a staggering +13.5 point increase on GAIA for the 72B model. Because WebShaper's data is so structurally complex, it acts as the perfect curriculum for RL, yielding massive performance jumps.
- Ablation Success: In head-to-head tests, formalization-driven synthesis consistently beat natural-language-driven synthesis across all tested base models (Qwen-2.5-32B, 72B, and QwQ).
Conclusion
WebShaper demonstrates that a formalization-driven approach to data synthesis can overcome the limitations of traditional information-driven methods. By ensuring logical integrity through set theory and layer-wise expansion, the framework produces high-quality trajectories that significantly enhance the reasoning and strategic navigation capabilities of open-source agents. Future work suggests this approach can be parameterized to push agents beyond human-level complexity in specialized domains.
Summary updated