Microsoft Research's Fork-and-Flush Boosts Coding Agents 66% by Escaping Idea Traps
Microsoft Research shows that autonomous research agents get stuck in 'idea basins,' and a simple context-flush intervention lifts scores 66% over single runs.
Takeaways
- Microsoft Research finds autonomous agents on the same task plateau at wildly different scores and stay stuck in localized idea basins.
- Fork-and-flush periodically spawns parallel branches that keep the workspace but wipe chat context, then continues from the best.
- Across 13 long-horizon tasks it beats single-run by 66% and best-of-4 by 44.4% relative on normalized score.
- Flush and fork each help alone (0.55 and 0.57), but combined reach 0.71 — mechanisms are complementary.
- Variance peaks at the capability frontier, so scaling models won't eliminate the problem on harder tasks.
- Fails on narrow-optimum tasks like LWE-rec and LLM-SQL where exploration hurts; needs a verifiable grader.
Long-running coding agents can start from identical conditions and finish with sharply different scores. A Microsoft Research paper attributes that variance to idea basins, regions where an agent repeatedly refines one strategy instead of exploring alternatives. Its proposed remedy, fork-and-flush, periodically branches the run and clears its conversational history while preserving its files. Across 13 research and engineering tasks, the authors report relative gains of 66.0% over a single run and 44.4% over best-of-N sampling under equal compute, using min-max normalization to compare tasks with different scoring scales.
Why identical runs diverge
Autoresearch agents perform iterative local search: they modify code, run an evaluator, inspect the score, and choose the next change. Model sampling and tool interactions send otherwise identical runs along different trajectories. Because each new decision builds on earlier reasoning and artifacts, a run can spend hours refining an approach that has limited potential.
On the AtCoder-style p171 task, the researchers launched eight agents with the same model and initial state. Their best final scores ranged from 68.3 to 100.0. Several runs plateaued at substantially different levels, and additional compute failed to close the gaps.
To determine whether those runs were following different strategies, the researchers mapped their artifacts by approach. An LLM received triplets consisting of an anchor submission and two candidates, then judged which candidate was more similar to the anchor. Before comparison, each submission was rewritten as a canonical functional specification to reduce the influence of shared boilerplate. An optimization step placed the submissions on a two-dimensional map that preserved the LLM’s relative similarity judgments.
Artifacts from each run clustered tightly in one region, while independent runs occupied different regions and continued refining there. The paper calls these clusters idea basins: locally coherent families of solutions that can produce persistently different scores.