Product-Level World Models for Coding Agents: PreVision & ProWM-Bench

PreVision (arXiv:2612.04946) replaces noisy terminal observation prediction with product-level world modeling—forecasting whether repository code passes official tests and how rendered UI/DOM behaves. Evaluated on ProWM-Bench, PreVision lifts trial-level task success by +10.4 percentage points on SWE-MM and +7.7 points on SWE-rebench V2 + ScaleSWE while halving runaway episodes.
Product-Level World Models for Coding Agents: PreVision & ProWM-Bench: PreVision (arXiv:2612.04946) replaces noisy terminal observation prediction with product-level world modeling—forecasting whether repository code passes official tests and how rendered UI/DOM behaves. Evaluated on ProWM-Bench, PreVision lifts trial-level task success by +10.4 percentage points on SWE-MM and +7.7 points on SWE-rebench V2 + ScaleSWE while halving runaway episodes. Designed as a zero-dependency, open-source TypeScript architecture under the MIT License with native Model Context Protocol (MCP) support and deterministic phase state machines.
- Up to +10.4 pp Higher Coding Task Success: Outperforms pure Agent-SFT on SWE-MM and gains +7.7 pp on SWE-rebench V2 + ScaleSWE.
- Solves Silent Edit Confirmation Failure: Forecasts hidden official test suite verdicts and rendered DOM field/F1 outcomes rather than superficial bash exit codes.
- Cuts Runaway Trajectories by >56%: Reduces SWE-MM runaway rate from 14.6% (Agent-SFT) down to 5.7% and R+S runaway rate from 7.4% to 3.2%.
- Leaner Reasoning Tokens Per Turn: Shrinks average thinking tokens per turn from 630 to 356 on SWE-MM and from 412 to 284 on R+S.
import { createAgent } from '@smoke-monkey/harness';// Coding agent instructed to emit product-level test & render forecasts before committing editsconst agent = createAgent({agentId: 'prevision-product-coder',provider: 'openai-compatible',baseUrl: 'http://127.0.0.1:8000/v1',model: 'Qwen/Qwen3.8-27B',workspacePath: process.cwd(),permissions: {read_file: 'allow',write_file: 'allow',run_command: 'ask',},});async function main() {const result = await agent.run('Before editing src/components/Chart.tsx, forecast which unit tests and rendered DOM attributes will change, apply the fix, and verify with vitest.');console.log('Verified Product Outcome:', result.summary);}main().catch(console.error);
Watch: Related Video Guides
Andrej Karpathy: From Vibe Coding to Agentic Engineering w/ Stephanie Zhan
World Models explained in 10min..
Why Observation-Level World Models Fail Coding Agents
Product-Level World Modeling (arXiv:2612.04946) trains coding agents to predict the final behavior of the built software product—specifically official test pass/fail outcomes $y^{\text{test}}(s)$ and rendered UI/DOM state $y^{\text{render}}(s)$—rather than the next raw shell observation $o_{t+1}$.
In software engineering repositories, raw observations are misleading: apply_patch prints the same confirmation string whether a patch fixes the root bug or introduces a subtle regression, and local sanity checks often diverge from full CI tests. On ProWM-Bench (covering SWE-MM and SWE-rebench V2 + ScaleSWE), standard observation-prediction models (Obs-Think) achieve only 5.2%–6.2% observation exact match and actually drop SWE-MM trial resolution from 54.7% (Agent-SFT) to 51.0%. By contrast, writing verified product forecasts into training reasoning (PreVision) turns world modeling into direct execution discipline:
| Model / Variant | SWE-MM Trial (%) | SWE-MM Task (%) | R+S Trial (%) | R+S Task (%) | SWE Test Resolved (%) | Render Field-EM (SWE / R+S) |
|---|---|---|---|---|---|---|
| Qwen3.8-Flash-Next | 78.1% | 90.6% | 80.2% | 86.6% | 77.0% | 63.5% / 64.0% |
| DeepSeek-V4.1-Flash | 85.4% | 89.6% | 82.4% | 87.1% | 67.5% | 60.7% / 54.0% |
| Qwen3.8-27B (Base) | 42.2% | 62.5% | 58.9% | 69.8% | 79.4% | 66.6% / 71.5% |
| Agent-SFT | 54.7% | 71.9% | 56.9% | 67.8% | 75.1% | 68.8% / 64.5% |
| Obs-Think | 51.0% | 67.7% | 55.4% | 67.8% | 57.2% | 34.5% / 27.0% |
| Struct-Forecast | 55.7% | 69.8% | 50.5% | 62.9% | 46.6% | 40.1% / 28.5% |
Cutting Runaway Coding Loops and Implementing Product Probes in CI
PreVision also solves one of the highest hidden costs in coding agents: runaway token burn. On SWE-MM, PreVision reduces thinking tokens per turn from 630 to 356 (total episode tokens down from 24.4k to 19.0k), drops runaway failures from 14.6% to 5.7%, and lifts voluntary confident stops from 50.5% to 63.5%. On R+S, runaway rate falls from 7.4% to 3.2% while voluntary stops rise from 41.1% to 65.6%.
You can mirror this verification discipline in any local TypeScript/Playwright repository by pairing unit assertions with lightweight DOM render probes before an agent emits its final completion signal:
# Run paired unit test + headless DOM state probe as a single verification gate
npx vitest run --reporter=json --outputFile=.agent-test-verdict.json && \
npx playwright test tests/render-probe.spec.ts --reporter=json
# Inspect verdict deltas before allowing agent voluntary stop
python3 -c 'import json; d=json.load(open(".agent-test-verdict.json")); print("Passed:", d["numPassedTests"], "Failed:", d["numFailedTests"])'Do Not Replace Free-Text Forecasts With Rigid JSON Verdicts
In PreVision ablations, forcing structured JSON verdicts during reasoning (PreVision w/ JSON verdicts) dropped SWE-MM trial resolution to 52.6% versus 57.3%–65.1% for natural-language product forecasts.
Frequently Asked Questions
Q:What is the difference between observation and product-level world models?
Observation world models predict the immediate next stdout/tool string, which often fails to signal bug resolution. Product-level world models predict whether official hidden tests will pass and how the rendered program or DOM will behave.
Q:How much does PreVision improve coding agent benchmarks?
On ProWM-Bench (arXiv:2612.04946), PreVision improves trial-level task resolution over agent-only training by +10.4 percentage points on SWE-MM and +7.7 points on SWE-rebench V2 + ScaleSWE.
Q:Does PreVision increase token usage during reasoning?
No. On SWE-MM it lowers thinking tokens per turn from 630 to 356 (19.0k vs 24.4k episode tokens), and on R+S it lowers them from 412 to 284 while cutting runaway rates from 7.4% to 3.2%.
Q:What is ProWM-Bench?
ProWM-Bench is a unified coding benchmark across SWE-MM and SWE-rebench V2 + ScaleSWE that measures both agent resolution rate and world-model prediction accuracy (Test Resolved, Test All-EM, Render Field-EM, and Render DOM-F1).
Related Alternatives & Comparisons
Related Architecture Guides
View all guidesBest Open Source Coding Agents in 2026: Free, Local & Fully Hackable Harnesses
MCP Server Security Best Practices: Hardening Model Context Protocol Agents in 2026
Open Source Coding Agent Harness: Build a Forkable, Local AI Engineering Runtime
Build with Smoke Monkey Harness
Zero dependencies. 24 built-in tools. Human-in-the-loop safety. 100% open source under the MIT License.