Agent Lightning v1.0:迈向受控的智能体强化学习
研究论文 · 2026/08/19
现代智能体在管理工具、上下文和控制流的智能体框架内运行,使得框架成为智能体系统的关键部分。我们最初的Agent Lightning引入了一种解耦架构,通过LLM端点代理将任意智能体连接到RL训练,该方法后来被verl Uni-Agent、AReaL 2.0、slime和Polar等框架采用。我们将这种范式称为“受控智能体强化学习”(harnessed agentic RL),其中部署时的框架直接参与模型的后训练。受控智能体RL与传统智能体RL有根本不同:框架而非训练引擎拥有环境交互循环,而训练器仅观察LLM请求-响应对序列。这引入了重新分词、样本合并、优势计算、损失归一化和后端调度等挑战,这些可能显著影响训练稳定性和有效性。我们提出了Agent Lightning v1.0,一个轻量级的受控智能体RL框架,约3500行代码实现。它支持任意智能体框架,并作为研究这些挑战的实用测试平台。我们在指令遵循、搜索和编码智能体上进行了评估,并提供了完整的可复现编码智能体RL流程。仅使用6K训练样本和适度的计算,RL将Qwen3.5-9B在SWE-bench Verified上的性能从41.8%提升到56.4%,绝对提升14.6个百分点。我们发布了完整的工作流程和训练脚本,以促进受控智能体RL的可复现研究。
本文提出了一种新的智能体强化学习范式(受控智能体RL),并提供了一个轻量级框架Agent Lightning v1.0,解决了该范式中的关键挑战。实验结果表明,在少量数据和计算资源下,RL显著提升了编码智能体的性能,具有实际应用价值。此外,作者公开了完整代码和训练脚本,便于复现和进一步研究,对智能体RL领域有重要贡献。
Modern agents operate inside agent harnesses that manage tools, context, and control flow, making the harness a critical part of the agent system. Our original Agent Lightning introduced a disaggregated architecture that connects arbitrary agents to RL training through an LLM endpoint proxy, an approach later adopted by frameworks such as verl Uni-Agent, AReaL 2.0, slime, and Polar. We refer to this paradigm as harnessed agentic RL, where the deploy-time harness directly participates in model post-training. Harnessed agentic RL differs fundamentally from traditional agentic RL: the harness, rather than the training engine, owns the environment interaction loop, while the trainer observes only sequences of LLM request-response pairs. This introduces challenges in retokenization, sample merging, advantage calculation, loss normalization, and backend scheduling, which can substantially affect training stability and effectiveness. We present Agent Lightning v1.0, a lightweight framework for harnessed agentic RL implemented in approximately 3,500 lines of code. It supports arbitrary agent harnesses and serves as a practical testbed for studying these challenges. We evaluate it on instruction-following, search, and coding agents, and provide a complete reproducible pipeline for coding-agent RL. Using only 6K training examples and modest compute, RL improves Qwen3.5-9B on SWE-bench Verified from 41.8% to 56.4%, a 14.6-point absolute gain. We release the complete workflow and training scripts to facilitate reproducible research on harnessed agentic RL.