ANTE:先预测,再执行——从已验证信念中为编码智能体学习内部世界模型
研究论文 · 2026/10/16
ANTE(Anticipate, Then Execute)是一个面向编码智能体的强化学习框架,通过真实执行验证策略在行动前的预测,并将其转化为每一步的信用分配以及信任或弃权决策。其核心方法 Belief-Anchored Policy Optimization(BAPO)将已确定的预测转化为每步优势,在推理阶段,ANTE-TTO 无需外部评分器即可在候选动作中选择。实验表明,ANTE 将 Qwen3-32B 在 SWE-bench Verified 上的 pass@1 从 25.0% 提升至 57.2%,比匹配的 GRPO 基线高出 6.2%;其世界模型准确率在强化学习过程中从 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.