Skip to content
Neural Daily

ResearchNews

Harness adapters: RL-tuned LoRAs lift Qwen3.8-27B agents

🇭🇺 Olvasd el magyarul →

Hugging Face published an open recipe for adapting a model to your own agent harness with an RL-trained LoRA. Qwen3.8-27B gained up to 24 points on SWE-bench Pro while making far fewer tool calls.

· 4 min read

Hugging Face Harness Adapters borítókép: LoRA adapterek a Hermes, pi és opencode harnesshez, Qwen3.8-27B
Image: Hugging Face · Press kit · Source

What was released?

On November 20 Hugging Face published an expanded recipe for harness adapters (Hugging Face blog). The idea: freeze the model weights and train a separate LoRA adapter for each agent harness with reinforcement learning, running inside the harness itself. The base model was Qwen3.8-27B, and the three harnesses were pi, OpenCode and Hermes Agent.

Why bother? General-purpose models target average performance, not a specific harness and task mix. According to the authors, that leaves accuracy and tokens on the table.

  • One LoRA adapter (rank 32) per harness, trained with RL inside the harness's unmodified agent loop.
  • Training uses TRL's AsyncGRPOTrainer with OpenEnv and Harbor; datasets, training and rollouts all run in Hugging Face Jobs.
  • The three adapters were also merged into a single super-adapter that runs unchanged under all three harnesses.
  • Adapters, GGUFs, RL tasks and the safeagents plugin are public on the Hub.

How much does it help?

Under its own harness, each adapter beats the base model on both benchmarks (pass@1, thinking off; SWE-bench Pro on its 51 hardest tasks):

  • pi: SWE-bench Pro 40.0% → 64.0%, Terminal-Bench 2.1 40.0% → 56.5%.
  • Hermes Agent: SWE-bench Pro 29.4% → 43.1%, Terminal-Bench 2.1 44.7% → 58.8%.
  • OpenCode: SWE-bench Pro 35.3% → 51.0%, Terminal-Bench 2.1 47.6% → 52.4%.

The efficiency gains are even bigger. On tasks both the base model and the adapter solve, the adapters make 53–72% fewer tool calls per task. In the blog's pi example, average token use drops from about 2.9K to 1.5K: the model reasons less, calls fewer tools and gets it right first time more often.

A super-adapter that also shines with thinking on

The three LoRA updates are nearly orthogonal (cosine similarity around 0.01–0.02), which makes them easy to merge. The team concatenated them along the rank dimension (PEFT combination_type="cat", rank 96) at half weight. With thinking off, the super-adapter beats the base model on all six harness and benchmark pairs (mean pass@1 39.5% → 49.0%), but it usually trails each harness's own specialist, most of all under pi.

With thinking on, which it was never trained with, it is the strongest model they evaluated: against the base model at the same thinking effort, the mean goes from 55.5% to 63.5%, with +16 points under Hermes and +20 under OpenCode on SWE-bench Pro. The authors' rule of thumb: if you use one harness with thinking off, stick with its specialist.

How the training data was built

Of 1,127 candidate tasks, 858 passed openenv validate. A difficulty filter then kept only tasks the base model solves sometimes but not always, because in GRPO a task that always or never succeeds gives no learning signal. The harness-hub/agentic-coding-envs dataset holds 871 tasks from 35 repositories (SWE-smith, SWE-Gym, Tasksmith), 171 of them qualified. The final mix had 750 of these tasks plus 300 from Termgrade.

Each adapter was trained on two NVIDIA B200 GPUs, one serving vLLM and one running training. Across the three runs, safeagents checked 1.3 million tool calls and blocked 647.

Where are the limits?

  • Transfer: the pi adapter matches OpenCode's own specialist on Terminal-Bench 2.1 under OpenCode, and keeps about two thirds of the gain under Hermes.
  • Different territory: on 300 AutomationBench tasks with their own agent loop, the adapters stay within noise of the base model, with the Hermes adapter a bit behind (17.7% vs 23.0%).
  • Open question: with thinking off, the trained model writes short reasoning-like text before its tool calls. The authors say this doesn't invalidate the results, but hybrid thinking models need a closer look.

Why it matters

If you run an open-weight model inside a specific agent harness, a relatively cheap LoRA can lift accuracy and cut token costs at the same time. The recipe is open and can be reproduced with tasks generated from your own repositories. Google's Harness² comes at the problem from the other side, tuning the harness rather than the weights. The two approaches complement each other well.

    By Mikola Máté Patrik

    Produced with the help of AI, reviewed by an editor. How we make our articles

    Reviewed and edited by the Neural Daily desk. About

    Related articles