AI-generated text
Harness-specific adapters improve coding model performance and efficiency
Research · November 20, 2026

Researchers trained reinforcement-learning adapters for Qwen3.8-27B inside three agent harnesses, improving coding benchmark scores while reducing tool use.
In this article · 5
Harness-specific adapters for the Qwen3.8-27B language model improved its success rate on software engineering tasks while reducing the number of tool calls it made. The method uses reinforcement learning to adapt the model's behavior to a particular agent harness and task distribution while leaving its underlying weights unchanged.
The researchers trained three separate LoRA adapters for the Pi, Hermes Agent and OpenCode harnesses, then merged them into one adapter usable across all three. In the initial example, the base model scored 39% on Terminal-Bench 2.1 under Pi, using an average of 2,900 tokens per task; with the adapter, its success rate rose to 55% and token use fell to 1,500.
Training inside the deployed harness
The researchers extended earlier work on data analysis and code-building tasks to a 27-billion-parameter model and harder software engineering problems. Training used the same harnesses intended for final deployment: Pi 1.5.2, OpenCode 2.2.7 and Hermes Agent v0.22.6.
Many reinforcement-learning frameworks train against their own reimplementation of an agent loop. Here, the harnesses ran as shipped, while a proxy recorded the tokens they actually produced for the trainer. The process relied on the Harbor integration with OpenEnv and TRL's AsyncGRPOTrainer. The latter can start another optimization step without waiting for every task rollout to finish.
Building and checking the tasks
Training required tasks whose solutions could be verified and that were neither consistently too easy nor consistently too hard for the base model. The researchers assembled tasks from three sources: bugs injected into Python and Go repositories by SWE-smith, real GitHub issues from SWE-Gym, and examples generated from merged pull requests by the Tasksmith pipeline in Repo2RLEnv.
Tasksmith was used to target skills including HTTP streaming, filesystem operations and serialization. From 30 merged pull requests, it produced 24 tasks across ten Python repositories that passed its own checks.
Filtering excluded duplicates, tasks not intended for training, the 253 tasks in the target benchmarks and examples from repositories used by those benchmarks. OpenEnv checks tested whether a reference solution received maximum reward, doing nothing scored lower, known-wrong controls were rejected and results were reproducible. Of 1,127 Hub candidates, 858 passed validation. Most failures were infrastructure-related, although the team also found defective verifiers.
For the difficulty check, Qwen3.8-27B generally attempted each task four times. Of 442 scored tasks, it always solved 151 and never solved 120; it solved the remaining 171 on some attempts but not others. These were suitable for GRPO training, which compares attempts within a group. The final publicly available dataset contains 871 accepted tasks from 35 repositories, including those 171 examples at the appropriate difficulty.
The researchers also tested the filters in four short training runs of up to 50 steps. The runs used the same settings but drew tasks from different stages of validation and difficulty screening.
Training and the merged adapter
The final training mixture comprised 750 tasks from agent-adapter environments and 300 Termgrade tasks. The reward combined solution correctness with a small tool-efficiency bonus of 0.1. Thinking mode was disabled during training rollouts; the final adapters were evaluated with it both off and on.
Each adapter was trained using two NVIDIA B200 GPUs: one ran the vLLM model server and the other handled training. Across the three runs, training totaled 598 steps, 78,114 samples and 167 million trained tokens. The safeagents tool checked 1.3 million tool calls and blocked 647 suspicious calls.
The three LoRA weight updates had low layer-by-layer cosine similarity, around 0.01–0.02, which favored merging. The researchers tried several weightings and chose to apply half of each adapter's contribution for a better balance. The resulting rank-96 “super-adapter” can run unchanged under all three harnesses. The weighting was selected using Terminal-Bench 2.1, however, so results on that benchmark may be slightly optimistic; SWE-bench Pro played no part in the selection.
Benchmark results and efficiency
The specialist adapters were evaluated on all 89 Terminal-Bench 2.1 tasks and 51 hard SWE-bench Pro tasks, with one attempt per task. Each adapter beat the base model on both benchmarks under its own harness. On the full hard SWE-bench Pro set, Pi improved from 39.2% to 64.7%, Hermes Agent from 29.4% to 43.1%, and OpenCode from 35.3% to 51.0%. On the full Terminal-Bench 2.1, gains were 16.3 percentage points under Pi, 14.1 under Hermes and 6.0 under OpenCode.
On tasks solved by both the base model and the corresponding specialist adapter, the adapters made 56–72% fewer tool calls on SWE-bench Pro and 53–70% fewer on Terminal-Bench. The harnesses have different default settings, so the researchers said comparisons are most meaningful within the same harness.
On comparable subsets with thinking disabled, the merged adapter improved on the base model in all six harness–benchmark pairs: mean pass@1 rose from 39.5% to 49.0%. With thinking enabled, the mean increased from 55.5% to 63.5%; the adapter beat the base model at the same setting on five pairs and tied on one. With thinking off, the specialists outperformed the merged version on four of the six pairs.
The researchers also tested the Pi adapter under other harnesses. On Terminal-Bench it performed similarly to the OpenCode specialist when used under OpenCode, and retained about two-thirds of the Hermes specialist's gain under Hermes. This suggests that some learned capabilities transfer between harnesses.
A separate test used 300 business-automation tasks from AutomationBench with that benchmark's own agent loop. The base model scored 23.0%, the Pi adapter 27.0%, the OpenCode adapter 25.3%, the merged adapter 23.7% and the Hermes adapter 17.7%. With the possible exception of Hermes, the differences were within measurement noise, so the results did not show clear transfer to this different setting.
An open question about thinking mode
When examining rollout traces, the researchers also found that, with thinking disabled, the adapted model often wrote a short passage before calling a tool, whereas the base model generally called the tool directly. That text can sometimes resemble a reasoning trace, raising the possibility that training taught the model to use some such behavior despite the setting.
The researchers said this does not invalidate results measured under the same conditions, but warrants further investigation. They plan to study training with thinking-only and mixed thinking modes, as well as additional models. They have made the method, adapters and associated tasks available for others to use.
Related articles More from the section.
New Test Measures AI Model Performance on Long Engineering Tasks
A new study examines how AI model performance on long engineering tasks improves with the computing capacity used during testing.
Research · November 25, 2026AI labs publish mathematical proof claims awaiting review
OpenAI and Anthropic have published AI-assisted claims on major problems in computational complexity, including the matrix multiplication exponent and the separation of VP from VNP.
Research · November 25, 2026Register reuse speeds up NVFP4 attention on NVIDIA RTX Blackwell
A revised attention kernel reuses registers and interleaves operations to keep Tensor Cores busier on NVIDIA RTX Blackwell GPUs.


