ResearchHot

Hugging Face Tuned a 27B Model Inside Three Agent Harnesses and Got 39% to 55%

Freeze the model, train a small adapter inside the agent you actually run, and one command-line benchmark gains 16 points while the token count nearly halves. Hugging Face published the recipe, the artifacts and the caveats in the same post.

Emily CarterEmily Carter
Heat: 1,180
A harness ring with an adapter chip plugged into it, beside paired bars rising to the right

Freeze the model, train a small adapter inside the agent you actually run, and one command-line benchmark gains 16 points while the token count nearly halves. Hugging Face published the recipe, the artifacts and the caveats in the same post.

What Hugging Face trained on Qwen3.8-27B

The setup matters more than the headline. Take Qwen3.8-27B, leave every weight untouched, and train only a lora adapter against reinforcement learning inside the agent loop you plan to ship. That's the whole idea, and the numbers attached to it are the reason people are reading the post.

With the pi agent in charge, Terminal-Bench 2.1 moved from 39% to 55% pass@1. Average tokens per task fell from roughly 2.9K to 1.5K over the same runs. Better answers, less text.

Terminal-Bench is a benchmark built from real command-line jobs, so a 16-point jump isn't a formatting win. It means the model finished more of the work.

Why training inside the agent changes what a model can do

A model trained for general use is tuned for average performance across many different agent runtimes, and average is exactly what you don't want. Your runtime has its own tool names, its own error messages and its own idea of when to stop. The model spends part of every task learning that shape from scratch.

Training inside the agent it will run in, on tasks from your own distribution, teaches a narrower set of habits. Reason less before acting. Call fewer tools. Get the file right the first time. Hugging Face trained three separate adapters for Qwen3.8-27B, one each for pi, Hermes Agent and OpenCode.

How Hugging Face records tokens from the real agent

Most RL frameworks for agents train a reimplementation of the agent loop. That's easier to instrument, and it quietly drifts from the thing you deploy. Here the agent runs exactly as it ships, unchanged.

A proxy sits between the agent and vLLM and records the exact tokens it produced. The trainer learns from those tokens. Nothing is replayed through a lookalike loop, so the policy that gets trained is the policy users will run.

The plumbing is on the Hub too: datasets, training and rollouts ran in Jobs with TRL's AsyncGRPOTrainer, OpenEnv and Harbor. Pinned versions in the final images were Pi 1.5.2, OpenCode 2.2.7 and Hermes Agent v0.22.6.

The task pipeline behind the hugging face rl run

The benchmark is only as honest as the tasks, so the filtering deserves a paragraph. A Hub search for Harbor environments returned about 59,000 tasks. Those were cut down to two training sources, SWE-smith and SWE-Gym by way of TaskTrove, plus tasks generated by Tasksmith.

Then the funnel tightened. Of 1,127 candidates, 858 passed the openenv validate checks. A difficulty pass scored 442 of them, and Qwen3.8-27B solved 151 every time and 120 never, which left 171 tasks in the useful middle where a model sometimes succeeds. The final dataset, harness-hub/agentic-coding-envs, holds 871 tasks drawn from 35 repositories.

That last step is the one most published results skip. Tasks the base model always solves teach nothing, and tasks it never solves give noisy rewards.

Three specialists on the hardest SWE-bench Pro tasks

Each adapter was tested under its own agent, on the 51 hardest SWE-bench Pro tasks, which are drawn from real pull requests rather than synthetic prompts.

| Agent | Base pass@1 | With its adapter | | pi | 39.2% | 64.7% | | Hermes Agent | 29.4% | 43.1% | | OpenCode | 35.3% | 51.0% |

On the full Terminal-Bench 2.1, pi gained 16.3 points and Hermes 14.1. Every specialist beat the base model under its own setup on both benchmarks.

The merged super-adapter and its terminal-bench caveat

Nobody wants to ship three adapters, so the team merged them along the rank dimension into a single super-adapter of rank 96, scaling each update to one half. So what did the merge actually buy? That's the version most readers will actually consider.

With thinking turned off, it improved all six agent-benchmark pairs. Mean pass@1 went from 39.5% to 49.0%, with 71 tasks newly solved against 34 lost, a gap the authors put at p < 0.001. On tasks both versions solve, it makes 53 to 73% fewer tool calls and generates 44 to 60% fewer tokens per task.

One honest wrinkle. The one-half merge weight was chosen on Terminal-Bench 2.1 using step-120 adapters, so those particular numbers are slightly optimistic. If you care about a different benchmark, tune the weight there and expect a different optimum.

Where the harness adapters stop working

Two limits are worth carrying into any conversation about this result. The first is out-of-distribution behaviour. On 300 AutomationBench tasks, which use a different agent loop, the adapters stayed close to the base model's 23.0% pass@1: pi at 27.0%, OpenCode 25.3%, the merged adapter 23.7% and Hermes behind at 17.7%.

That's a small gain for pi, noise for the merge, and a loss for Hermes. Gains don't transfer cleanly to an agent harness you didn't train in.

The second is an open question the authors raise themselves. In non-thinking mode the adapters tend to write a short line of text before a tool call, which looks like reasoning leaking out of a mode that's supposed to skip it. They call it possible leakage and say it needs follow-up work. Nobody has explained it yet.

Scale is the third thing to keep in view. Training ran for 598 cumulative steps, 78,114 samples and 167M trained tokens, on multi-GPU jobs the post describes as H200s without publishing a total bill. If you rent H200 hours by the day in Frankfurt or Virginia, that's a real cost line.

No published total.

What to copy from the hugging face rl recipe

Copy the method, not the number. Measure your own agent loop first, because the gap between the base model and a tuned adapter depends on how unusual your tool names and error paths are.

The artifacts are public, including the adapters and the filtered dataset, so a small team can test the claim on a narrow task set before committing GPU hours. Start with one agent, one task family and the same difficulty filter, and see whether your base model solves a task sometimes rather than always.

If it does, an adapter is worth training. If it doesn't, the problem is your task set, and no amount of reinforcement learning will fix that.

Share This Story

Sources

Related AI News

Concentric spiral curves crossed by a vertical line with bright points pinned along it
Research

An Anthropic Researcher Says Claude Proved the Riemann Hypothesis. Stanford Answered Within Hours

A researcher says he and Claude produced a proof of the hardest problem in mathematics, and the code compiles. Verification is a different job, and it has barely started.

Heat: 1,860
A stack of agent nodes linked by a path to a server rack, with a keyhole and a breach mark on the rack
Research

An AI Agent Found a Zero-Day and Owned a University Server in 11 Minutes

An operator gave the agents one goal and no method. They found an undocumented flaw in medical imaging software and owned the server, after 148 failed actions somewhere else.

Heat: 1,520
A funnel carrying small token blocks from one model box to another, with a shield plate blocking part of the flow
Research

OpenAI Cut Reasoning Theft From 54% to 0.2%. The Rest Is an Industry Problem.

OpenAI published the before-and-after numbers for its latest safeguards and they look like a fix. The same post explains why the fix has to be repeated every week, by everyone.

Heat: 1,420
A green chip grid with one highlighted cell and a jagged signal line beside the words Blackwell fingerprints
Research

Blackwell fingerprints in six Chinese models: what a checkpoint can prove

Dek: PyTorch fills billions of empty weights with random numbers, and the GPU doing the filling leaves a mark in the finished file. Someone checked six Chinese checkpoints and found newer silicon than the rules allow.

Heat: 1,250