Introducing harness adapters: adapt your favorite model to your harness to improve performance and cost

In one sentence

Hugging Face introduces harness adapters, using reinforcement learning inside agent harnesses to boost Qwen3.8-27B's accuracy while significantly reducing token usage.

Key points

  • The team trained RL LoRA adapters for Qwen3.8-27B inside Pi, OpenCode, and Hermes Agent, and merged them into a single super adapter.
  • On Terminal-Bench 2.1, the adapter improved Qwen3.8-27B's pass@1 from 39% to 55% while cutting average token usage from 2.9K to 1.5K.
  • The training pipeline runs on Hugging Face Jobs using TRL's AsyncGRPOTrainer, OpenEnv, and Harbor, learning directly from tokens produced by the live harnesses.
  • The team built a coding agent dataset from SWE-smith, SWE-Gym, and Tasksmith, rigorously validating tasks for semantics and determinism with openenv validate.
  • All adapters, GGUF files, and RL tasks are open-sourced on Hugging Face for developers to reproduce.

In depth

An AI-written overview of the original article, not the article itself.

Hugging Face Blog introduces harness adapters, a method using reinforcement learning to tailor models like Qwen3.8-27B to specific agent harnesses. By optimizing for both the target harness and task distribution, the approach significantly improves software engineering accuracy while cutting token consumption.

Key Results and Architecture

General-purpose models leave performance on the table when paired with specific harnesses. The article notes that adding an RL-trained LoRA adapter to Qwen3.8-27B under the Pi harness raised its Terminal-Bench 2.1 pass@1 score from 39% to 55%, while halving average token usage from 2.9K to 1.5K.

The team trained separate LoRAs for Pi, OpenCode, and Hermes Agent, and merged them into a single super adapter. Unlike frameworks that re-implement agent loops, their setup runs the actual harnesses in Docker images and uses a proxy between the harness and vLLM to record exact tokens.

Data Pipeline and Filtering

To train the adapters, the team built a dataset of 871 agentic coding tasks across 35 repositories from SWE-smith, SWE-Gym, and Tasksmith. Every task passed metadata screening and semantic checks via openenv validate to ensure verifiers worked properly.

Because GRPO requires tasks with learning signal, the team tested Qwen3.8-27B on each task and kept 171 qualified tasks that the base model solved only sometimes, discarding tasks it always passed or always failed.

Training Setup

Training ran on Hugging Face Jobs using TRL's AsyncGRPOTrainer on 2xB200 GPUs, dedicating one GPU to vLLM and the other to training. Thinking mode was disabled during rollouts.

The reward combined verifier correctness with a 0.1 tool-efficiency bonus, using a 2e-5 learning rate. The final mixture interleaved 750 harness-adapters tasks with 300 termgrade tasks by repository family.

Read originalOpens huggingface.co

This summary was generated by AI from the original article and may contain errors; the original is authoritative. Copyright belongs to the original author.

Other coverage of this story

2 reports from 2 sources, in order of publication.

Recent stories from this source