使用 OpenCode 和 TRL 在远程沙箱中训练编码代理
原标题:Training a coding agent using the OpenCode harness in remote HF sandboxes with TRL and OpenEnv
AI 摘要
Hugging Face 博客介绍了如何使用 TRL 和 OpenEnv 在远程 HF 沙箱中训练编码代理。文章通过 OpenCode 代理示例,展示了利用 AsyncGRPO 算法对代理产生的真实 token 进行训练,并实现每个 rollout 在独立远程沙箱中运行以扩展规模。该架构通过透明代理捕获 token,使用隐藏测试作为奖励,并支持在 Hugging Face Jobs 上运行。
正文节选
TRL recently shipped support for training a coding agent natively with OpenEnv, via the OpenCode harness (see the announcement). In this post we walk through a concrete example, end to end. We take a real, off-the-shelf coding agent, let it run its own loop against real coding problems, and train it with AsyncGRPO on the exact tokens it produced. Then we go one step further and run every rollout in its own remote Hugging Face sandbox, so the rollouts scale out beyond a single node. We use OpenCo