Tsinghua and Microsoft paper cuts agent token use with HarnessMM
Skipping the LLM call when the next step is already determined turns agent loops into conditional scripts, cutting both cost and latency without hurting accuracy. Developers building write-build-test workflows can adopt the pattern by having the model plan commands once with verifiable pass conditions. The gains on DeepSeek Harness suggest smaller or cheaper models benefit most from reduced round-trips.
A paper from Tsinghua and Microsoft introduces HarnessMM, a method that lets an agent pre-plan future commands with exact arguments plus pass checks. When a tool result passes the check, the agent executes the command directly and skips the LLM call. On 98 HumanEval tasks, Codex kept its 90.82% success rate while using 29.54% fewer tokens than plain Codex. DeepSeek Harness improved from 71.43% to 85.71% success and used 87.93% fewer tokens than its original version.
New Tsinghua and Microsoft paper finds that DeepSeek Harness used 87.93% fewer tokens than its original version on 98 HumanEval tasks while success rose from 71.43% to 85.71%.
Agent tools like Codex and DeepSeek Harness call the LLM after each tool result to choose the next step. Often that step was already decided, like running tests once the code compiles.
HarnessMM lets the model write future commands with exact arguments, plus a check for each, such as a successful build. When a tool result passes the check, the agent runs the command and skips the LLM call.
On 98 HumanEval tasks, Codex kept its 90.82% success while using 29.54% fewer tokens than plain Codex. DeepSeek Harness rose from 71.43% to 85.71% success and used 87.93% fewer tokens than the original.
If your agent runs predictable chains like write, build, test, have the model plan them once with pass checks instead of re-asking each step.