ANTE: Anticipate, Then Execute -- Learning Internal World Models for Coding Agents from Verified Beliefs
Yi Ge, Kangrui Ruan, Jifan Chen, Manish Prajapat, Christian Bock, Xiaoyang Wang, Rein Houthooft, Aritra Sengupta and 1 others
University of Maryland, College Park · AWS AI Labs
Published October 11, 2026 · on the feed October 16, 2026 · ▲ 6 · arXiv 2610.15368
The abstract
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.
The Brief
3:02A short podcast summary of the paper. Written and voiced by AI.
Transcript
ANTE. Anticipate, Then Execute -- Learning Internal World Models for Coding Agents from Verified Beliefs. By Yi Ge and eight others, from the University of Maryland, College Park and AWS AI Labs. Published on the eleventh of October. No code repository is linked to it.
Large language models have made software engineering agents capable of complex coding tasks. Inside a containerized environment, such an agent receives tool responses or execution results, and chooses its next actions based on what came back. What most of these agents never do is look ahead. Their policies do not anticipate the consequences of an action before taking it.
Two costs follow. The terminal reward barely attributes a failure to any particular earlier step, so the agent learns little about which move went wrong. And an ill-judged edit can corrupt the repository state irreversibly before any signal arrives at all. Recent code world models aim at these problems, but they come in two forms that the authors find limiting. Either they are trained and then frozen before reinforcement learning begins, or they are reduced to an auxiliary next-token loss on the environment's outputs.
ANTE, short for Anticipate, Then Execute, is an agentic reinforcement learning framework built on a simple loop. Before each action, the policy states an internal belief: a prediction of what the action will do. Real execution then settles whether that prediction was right. Those verified predictions become two things: per-step credit for the agent's actions, and a basis for deciding when to trust its own forecast and when to abstain.
The training side is Belief-Anchored Policy Optimization, or BAPO. With a belief stated before every action, BAPO takes the settled predictions and turns them into per-step advantages, anchoring the credit on the policy's own forecasts. Instead of one reward at the end of a long trajectory, each step gets a signal tied to what the agent expected and what actually happened.
The inference side is ANTE-TTO, for test-time optimization. Its job is to turn the trained forecasts into better actions, which is what makes effective test-time scaling possible. It selects among candidate actions without any external scorer. The world model the policy has learned is the thing doing the judging.
On SWE-bench Verified, ANTE raises Qwen3-32B from twenty-five percent to fifty-seven point two percent pass at one. That is six point two percent above a matched GRPO baseline trained without the belief state, which isolates the contribution of the beliefs themselves.
The world model improves along the way. Its accuracy climbs from forty-four percent to sixty-nine percent during reinforcement learning. And the learned foresight is reported to transfer, both across harnesses and to out-of-distribution domains.
The design asks the agent to commit to an expectation before it acts, and then holds it to account. A prediction that execution can check is a source of credit that a sparse terminal reward cannot provide, and the same habit of forecasting becomes a scorer when choosing among actions at inference. The authors frame the goal as a code world model that knows what has happened, what holds now, and what the next action will achieve.
More with an account
Listen to every day’s papers
Daily playlists, deep dives, quests for the papers, and quizzes on their key terms.
Join free