AI Agents That Optimize Their Own Harness

x32x01
  • by x32x01 ||
What if an AI agent could improve the software layer that runs the agent itself?
When developers want to reduce the cost of an AI agent, the obvious move is to use a cheaper model. But recent research from NVIDIA, NTU, and MIT explores a different idea:
A large part of an agent's cost may come from the software around the model-not the model itself.
The approach, called SoL-Pi, focuses on automatically optimizing the Agent Harness that connects an AI agent to its tools, memory, files, commands, and environment.



What Is an Agent Harness?​

A coding agent does much more than generate text.
It may need to:
  • Read and modify files
  • Run commands
  • Execute tests
  • Call external tools
  • Manage memory
  • Process logs
  • Maintain context
  • Communicate with its environment
All of these operations happen through the Agent Harness.
Traditionally, humans optimize this layer by studying long logs, finding inefficient operations, changing the code, and testing the results.
SoL-Pi takes a different approach.
Instead of having humans optimize the harness manually, the AI itself helps optimize the harness.
The system observes how the agent works, proposes changes, tests them, and keeps changes that reduce cost and token usage without hurting result quality.



How SoL-Pi Reduces AI Agent Costs​

The research explored around 150 optimization directions across roughly 500 environments, with more than 3,000 runs and over 60,000 agent-environment interactions.
Four ideas ultimately remained.

1. Combine Multiple Steps Into One Tool Call​

Instead of having the agent modify a file and then make another tool call to run a test, related operations can sometimes be executed together.
This reduces unnecessary tool interactions and can lower token usage.

2. Compress Memory After a Subtask Ends​

Agents can accumulate a large amount of information during a task.
SoL-Pi can compress memory when a subtask is finished instead of keeping every detail indefinitely.
However, the system does not compress memory blindly.
If keeping the information costs less than compressing it, the memory is left unchanged.

3. Avoid Sending Huge Tool Outputs Every Time​

Large tool outputs can consume a significant amount of context.
The approach can provide the full output initially and then replace it with a small excerpt of around 1 KB, together with a handle that allows the agent to retrieve the complete information when needed.
In simple terms:
Don't send everything unless the agent actually needs everything.

4. Use a Cheaper Model to Summarize Logs​

Build and test logs can become extremely large.
Instead of making the main agent process all of them, a cheaper model can summarize the logs.
A verifier then checks whether the summary removed any important evidence.
If critical information is missing, the summary is rejected.
This makes the optimization more interesting because the system is not simply replacing an expensive model with a cheaper one. It is changing how information moves through the agent.



The Model Was Not Changed​

This is one of the most important parts of the approach.
SoL-Pi does not improve the underlying LLM itself.
There is:
  • No change to the model weights
  • No retraining
  • No new model
Instead, the optimization happens in the software layer surrounding the model.
That means the same underlying model can potentially become more efficient simply by changing how the agent interacts with tools, memory, context, and its environment.



Reported Results​

On the EdgeBench benchmark, which contains 51 tasks, the research reports a reduction in token traffic of approximately 44.7% - 49%, along with an API cost reduction of about one-third compared with Pi.
The researchers also reported cost reductions of approximately:
ComparisonReported Cost ReductionBaseline Performance
Codex on GPT-5.6 Sol~50%~94%
Claude Code on Opus 554.3%~94%
These figures are reported by the researchers and depend on the benchmark and evaluation setup.



The Harness Can Transfer Across Models​

Another interesting result is that the harness was built using GPT-5.6 Sol.
The same harness was then run on Opus 5 without changing it, while still using approximately 44.7% fewer tokens.
That suggests the optimization is not necessarily tied to a single model.
The efficiency gains can come from improving the way the agent operates rather than changing the model itself.



Why This Matters for AI Agents​

AI agents don't consume tokens only when they "think."
They can also consume tokens through:
  • Tool calls
  • Memory
  • Context
  • Logs
  • File operations
  • Command execution
  • Communication with the environment
If these layers become more efficient, an agent can potentially become cheaper without requiring a more efficient underlying model.
This changes the way we can think about AI agent optimization.
Instead of asking only:
"How can we build a smarter model?"
We can also ask:
"How can we build a smarter harness around the model?"



The More Interesting Next Step​

The research points toward an even more interesting feedback loop.
The optimized, cheaper harness can be used to perform the next stage of research.
In other words:
A cheaper agent → searches for a cheaper harness → which helps fund and enable research into an even cheaper harness.
That creates the possibility of a continuous optimization loop.
Instead of improving an AI agent only through manual engineering, the process could increasingly involve agents that help discover better ways to run agents.
And that may become an important direction for reducing the cost of AI agents without constantly changing the underlying models.



Frequently Asked Questions​

-----------------

What is SoL-Pi?​

SoL-Pi is an approach described in research from NVIDIA, NTU, and MIT that focuses on automatically optimizing the software harness surrounding an AI agent to reduce token usage and cost while maintaining result quality.

What is an Agent Harness?​

An Agent Harness is the software layer that manages how an AI agent interacts with tools, files, commands, memory, context, logs, and its environment.

Does SoL-Pi retrain the AI model?​

No. The approach described here focuses on optimizing the software around the model rather than changing its weights or retraining the model.

How does SoL-Pi reduce token usage?​

The approach includes combining related tool operations, compressing completed-task memory, avoiding repeated transmission of large tool outputs, and using cheaper models to summarize large logs with verification.

Why is optimizing the harness important?​

Because an AI agent can spend tokens not only on model reasoning, but also on tool calls, memory, context, logs, file operations, and communication with its environment. Making these operations more efficient can reduce overall cost.
 
Similar threads
x32x01
Replies
0
Views
4
x32x01
x32x01
x32x01
Replies
0
Views
3
x32x01
x32x01
x32x01
Replies
0
Views
6
x32x01
x32x01
x32x01
Replies
0
Views
46
x32x01
x32x01
x32x01
Replies
0
Views
29
x32x01
x32x01
x32x01
Replies
0
Views
60
x32x01
x32x01
x32x01
Replies
0
Views
101
x32x01
x32x01
x32x01
Replies
0
Views
86
x32x01
x32x01
x32x01
Replies
0
Views
94
x32x01
x32x01
x32x01
Replies
0
Views
32
x32x01
x32x01
Forum Statistics
Threads
1,076
Messages
1,081
Members
16
Latest Member
b_a_s_m_a_l_a7
Back
Top