Microsoft Research's Fork-and-Flush wipes chat context to unstick AI agents

Microsoft Research's Fork-and-Flush wipes chat context to unstick AI agents

A Microsoft Research study finds that long-running AI research agents can plateau even when given more compute. The researchers say accumulated conversation context can constrain an agent's search, keeping it focused on similar solutions instead of exploring better approaches. They studied what they call "Autoresearch agents": AI systems that repeatedly propose solutions, evaluate them, and refine them based on feedback.

The starting observation is a spread between identical runs. Eight independent runs of the same agent on the same task plateaued at significantly different performance levels, with final scores ranging from 68.3 to 100.0. According to the paper, those gaps persisted even with substantially more compute.

To see why, the researchers plotted solutions from all runs on a two-dimensional map that places similar solutions close together. Solutions from a single run almost always stayed within a small region of that map. The authors call these regions "idea basins." Agents spend a large share of their remaining compute budget refining solutions inside a less productive basin instead of finding the better approaches that other runs discovered. The pattern persists even when the agents periodically compress their conversation histories.

The proposed fix, "Fork-and-Flush," combines two mechanisms. In "forking," the agent splits into K parallel branches, each inheriting the previous workspace and all generated files. In "flushing," each branch loses its entire chat context but keeps the workspace, so it starts a fresh conversation and builds on prior work. A branch that keeps the parent's chat context tends to return to the same idea basin because the previous reasoning steers its next steps; fresh context restores diversity in the search. The conversation history is gone, but the code, files and saved results remain.

The team tested the method on 13 long-running tasks, including polyomino packing, job-shop scheduling, cryptanalysis, compressing a CIFAR classifier and optimizing a VLIW kernel. Individual runs lasted from several hours to over 100 hours. The agents used GPT-5.6-terra and GPT-5.5 through the GitHub Copilot CLI.

On the same compute budget, Fork-and-Flush reached a min-max-normalized average score of 0.78, against 0.47 for single runs and 0.54 for best-of-4. The paper reports relative gains of 66.0 and 44.4 percent, respectively. The method had the highest mean score on 12 of the 13 tasks. Results were also more consistent: normalized standard deviation fell to 0.16 from 0.26 for single runs. Simply clearing the chat context without branching improved results by 22 percent.

The researchers also asked whether more capable models avoid idea basins. Using MAX-3-SAT problems across three model sizes, Qwen3.5-4B, 9B and 27B, they found that variance between runs followed an inverted U-shaped curve. It peaked on tasks at the edge of a model's abilities, roughly halfway between random-guessing performance and the reference solver's performance. The authors argue that open research problems sit, by definition, at the limits of models' abilities, and they expect the variation Fork-and-Flush exploits to persist as models improve, with the boundary shifting toward harder problems. The results suggest that regular context resets could remain useful even for frontier research agents.

Key facts

  • Eight independent runs of the same agent on the same task plateaued at final scores from 68.3 to 100.0, and the gaps persisted with substantially more compute.
  • Solutions from a single run almost always stayed in a small region of a two-dimensional solution map, which the authors call an "idea basin".
  • Fork-and-Flush splits the agent into K parallel branches that keep the workspace and files but lose their entire chat context.
  • On 13 long-running tasks at the same compute budget, it scored 0.78 normalized average versus 0.47 for single runs and 0.54 for best-of-4, and had the highest mean on 12 of the 13 tasks.
  • Clearing the chat context alone, without branching, improved results by 22 percent.

Why it matters

Throwing more compute at a long-running agent does not reliably fix a stalled run. The study's explanation is that the agent's own accumulated chat context keeps pulling it back toward the same family of solutions, and that compressing the history does not break the pattern. The fix it proposes is cheap in concept: split the run and wipe the conversation, not the work. At the same compute budget, that lifted the normalized average score from 0.47 for single runs to 0.78, a 66.0 percent relative gain by the paper's account.

Who it affects

Anyone building or running agents that work on one problem for hours or days: teams using coding and research agents on optimization, scheduling, cryptanalysis or model-compression style tasks, like those in the study. It also bears on how such agents are evaluated, since eight runs of one agent on one task landed anywhere from 68.3 to 100.0, so a single run can say little about what the agent can do.

How to use it

The source describes a method, not a product. The recipe is in the paper's description: fork the agent into K parallel branches that inherit the workspace and generated files, then discard each branch's chat context so it starts a fresh conversation. The approach depends on progress living in the workspace (code, files, saved results) rather than in the conversation. The source does not give the value of K used in the experiments, and it states no deployment of the method in any Microsoft product.

How solid is it

The findings come from a Microsoft Research study of 13 long-running tasks, with the agents running GPT-5.6-terra and GPT-5.5 through the GitHub Copilot CLI. The headline comparison is at the same compute budget, and the method had the highest mean score on 12 of the 13 tasks. The source does not say the paper is peer-reviewed, does not give the paper's title or authors, and does not name the one task where Fork-and-Flush did not come out on top or give per-task scores. It also does not state whether the 22 percent gain from clearing context alone is absolute or relative to single runs.

Risks and caveats

The 0.78, 0.47 and 0.54 figures are min-max-normalized averages over a specific set of 13 tasks and two models, so they do not translate directly into gains on other work. The claim that context resets stay useful for stronger models is the authors' expectation, backed by MAX-3-SAT tests on Qwen3.5-4B, 9B and 27B, not by a test on frontier models. The variance in those tests peaked at the edge of a model's abilities, so the benefit may be smaller on tasks that are either well within or far beyond what a model can do. A branch that keeps the parent's context only "tends to" return to the same basin, so the mechanism is a tendency, not a rule.

“A branch that keeps the parent process's chat context tends to return to the same idea basin because the previous reasoning steers its next steps.”

— The Decoder, summarizing the Microsoft Research study