Grafy News
Try Grafy free

New PreVision approach improves coding agent performance

Researchers propose PreVision, a method that trains coding agents to predict product outcomes rather than just tool observations to improve success.

Illustration for the news story: New PreVision approach improves coding agent performanceSource: Grafy Research Lab

Coding agents are moving closer to autonomous software engineering through a new training method that prioritizes product outcomes over simple tool feedback. Researchers have introduced PreVision, an approach designed to help Large Language Model (LLM) agents better anticipate whether their code changes will actually solve a problem or pass official tests.

Why do current coding agents struggle with observations?

Most existing "world models" for AI agents are designed to predict the next observation—the immediate response a tool or environment provides after an action is taken. However, according to the research paper, these observations are often poor proxies for actual progress in a coding environment. For instance, a terminal might return a generic "file edited" message regardless of whether the edit fixed a bug or introduced a new one.

Figure 1 illustrates this distinction between observation-level and product-level modeling. In the observation-level example, the model predicts the next tool response, which remains identical across multiple different edits. In contrast, a product-level model predicts the actual state of the software, such as whether it passes regression tests or how it appears when rendered. The authors note that in their data, local test results contradicted official outcomes in more than half of the instances where a test had just been run, making observation-based prediction unreliable for determining task success.

Figure 1: Observation-level vs. product-level world models. Four edits from one trajectory on a Chart.js issue. (a) An observation-level world model predicts the next too…
Figure 1. Observation-level vs. product-level world models. Four edits from one trajectory on a Chart.js issue. (a) An observation-level world model predicts the next tool response, which is the same “file edited.” for all four edits. (b) A product-level world model predicts the state of the code product: the hidden issue and regression tests and the rendered behavior. Only this target separates the final,… Figure 1 of “Predict the Product, Not the Observation: Product-Level World Models for Coding Agents” by Qingyao Li, Xinyi Dai, Di Yin et al. (arXiv.org), CC BY 4.0.

How does the PreVision method work?

PreVision shifts the focus from predicting what a tool says to predicting what the code does. The researchers argue that a coding agent should be judged by the "product state"—the state of the software once it is run and tested. This includes whether the code passes official test suites and, for user-facing applications, how the rendered program behaves.

As shown in Figure 2, the PreVision workflow involves several steps during the training phase. First, a teacher model identifies key decision points in successful trajectories, such as immediately after an edit or before a final submission. It then generates a forecast of the hidden product state. This forecast is only kept if it matches the ground truth from official tests and a render probe. This verified forecast is then written directly into the agent's reasoning process as a first-person judgment. By training the agent on these trajectories, the model learns to internalize these forecasts, allowing it to anticipate outcomes as part of its own decision-making process without needing extra modules during inference.

Figure 2: Overview of PreVision. (a) At each decision point, a teacher model forecasts the hidden product state from the agent’s view; the forecast is kept only if it mat…
Figure 2. Overview of PreVision. (a) At each decision point, a teacher model forecasts the hidden product state from the agent’s view; the forecast is kept only if it matches the ground truth from the official tests and a fixed render probe. (b) The verified forecast is written into the agent’s reasoning as a first-person judgment (evidence, forecast, decision); the original action is kept. (c) Joint SFT on… Figure 2 of “Predict the Product, Not the Observation: Product-Level World Models for Coding Agents” by Qingyao Li, Xinyi Dai, Di Yin et al. (arXiv.org), CC BY 4.0.

What are the performance benefits of product-level modeling?

By internalizing these forecasts, agents become better at planning and selecting actions. The researchers evaluated their method using a new benchmark called ProWM-Bench, which tracks agent rollouts on real repository issues and records the official test outcomes and rendered outputs at every step.

The results indicate significant improvements in task completion. According to the study, PreVision improved trial-level task success by 10.4 percentage points on the SWE-MM benchmark and by 7.7 points on the SWE-rebench V2 + ScaleSWE benchmark compared to agent-only training. These gains suggest that teaching an agent to forecast the final state of the product within its own reasoning chain translates directly into better real-world performance.

Can world model capabilities be transferred easily?

One of the key findings in the research is that simply mixing world-model data into standard training is not enough to guarantee better agent behavior. The authors found that explicit world-model ability does not automatically transfer to improved agentic task completion. While some methods attempt to query an external world model at inference time, this increases computational costs and complexity. PreVision avoids this by embedding the predictive capability directly into the agent's reasoning, ensuring that the ability to "imagine" the product state is a fundamental part of how the agent decides its next move.

How can developers apply these insights?

For developers working with AI-assisted coding tools, this research highlights the importance of high-quality feedback loops. Relying solely on linter messages or simple command outputs may not provide the semantic depth required for an agent to truly understand its progress. As agents evolve toward the capabilities described in the PreVision paper, the integration of comprehensive test suites and visual rendering probes will become essential for training reliable autonomous engineers.

While Grafy does not currently implement the specific PreVision training architecture, developers looking to experiment with complex coding workflows can utilize Grafy Code to manage multi-step programming tasks. For those interested in exploring the theoretical foundations of these agentic behaviors or reading the full technical breakdown of the ProWM-Bench dataset, Grafy Reader provides an efficient way to interact with and query research papers.

Frequently asked questions

What is the main difference between observation-level and product-level world models?

Observation-level world models predict the immediate response from a tool, such as a terminal output or a file confirmation. Product-level world models predict the functional state of the software being built, such as whether the code passes official tests or how the user interface behaves after an edit is applied.

How does PreVision improve the reasoning of coding agents?

PreVision improves reasoning by writing verified product forecasts directly into the agent's thought process during training. This teaches the agent to predict the eventual outcome of its code changes—such as test pass/fail status—before it commits to an action, allowing for more informed decision-making.

Does PreVision require extra computational steps during inference?

No, PreVision does not require additional modules or extra steps during inference. Because the forecasting capability is internalized into the agent's reasoning through supervised fine-tuning during the training phase, the agent naturally performs these predictions as part of its standard reasoning process when deployed.


Source: Grafy Research Lab — Predict the Product, Not the Observation: Product-Level World Models for Coding Agents