AI guides

How HarnessMinusMinus saves tokens by optimizing the whole agent workflow

By 蒋玉骅0 viewsSource: 机器之心
HarnessMinusMinus optimizes execution graphs and token use without changing model weights

HarnessMM edits execution graphs and reuses planned actions while keeping model weights fixed. Savings vary by task, model and harness, with offline costs separate.

Microsoft Research Asia and Tsinghua University introduce HarnessMinusMinus (HarnessMM), which studies how agents can complete whole tasks using fewer tokens. It changes execution workflows and rules while keeping the base model’s weights fixed.

An agent completes a task through context organization, model calls, tool execution and feedback. Does shortening the prompt for every call necessarily reduce the tokens used by the whole task?

Consider a history summary. Producing it requires a model call and may be worthwhile if the next ten steps all read that history. But if a change in execution leaves only one more model call, the same summary may not recoup its cost. Two optimizations that each help separately may not save more when combined.

An earlier change alters the costs of later steps. How much context to compress depends on how often it will be reused; whether another model call is needed depends on the path available after tool feedback. How can these interdependent steps be optimized together?

HarnessMM represents the harness as an editable graph, adjusting both the information used at each step and the connections between steps. Candidate edits are evaluated on complete tasks, using task performance and total execution tokens.

Article illustration

Figure 1. First page of the paper’s arXiv PDF.

  • Paper: HarnessMinusMinus: A Technical Report on Efficient Agent Harnesses
  • Paper link: https://arxiv.org/abs/2610.32813
  • Microsoft GitHub repository: https://github.com/microsoft/HarnessMinusMinus

A cheaper step does not necessarily make a cheaper workflow

When optimizing one prompt or summary, execution order and branches are usually treated as fixed. Reducing one call’s cost makes it hard to jointly consider how often that context must be passed later, whether tool results require another model call and which steps remain necessary after a path changes.

Joint adjustment requires explicit connections. The execution graph records what each step does, what information it uses and what conditions must hold before the next step. The optimizer can change the workflow along those dependencies and check whether the combined design completes the whole task with fewer tokens.

HarnessMM optimizes the entire execution graph

An Executable Decision Graph (EDG) has nodes for context preparation, model calls, tools and condition checks. Its edges record sequence, branches and prerequisites.

For example, compilation and testing are separate tool nodes, with testing dependent on successful compilation. The optimizer can alter prompts, context and operations, or add, remove and redirect edges. Required prerequisites remain, and combined changes are assessed as a whole candidate.

Article illustration

Figure 2. HarnessMM execution-graph optimization. RSI combines node and edge edits to change prompts, context and tool control flow. GDR and CCS are two compound graph operations in the operation pool.

Guarded Decision Reuse (GDR) reuses an action already planned. If the model has written a test command, the harness can proceed after receiving a successful compile receipt and checking the current state. New situations still go back to the model.

Certified Callback Substitution (CCS) actually eliminates model requests along that path. It executes the resolved action directly through the native tool interface and associates its receipt with the omitted request. Tools run normally, but the model need not generate the same command again.

For web interaction, graph actions are also bound to the screenshot region from when they were generated. Current pixels and the previous receipt are checked before execution. Filling fields and clicking Submit can proceed sequentially as page feedback arrives; if a page change invalidates the conditions, the model takes over.

RSI searches and selects graph edits. Each round compares the candidate and current harness on the same training tasks, counting failures and fallback calls in the full cost. A candidate is kept only if it meets the performance target while using fewer tokens.

Experiments and analysis

Performance and token costs across six tasks

Validation selects the configuration to freeze, and testing applies those rules to new tasks. Results below use the authors’ specified models, harnesses and protocols; training improvements and test-set results are reported separately.

Across 393 WebArena-Verified tasks, HarnessMM achieves 36.90% success at 44.67 thousand tokens per task. Its aggregate MiniWoB++ result is 64.58% success at 3.98 thousand tokens per task. Figure 3 shows both performance and token cost.

Across 2,133 ALFWorld interaction tasks, HarnessMM raises success from 42.29% to 66.20%, an increase of 23.91 percentage points, while execution cost falls from 34.05 to 31.12 thousand tokens per task.

On 3,395 SearchQA validation questions, exact match rises from 69.81% to 76.76% and cost falls from 1.23 to 0.99 thousand tokens per task. Changes to input processing, task rules and reasoning organization let directly answerable questions take compact paths, calling the model again when further reasoning is needed.

On 160 LiveMath problems, accuracy rises from 19.38% to 29.38% and execution cost falls from 4.10 to 0.83 thousand tokens per task. The 79.8% token reduction is the largest among these six tasks. Revised answer prompts and generation methods make reasoning outputs more compact.

GAIA2 requires repeated tool interaction, with the harness maintaining history and subsequent actions during execution. Across 480 test tasks, success rises from 42.71% to 43.96%, while execution cost falls from 730.22 to 639.64 thousand tokens per task.

Article illustration

Figure 3. Task performance and execution tokens across six tasks. Green rows show HarnessMM; the upper-right labels give token reductions relative to the original harness.

Token reductions for WebArena-Verified, MiniWoB++, ALFWorld, SearchQA, LiveMath and GAIA2 are 28.1%, 29.6%, 8.6%, 19.1%, 79.8% and 12.4%, respectively. Tokens/task (k) measures input plus output tokens per task in thousands.

For WebArena-Verified, the report lists HarnessPro at 34.35% success and 256.45K tokens per task, versus 36.90% and 44.67K for HarnessMM. MiniWoB++ is a different protocol; token costs across the two tasks are not directly comparable.

Twelve comparisons across three models and two coding harnesses

Figure 4 combines three models, two harnesses and two coding tasks for twelve configurations. Execution tokens fall in each, but by very different amounts; the reduction near 90% belongs to a particular configuration.

Article illustration

Figure 4. Twelve coding comparisons on HumanEval and MBPP-sanitized. Three models each run in Codex and DeepSeek harnesses, showing token savings and pass rates before and after integration.

With Qwen3.5-4B, DeepSeek Harness uses 87.9% fewer execution tokens on HumanEval while pass rate rises from 71.43% to 85.71%. On MBPP-sanitized, tokens fall by 80.4% and pass rate rises from 90.27% to 91.83%.

With MiMo-V2.6-Pro, Codex saves 83.9% and 76.9% of execution tokens on HumanEval and MBPP-sanitized, respectively, with pass rates rising to 94.90% and 97.28%. With GPT-5.6 Sol high, both harnesses maintain a 100.00% MBPP-sanitized pass rate, while tokens fall by 22.3% and 24.0%.

DeepSeek Harness with MiMo-V2.6-Pro raises HumanEval pass rate from 96.94% to 97.96% and cuts tokens by 62.1%. On MBPP-sanitized, pass rate rises from 97.67% to 98.05%, with 17.6% fewer tokens.

Success rate and token use over eight optimization rounds

The researchers use Qwen3.5-9B and GPT-5.6 Sol as HarnessMM’s actor models to observe task success and execution cost during RSI.

On 32 MiniWoB++ training tasks, eight RSI rounds raise success from 78.13% to 96.88% and reduce execution cost from 2.97 to 1.46 thousand tokens per task. A separate training experiment with GPT-5.6 Sol raises success from 92.50% to 93.13%, with 47.39% fewer tokens.

Article illustration

Figure 5. Retained harnesses over eight RSI rounds: Qwen3.5-9B on the left and GPT-5.6 Sol on the right, with success rates above and thousands of tokens per task below.

In Figure 5, success improves in the early rounds and then stabilizes while execution cost keeps falling. Each retained graph becomes the starting point for the next round, with prompts, context and tool control flow remaining editable.

Read savings in the context of tasks and configurations

The central idea is whole-task optimization: whether a prior decision can be reused safely, or context compression is worthwhile, depends on the later execution path. A token reduction is not an equal reduction in total expense; offline optimization, validation, tool use and deployment costs remain separate.

This article is based on Yuhua Jiang’s research introduction in Jiqizhixin. The authors are from Tsinghua University and Microsoft Research Asia. Results are author-reported; AINRK has not run the code or independently reproduced them.

Related topics

After reading

Join the AINRK community

Read how to join the community and connect with people working in AI.

Community information (opens in a new tab)