用专家实时纠错提升多轮大模型代理的训练效果
Imitation Learning for Multi-turn LM Agents via On-policy Expert Corrections
- 生成部分在线数据:学生模型起步,中途切换专家修正
- 在7b和32b模型上分别提升14%和13%的修复准确率
- 适合需要多轮交互的编程任务训练,如缺陷修复
当前主流的大语言模型代理训练依赖模仿学习,通过专家轨迹微调。但多轮场景下,离策略模仿学习存在协变量偏移问题:学生策略行为偏离专家后,会遇到训练数据中未覆盖的状态,导致微调效果下降。受经典DAgger算法启发,我们提出一种新数据生成方法——在线专家修正(OEC),即以学生模型启动推理轨迹,中途切换至专家模型进行修正,生成部分在线数据。我们在软件工程任务(SWE)中验证该方法,该任务要求大模型与开发环境交互以修复程序缺陷。实验对比了OEC与其他在线及模仿学习方法,在统一使用拒绝采样(基于环境奖励)与监督微调的框架下进行。结果表明,OEC在SWE-bench验证集上,7b和32b模型分别相对传统模仿学习提升14%和13%。研究证明,结合专家示范与在线数据对有效训练多轮大模型代理至关重要。
原文摘要 · Abstract (English)
A popular paradigm for training LM agents relies on imitation learning, fine-tuning on expert trajectories. However, we show that the off-policy nature of imitation learning for multi-turn LM agents suffers from the fundamental limitation known as covariate shift: as the student policy's behavior diverges from the expert's, it encounters states not present in the training data, reducing the effectiveness of fine-tuning. Taking inspiration from the classic DAgger algorithm, we propose a novel data generation methodology for addressing covariate shift for multi-turn LLM training. We introduce on-policy expert corrections (OECs), partially on-policy data generated by starting rollouts with a student model and then switching to an expert model part way through the trajectory. We explore the effectiveness of our data generation technique in the domain of software engineering (SWE) tasks, a multi-turn setting where LLM agents must interact with a development environment to fix software bugs. Our experiments compare OEC data against various other on-policy and imitation learning approaches on SWE agent problems and train models using a common rejection sampling (i.e., using environment reward) combined with supervised fine-tuning technique. Experiments find that OEC trajectories show a relative 14% and 13% improvement over traditional imitation learning in the 7b and 32b setting, respectively, on SWE-bench verified. Our results demonstrate the need for combining expert demonstrations with on-policy data for effective multi-turn LM agent training.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。