HuggingFace Open-Sources HarnessAdapter: Frozen-Weight RL Lifts Coding Agent Pass Rates by 16 Points
大模型之路 · wechat · 2026-11-26
The same 27B model can differ by a dozen points across coding agent harnesses. HuggingFace's open-source HarnessAdapter freezes model weights and runs a single RL pass tailored to the harness you actually deploy, closing that gap.
How it works
- Docker images pre-install Pi 1.5.2, OpenCode 2.2.7 and Hermes Agent v0.22.6, so training runs exactly as production does.
- A proxy layer between harness and vLLM records the harness's real tokens and feeds them to the trainer, so the model learns from its own mistakes inside that harness.
- Training uses TRL's AsyncGRPO Trainer with async rollout; two B200s are enough per adapter.
Task curation is the real work
- 1127 candidate tasks from the Hub, 858 after semantic validation, then 171 mid-difficulty tasks (out of 442 scored) that sometimes pass and sometimes fail.
- Validation caught a Terminal-Bench 2.1 verifier marking known-wrong answers correct; a triple check (reference solution scores highest, no-op scores clearly low, replay is deterministic) filters bad verifiers.
- Reward = verifier correctness + 0.1 tool-efficiency bonus; a safe-agents plugin inspected 1.3M tool calls and blocked 647 dangerous actions.
Results
- Hardest 51 SWE-bench Pro tasks: Pi 39.2%→64.7%, OpenCode 35.3%→51.0%, Hermes 29.4%→43.1%.
- Efficiency: 53%–72% fewer tool calls on tasks both base and adapter solve; Qwen3.8-27B terminal tasks drop from 2.9K to 1.5K tokens with pass rate 39%→55%.
- A "super adapter" averaging three adapters' weights lifts the six-combination average from 39.5% to 49.0% with thinking off; full-weight summing collapses, making agents overly terse (13 tool calls vs 49) and dropping Pi back to baseline.
Caveats
- Scores aren't comparable across harnesses (different defaults, e.g. Pi auto-compresses context); merged weights were selected on Terminal-Bench 2.1, so numbers skew optimistic.
- Limited transfer: on non-coding AutomationBench, Pi/OpenCode adapters only reach 23% of baseline (27.0/25.3) and Hermes falls to 17.7%.
- Researchers admit they don't fully know what the model learned; with thinking off, tuned models write a short note before each tool call.
Who it fits: teams running fixed task types on one harness at high volume should do the math; individual devs switching tasks and harnesses weekly are better off fixing prompts and tool descriptions first. The takeaway is an order of operations: measure tokens and tool calls per task before deciding between an adapter and a new model.
Related event: Hugging Face Open-Sources HarnessAdapter to Optimize Agent Harnesses(2 posts)→
More from coding & agent
- Samuel Colvin demos Monty, his sandbox for AI agents, at Rust London — samuelcolvin · 2026-11-27
- Dev replaces 4,000-word system prompt with 9 lines and nothing breaks — Royal_Being_5084 · 2026-11-27
- Pi Adapter Transfers to OpenCode and Hermes, But Author Says It's Bounded Adaptation, Not RSI — krishnan · 2026-11-27
- HF trains RL inside the shipping harness: Qwen3.8-27B hits 55% on Terminal-Bench, tokens drop 48% — krishnan · 2026-11-27
- Hugging Face's harness adapters lift frozen 27B model from 39% to 55% on Terminal-Bench — krishnan · 2026-11-27
- Debate: can one long-running chat really handle 10 parallel work streams? — evielync · 2026-11-27