ANTE:先预测,再执行——基于验证信念为编码智能体学习内部世界模型
ANTE: Anticipate, Then Execute -- Learning Internal World Models for Coding Agents from Verified Beliefs
AI总结:
ANTE是一种智能体式强化学习框架,通过验证编码智能体的行动前预测优化策略,将Qwen3-32B在SWE-bench Verified上的pass@1从25.0%提升至57.2%,其世界模型准确率也显著提升,前瞻能力可跨场景迁移。
摘要:
大型语言模型的快速进展已使软件工程智能体能够处理复杂的编码任务。在容器化环境中,编码智能体接收工具响应或执行结果,并根据这些早期结果确定后续行动。然而,大多数现有编码智能体从不进行前瞻:它们的策略不会预测行动的后果,且终端奖励几乎无法将失败归因于早期的特定步骤,因此在任何信号到达前,判断失误的编辑可能会不可逆转地破坏仓库状态。近期的代码世界模型旨在应对这些挑战,但它们要么在强化学习(RL)前经过训练后就被冻结,要么简化为对环境输出的辅助下一个标记损失。我们提出ANTE(Anticipate, Then Execute,先预测,再执行),这是一种智能体式强化学习框架,通过实际执行验证策略行动前的预测,并将其转化为行动的逐步信用及信任或弃权(不执行)决策。凭借在每次行动前陈述的内部信念,信念锚定策略优化(Belief-Anchored Policy Optimization,BAPO)通过将信用锚定在策略自身的预测上,将确定的预测转化为逐步优势。为在推理时将训练后的预测转化为更好的行动,从而促进有效的测试时扩展,ANTE-TTO(test-time optimization,测试时优化)在无外部评分器的情况下从候选行动中进行选择。ANTE将Qwen3-32B在SWE-bench Verified上的pass@1从25.0%提升至57.2%,比未使用信念状态训练的匹配GRPO基线高出6.2%;其世界模型的准确率在RL期间从44%攀升至69%,且学习到的前瞻能力可在工具链和分布外领域间迁移。总而言之,我们旨在构建一个代码世界模型,使其知晓已发生之事、当前状态以及下一个行动将达成的目标。
英文摘要:
Rapid advances in large language models have made software engineering agents capable of tackling complex coding tasks. Within a containerized environment, a coding agent receives tool responses or execution results, and determines its later actions by those earlier results. However, most existing coding agents never look ahead: their policies do not anticipate the consequences of actions, and the terminal reward barely attributes a failure to certain earlier steps, so an ill-judged edit can corrupt the repository state irreversibly before any signal arrives. Recent code world models aim to address these challenges, but they are either trained and then frozen before reinforcement learning (RL), or reduced to an auxiliary next-token loss on the environment's outputs. We present ANTE (Anticipate, Then Execute), an agentic RL framework that verifies the policy's pre-action predictions by real execution and turns them into per-step credit for its actions and trust-or-abstain decisions. With an internal belief stated before each action, Belief-Anchored Policy Optimization (BAPO) turns the settled predictions into per-step advantages by anchoring credit on the policy's own forecasts. To turn the trained forecasts into better actions at inference, thereby facilitating effective test-time scaling, ANTE-TTO (test-time optimization) selects among candidate actions without an external scorer. ANTE raises Qwen3-32B from 25.0% to 57.2% pass@1 on SWE-bench Verified, 6.2% above a matched GRPO baseline trained without the belief state; its world model's accuracy climbs from 44% to 69% during RL, and the learned foresight capability transfers across harnesses and out-of-distribution domains. In summary, we aim to build a code world model that knows what has happened, what holds now, and what the next action will achieve.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。