Hugging Face Researchers Train Harness Adapters to Boost LLM Agent Efficiency Across Frameworks
Frontier AI models · AI assistants · AI coding
Hugging Face researchers demonstrated a recipe to train LoRA adapters directly inside target agent harnesses using reinforcement learning. Applied to Qwen3.8-27B across Pi, OpenCode, and Hermes Agent, the adapters improved benchmark accuracy while cutting tool calls and token consumption, and could be concatenated into a unified super-adapter.
General-purpose language models are rarely tailored to the specific interaction loops of agent harnesses, leading to unnecessary token consumption and redundant tool calls. Hugging Face researchers introduced a reinforcement learning workflow that trains custom LoRA adapters directly inside deploy-time harnesses including Pi, OpenCode, and Hermes Agent. By keeping the target harness in the loop via OpenEnv, Harbor, and TRL's AsyncGRPOTrainer, the model learns the exact interaction conventions of each framework. Evaluating the approach with Qwen3.8-27B on Terminal-Bench 2.1, an RL-trained LoRA adapter under the Pi harness raised pass@1 performance from 39% to 55%, while cutting average token usage per task from 2.9K to 1.5K. Each harness adapter outperformed the base model in correctness and efficiency under its respective harness. Furthermore, because weight updates across different harnesses showed near-orthogonal directions with cosine similarities between 0.01 and 0.02, the team concatenated the three rank-32 adapters into a rank-96 super-adapter. Using a scaling weight of ½, the merged adapter ran across Pi, Hermes Agent, and OpenCode with an average score of 52.5%, outperforming the base model while reducing tool calls.
Key takeaways
- In-harness reinforcement learning with AsyncGRPOTrainer trained LoRA adapters directly inside Pi, OpenCode, and Hermes Agent.
- On Qwen3.8-27B in the Pi harness, the harness adapter increased Terminal-Bench 2.1 pass@1 from 39% to 55% and reduced average token usage from 2.9K to 1.5K per task.
- Concatenating the three adapters into a rank-96 super-adapter at weight ½ achieved 52.5% accuracy across all three harnesses while lowering tool calls compared to the base model.
Source:Hugging Face / authors Read the original ↗
Prepared, checked and automatically published by AI; not individually reviewed by a human.