Hugging Face 提出多 harness 强化学习提升模型跨接口可移植性
Hugging Face 研究人员提出多 harness 强化学习方法,让同一开源权重模型在 Claude Code、Codex、OpenCode 和 Mini-SWE-Agent 四种 harness 中训练,以解决模型只学会特定接口的工具名、输出格式和控制流的问题。
HuggingFace just closed a major gap in harness engineering!
(the ultimate guide to multi-harness RL)
the same open-weight model can perform well inside one harness, then lose accuracy or produce invalid tool calls when moved to another.
this happens because training inside one interface can teach the model its specific tool names, output formats, context structure, and control flow. the model learns how to operate the harness, not just how to solve the task.
Hugging Face researchers tested a more portable approach called multi-harness reinforcement learning. instead of training a model through one agent interface, they trained it through Claude Code, Codex, OpenCode, and Mini-SWE-Agent.
to make that possible, they connected three open systems.
→ 𝗢𝗽𝗲𝗻𝗘𝗻𝘃 provides a standard interface between agent harnesses, reinforcement learning environments, and trainers. its capture proxy sits between the harness and model server, recording the exact tokens and generation probabilities needed for training.
→ 𝗛𝗮𝗿𝗯𝗼𝗿 runs agents against containerized tasks. it keeps the task, harness, and sandbox independent, allowing the same task to be attempted through different harnesses without rebuilding the environment.
→ 𝗧𝗥𝗟 is Hugging Face’s open-source library for post-training language models. it uses the trajectories captured by 𝗢𝗽𝗲𝗻𝗘𝗻𝘃 to update the model through reinforcement learning.
the real breakthrough is where the training data gets captured.
each harness keeps its native tools, prompts, context management, retries, and execution loop. the researchers do not recreate those behaviors inside the trainer. 𝗢𝗽𝗲𝗻𝗘𝗻𝘃 observes the model calls passing through each real harness and converts them into usable training sequences.
the team trained 𝗟𝗙𝗠𝟮.𝟱-𝟮.𝟲𝗕 across all four harnesses. the share of held-out tasks solved on the first attempt increased from 42.2% to 54.2%, with gains under every harness.
the trained model also used 31% fewer tool calls on tasks that both it and the base model solved.
training only in OpenCode improved the model too, but most of that gain stayed concentrated in OpenCode. multi-harness training spread the improvement across interfaces.
the experiment used one task family, one training seed, and unequal data exposure, so the results are not a universal ranking. even with those limitations, the mechanism matters.
open-source models cannot assume one deployment interface. if they need to work across harnesses, that portability must become part of training.
Read the full guide here: huggingface.co/spaces/FineEn…
if you want to understand harness engineering and what an agent harness actually includes, i wrote a full breakdown to help you get started. the article is quoted below.
来源:akshay_pachaar · x.com