Nvidia's SoL-Pi system cuts coding agent token usage nearly in half by optimizing the harness
A new Nvidia paper describes a system that automatically optimizes the control layer of coding agents, known as the harness. Token usage drops by almost half while performance stays roughly the same, according to the researchers.
The longer AI agents work unsupervised, the more expensive they get. Single predictions turn into long chains of reasoning, tool calls, and feedback loops, and token usage balloons along the way.
A new study from Nvidia researchers tackles these costs not at the model level but at the harness , the control layer between the model and its environment used by systems like Codex, Claude Code, or OpenClaw.
The harness controls how an agent sees states, runs actions, and processes feedback. Most efficiency methods so far have focused on cutting the cost per token through faster attention kernels and serving infrastructure, model compression like quantization, or swapping in cheaper models.
AI explores 152 directions to find leaner control logic
Optimizing the harness is hard in practice because tool usage, context management, verification, and abort logic are all tightly coupled. A change that saves tokens in one place can trigger errors elsewhere or just push costs into a later phase. Typically, humans sift through long execution traces and translate recurring failure patterns into code.
The system, called SoL-Pi, automates that work. A research agent watches another agent's traces, proposes changes, and tests them in prepared environments. Capability and efficiency checks determine which candidates survive. The approach draws on recursive self-improvement , according to the authors.
Across 535 executable environments, the system explored 152 directions, including 495 tasks derived from GitHub issue-pull-request pairs and 40 synthetic test cases. In total, the process generated more than 3,000 runs and over 60,000 agent-environment interactions. According to the researchers, this scale shows how broadly the system searched, but more search doesn't automatically yield better results. That's a risk here, because earlier work showed that automatically optimized harnesses tend to overfit to their training tasks and offer little benefit on unfamiliar ones.
SoL-Pi addresses this by strictly separating search feedback from evaluation. The researchers used EdgeBench as their test benchmark and walled it off from the search process entirely. Of its 51 public tasks, they used 11 for one-time validation of finished candidates. The remaining 40 were reserved for final evaluation, and those results never fed back into the search.
Four mechanisms that eliminate wasted work
The search produced four mechanisms. Action Fusion merges two consecutive steps into one, such as a code edit followed by a test run, which eliminates an entire language model call. Online Context Compact runs after each planning step and trims accumulated context whenever it can do so without losing important information.
ObservationPack archives long tool outputs and drops in a short summary on later steps rather than resending the full text each time. The Evidence-Preserving Reducer routes large error and test logs to a cheaper model that boils them down to the key findings, with an automatic verification step catching any critical clues that slip through.
On EdgeBench's 51 public tasks, SoL-Pi performs about as well as the original Pi harness, according to the researchers. How much token usage drops depends on the configuration. The most efficient variant combines all four mechanisms, uses 49 percent fewer tokens, and reaches 93.7 percent of Pi's score. Users who prioritize performance and pick only the strongest single mechanism beat Pi's score by 5.3 percent while still saving tokens. Across both variants, token usage drops by 44.7 to 49 percent.
In dollar terms, the authors estimate savings of $8.75 to $13.50 per hour compared to native Codex and Claude Code harnesses, and $4.36 to $5.71 per hour compared to Pi, based on current API prices.
The researchers built the system with GPT-5.6 Sol only and then applied it to Opus 5 without any changes. There, it retained 94.3 percent of Pi's performance with similar savings. But the mechanisms triggered less often and less aggressively under Opus 5, which the researchers attribute to the harness being optimized solely on GPT-5.6 Sol trajectories.
Results get messier on other benchmarks
Beyond EdgeBench, the picture is more mixed. On 63 CPU tasks from Terminal-Bench 4, SoL-Pi solves only 15 tasks while Codex and Pi each solve 18. Total costs still came in about a quarter lower than Pi's.
On the formally verified Lean 4 tasks from the 2026 Math Olympiad (IMO 2026), the system cracked three of six problems at the lowest cost per solved problem. In a kernel optimization experiment, a swarm of 20 SoL-Pi workers cut costs by 26.8 percent compared to a comparable Pi swarm.
The efficiency gains come with trade-offs, because shorter context can reduce prompt cache reuse. Total costs in one test run still dropped from $1,339 to $894. Looking ahead, the authors suggest pretraining the harness across many tasks, similar to how models are pretrained, and using an already lean harness to make searching for its successor cheaper. They call this recursive efficiency improvement a vision, not a finding from the current study.
How much the harness shapes an agent's costs became clear in an August test by tooling company Composio, which ran Deepseek V4 Flash across four agent frameworks including Claude Code and the Pi-based Oh My Pi. The cost per solved task varied by nearly 3x even though the same model was doing the work.
The pricing and optimization pressure keeps growing because agents consume ever more tokens. According to OpenRouter analyst Peter Walker, agentic token usage has grown 14x since February 2026 , and nearly 70 percent of that comes from cached prompts.
Context compression of the kind SoL-Pi uses can have side effects, though. One study found that compression preserves only 17 percent of user instructions on average . Parallel agents drive up costs too. Codex developer Eric Provencher recently warned that more than two sub-agents almost always burn tokens without improving quality, since they spend most of their time checking each other's work.
AI News Without the Hype – Curated by Humans
Subscribe to THE DECODER for ad-free reading, a weekly AI newsletter, our exclusive "AI Radar" frontier report six times a year, full archive access, and access to our comment section.
Read on for the full picture. Subscribe for hype-free coverage.
Full access to every article on THE DECODER
Join the comments and community discussions
A weekly AI news recap via mail
6x/year: "AI Radar" — deep dives on the AI topics that matter most
Daily AI news, always up to date
Covered by a team with 10+ years in AI