SwarmResearch: Orchestrating Coding Agents for Open-Ended Discovery

Yuvraj Virk, Zack Edds, Chunqiu Steven Xia, Lingming ZhangarXiv 2026

TL;DR

SWARMRESEARCH is a novel multi-agent framework designed to prevent AI coding agents from prematurely converging on suboptimal solutions during open-ended optimization tasks. By separating global strategy (managed by a "Shepherd" agent) from local execution (carried out by "Search" agents in isolated git branches), it enables broader architectural exploration and outperforms state-of-the-art LLM-guided evolution and multi-agent baselines on 13 out of 15 complex benchmarks.

What Problem Does This Paper Address?

Long-running AI coding agents (like Karpathy’s autoresearch) show immense promise in autonomously optimizing code. However, they suffer from a major flaw: they tend to quickly settle on a single high-level approach and spend the rest of their compute budget making minor, low-level tweaks.

The authors identify two core harness-level design flaws causing this "greedy local search" behavior:

  1. Context Accumulation: As an agent iterates, its conversation history grows. This long history anchors the LLM, making it highly unlikely to pivot to a completely new, radical approach.
  2. Single Program State: Traditional agent loops overwrite or revert code on a single branch. They lack a mechanism to preserve and independently evolve alternative, competing ideas.

Methods

SWARMRESEARCH introduces an orchestrator-subagent architecture that treats the optimization space like a branching tree, managed natively via Git.

Figure 2: Overview of SWARMRESEARCH. Implements an orchestrator-subagent loop: (1) Shepherd Agent spawns concurrent search agents with 3 per-agent steering mechanisms: selecting a parent solution by setting up its git branch, writing a prompt to share minimal context, and selecting the Search Agent type. (2) Search Agents ideate, implement, evaluate, and iterate on a solution. Explorer Search Agents have fresh context windows so they’re unanchored to prior work, while Optimizer Search Agents fork their parent’s conversation history to continue along its detailed history of attempts. The Shepherd Agent receives summaries back from all Search Agents to strategically steer new ones.

The framework splits responsibilities between two agent roles:

  • The Shepherd Agent (Orchestrator): Maintains global context over all attempts and scores. It strategically steers the population by deciding which parent solutions to build upon, adjusting the balance of parallel vs. serial execution, and providing minimal, non-prescriptive prompts to subagents.
  • Search Agents (Subagents): Operate with strictly local context inside isolated git branches and worktrees. They are divided into two types:
  • Explorer Agents: Spawned with fresh context windows. Being unanchored to prior conversation histories, they are free to attempt major, high-level code rewrites.
  • Optimizer Agents: Inherit their parent's conversation history to perform deep, serial refinement on a promising approach.

Before completing a run, each Search Agent appends a concise summary of its findings to a local findings.md file, providing a lightweight history for future descendants without cluttering their active context windows.

Datasets

The authors evaluated SWARMRESEARCH across 15 open-ended optimization tasks spanning three distinct domains:

  1. Mathematics: 5 tasks requiring optimization programs to find new mathematical bounds (e.g., Circle Packing, Signal Processing).
  2. Systems Engineering: 5 tasks from the ADRS benchmark, which mimics real-world systems research (e.g., Transaction Scheduling, LLM-SQL).
  3. Heuristic Algorithms: 5 competitive programming tasks from ALE-Bench-Lite (derived from the AtCoder Heuristics Contest), which heavily reward creative, problem-specific human-like algorithms over simple hyperparameter tuning.

Additionally, they conducted an extensive case study on Approximate Speculative Decoding using 100 reasoning-intensive tasks drawn from LiveCodeBench v6, AIME 2026, GPQA Diamond, and HLE-MCQ.

Key Insights and Ideas

  • Context Isolation Preserves Diversity: Forcing Explorer agents to start with a blank slate (fresh context) effectively unanchors them from previous failures or biases, encouraging them to try entirely different algorithmic families.
  • Git as a Natural Search Tree: Utilizing native git branches allows the framework to naturally maintain competing implementation states. Promising but temporarily lower-performing solutions are preserved rather than discarded.
  • Dynamic Test-Time Scaling: Rather than using a fixed number of parallel agents or serial steps, the Shepherd agent dynamically adapts the search "width" (parallel exploration) and "depth" (serial optimization) based on current progress, outperforming optimal fixed-scaling baselines.

Key Results

SWARMRESEARCH matched or exceeded state-of-the-art baselines (EvoX and CORAL) on 13 out of 15 tasks.

Crucially, the framework achieved this through higher-level exploration. As shown below, SWARMRESEARCH typically made significantly larger code modifications—changing a median of 3.2× more lines of code than CORAL and 1.7× more than EvoX.

Median lines of code changed per attempt across different tasks, demonstrating that SWARMRESEARCH engages in larger, higher-level rewrites.

In the speculative decoding case study, SWARMRESEARCH successfully discovered a complex combination of continuous batching, independent RNG streams, and adaptive MoE expert-count pruning. It achieved a 4.58× speedup over vanilla decoding, vastly outperforming vanilla autoresearch (1.80×) and CORAL (2.26×).

Figure 1: SWARMRESEARCH designs speculative decoding implementations. Nodes represent spawned search agents and their solutions. Edges indicate the lower node builds on the solution above. The top node value shows spawn order; the bottom value shows speedup over vanilla decoding. SWARMRESEARCH explores diverse approaches over ∼11 hours without converging onto any one approach. On 100 held-out reasoning-intensive tasks (averaged across 5 seeds), SWARMRESEARCH’s achieved mean tok/s is 4.58× faster than naive vanilla decoding. After ∼12 hours, vanilla autoresearch’s (Karpathy, 2026) speedup is only 1.80× while CORAL’s (Qu et al., 2026) is 2.26×. All methods use Opus 4.8 Claude Code. Details are in Section 4.

Limitations and Future Work

While SWARMRESEARCH excels at exploring the solution space, it does not enhance the fundamental creativity of the underlying LLM; the agents still tend to explore variations of known techniques rather than inventing entirely novel paradigms.

Furthermore, the Shepherd Agent's steering behavior remains highly prompt-reliant. In testing, the orchestrator occasionally struggled to synthesize abstract bottlenecks into strategic prompts without accidentally prescribing specific solutions, indicating that training LLMs specifically for search orchestration is a promising direction for future work.

Summary updated

BibTeX
@misc{virk2026swarmresearch,
  author = {Yuvraj Virk and Zack Edds and Chunqiu Steven Xia and Lingming Zhang},
  title = {{SwarmResearch: Orchestrating Coding Agents for Open-Ended Discovery}},
  year = {2026},
  eprint = {2607.02807},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2607.02807},
}
Figure