AEO Explainers

What Is AI World Modeling?

AI world modeling is the shift from predicting the next word to simulating the next state. Here's where the idea came from, how it's built, and why it may be the missing piece for coding agents you can actually trust to ship.

At a glance
  1. 01AI world models predict the next state of an environment, not just the next word in a sequence.
  2. 02Meta's Code World Model learns by watching Python code execute step-by-step instead of just reading text.
  3. 03AI-generated code currently produces 1.7 times more errors due to a lack of runtime context.
  4. 04World modeling lets coding agents simulate runtime behavior to catch complex bugs before deployment.
A flat predictive tile connects to a rising sequence of increasingly layered, volumetric cubes, illustrating the shift from predicting a single token to simulating a full world state.
Illustration generated by Remy for this story.

AI world modeling means building a system that forms an internal representation of an environment and predicts how that environment changes in response to an action, instead of one that just pattern-matches its way to an output.12 A world model doesn't just answer a question. It keeps something closer to a working mental model, one it can run forward to see what happens next.

That distinction sounds abstract until you apply it to software. A large language model can write a function. A world model can try to picture what that function does once it's running against a real database, a flaky third-party API, and actual user traffic. That second capability is now getting built into coding tools, and it may be the piece that's been missing from the push toward autonomous software engineering.

World models vs. large language models

Most AI systems people use today, including chat assistants and coding copilots, run on next-token prediction. Given a sequence of words or code tokens, the model predicts the most likely next one. It's an extraordinarily powerful trick, but it's fundamentally about matching patterns in language, not tracking the state of a world.

A world model is built around next-state prediction instead. Given an environment's current state and an action taken within it, it predicts what the state becomes.13 NVIDIA's framing is useful here: world models take input like text, image, video, or sensor data and use it to predict what happens next, with an implicit understanding of physics and spatial dynamics baked in.2

The gap between the two shows up as brittleness. Harvard and MIT researchers had a large language model generate near-perfect driving directions around Manhattan, which looked, at a glance, like evidence the model had learned the city's street grid. Then they randomly blocked just 1% of the streets. Performance collapsed.4 The model hadn't built a map. It had learned a large collection of heuristics that happened to produce map-like answers most of the time. A real world model, one that had actually encoded the street network and how it connects, would have simply routed around the closures.

That's the core argument researchers make for why world models matter: pattern-matching can look like understanding right up until conditions shift, and then it falls apart.

Where did the idea of world models come from?

The idea is older than deep learning by decades. In 1943, psychologist Kenneth Craik proposed that organisms carry "a small-scale model of external reality" in their heads, letting them try out different actions mentally before committing to one in the real world.4 That single sentence is essentially the founding idea behind every world model built since.

The term itself entered machine learning in 1990, when Jürgen Schmidhuber described recurrent neural networks trained to predict future states from observations.1 The idea stayed mostly in reinforcement learning circles until 2018, when David Ha and Schmidhuber published "World Models," a paper that trained an agent to drive and play video games entirely inside a simulation the network had generated for itself, then transferred that learned behavior back to the real environment.15 It was, as Google has noted, the first time someone trained a world model from a visual domain and got it to work.5

The idea has since become a rallying point for some of the field's most prominent researchers. Yann LeCun at Meta, Demis Hassabis at Google DeepMind, and Yoshua Bengio at Mila have each argued, in different ways, that scaling up language models alone will not produce systems with real understanding or reliable safety guarantees. LeCun's 2022 paper, "A Path Towards Autonomous Machine Intelligence," proposed the Joint Embedding Predictive Architecture, or JEPA, as a structural alternative to text-only, purely generative prediction.143

How are world models actually built?

Strip away the jargon and most world models share a similar shape:

  • An encoder compresses raw input, whether that's video frames, sensor readings, or a program's execution trace, into a compact latent representation.
  • A predictor takes that representation plus a proposed action and estimates what the representation looks like next.
  • A simulator, in generative variants, decodes that predicted state back into something concrete: a video frame, a 3D scene, or a program's runtime state.16

Different research groups implement this differently. LeCun's JEPA predicts directly in latent space rather than generating pixel-perfect output, which is meant to make it more efficient and less prone to wasting effort on irrelevant detail.1 DreamerV3 uses a recurrent state-space model and became the first algorithm to collect diamonds in Minecraft from scratch using only its own internally imagined rollouts, with no human demonstrations.6 Google's Genie project takes yet another approach, predicting what happens next in an interactive environment frame by frame, with no game engine running underneath at all, based purely on the actions a user or agent takes.

World modeling for code: the Code World Model

The most concrete application of this idea to software is Meta's Code World Model, or CWM. It's a 32-billion-parameter, open-weights model trained not just on static source code but on Python interpreter traces and agentic Docker environment trajectories, meaning it learns from watching code actually execute, step by step, rather than only reading it as text. Choosing a model for internal engineering work is less about topping a leaderboard than fitting how your team actually operates, a point we cover in how to pick an AI model for internal tools. Still, CWM's benchmark numbers are strong:

  • 65.8% pass@1 on SWE-bench Verified with test-time scaling
  • 68.6% on LiveCodeBench
  • 96.6% on Math-500
  • 76.0% on AIME 2024
Figure 1
Code World Model (CWM) benchmark results
Math-50096.6%AIME 202476%LiveCodeBench68.6%SWE-bench Verified (pass@1, test-time scaling)65.8%
Benchmark figures for Meta's Code World Model as reported in the article; original Meta technical report not in the source pool.
Illustrative figure. Constructed for explanation, not a measured source.

A related line of research from Google DeepMind takes a slightly different tack. Instead of using a language model directly as the acting agent, researchers had it generate an entire executable simulator of a game environment, then handed that simulator to a planning algorithm like Monte Carlo Tree Search. This code-world-model approach consistently beat the simpler "LLM as the policy" baseline on perfect-information games, and it beat Gemini 2.5 Pro on most of the games tested.7 In some cases, a lighter-weight alternative worked almost as well: rather than learning a full simulator, an approach called AutoHarness evolves a small piece of verifier code that just catches an agent's illegal moves, pushing accuracy from under 99% up to a perfect 100% across a range of text-based games.7 A full world model is one point on a spectrum, not the only tool available.

Why does world modeling matter for coding agents?

Here's the practical problem coding agents run into today. A coding agent can read your repository. It cannot see your production database's actual data distribution, the quirks of a third-party API under load, feature flag states, queue depth, or how real users behave. The AI testing startup Checksum calls this gap the Context Void: the difference between what a coding agent observes and what actually governs a system's behavior at runtime.8

That gap has measurable costs. Checksum's research found that AI-generated code produces roughly 1.7 times more errors than human-written code, and that code review time has climbed 93% at companies leaning heavily on AI coding agents.8 Faster generation without better verification just moves the bottleneck from writing code to reviewing it, which is exactly the kind of drift an AI harness is supposed to keep in check.

Figure 2
The cost of the Context Void in AI-generated code
1.7×
More errors in AI-generated code vs. human-written code
93%
Increase in code review time at companies leaning on AI coding agents
Source: Checksum

A world model, applied to code, is an attempt to close that void directly: give the agent an internal simulation of runtime behavior so it can check its own work before a human, or a production incident, has to. This is close to the same logic behind giving agents better access to the systems around them in the first place, whether that's making internal documentation legible to an agent through structured formats or rethinking how software is built so it can be read and modified by the tools working on it, not just called through an API, as explored in our piece on extensible software.

What happens without a world model?

Two recent outages make the stakes concrete. In July 2024, CrowdStrike shipped a content update with a mismatch between 21 defined input fields and 20 provided ones, an inconsistency invisible from reading either file in isolation. It disrupted an estimated 8.5 million Windows devices.8 In November 2025, Cloudflare suffered a major outage triggered by a database permissions change that exposed a latent query bug, knocking out access to platforms including X, ChatGPT, Spotify, and Uber.8

Figure 3
Scale of the CrowdStrike outage
8.5 million
Windows devices disrupted by the July 2024 CrowdStrike content update
Source: Checksum

Neither failure was a syntax error. Both emerged from the interaction between subsystems that no amount of code review alone would have caught, because the bug only existed in the gap between components, not inside any single file. That's exactly the class of failure a working world model is meant to catch before deployment, by simulating how the pieces interact rather than inspecting them one at a time.

Where is world modeling headed?

The field is still young enough that there's no settled consensus on what counts as a real world model versus a well-disguised set of heuristics, and benchmarks for measuring genuine causal understanding, as opposed to memorized patterns, remain immature.4 Hallucination risk doesn't disappear just because a model is predicting states instead of tokens.

But the direction is clear enough. Coding agents that can only read text will keep producing code that looks right and breaks in production, because looking right and behaving right are different problems. Agents that can simulate execution, database state, and system interactions before shipping are working on the actual problem. That's a meaningful step toward software you can trust an agent to build largely on its own, which matters most for teams trying to own more of their software stack rather than rent it, since owning code you can't verify is not much of an improvement over renting a tool you can't inspect. Platforms like Remy are built around that same premise: the software your team builds should be something you can actually trust and stand behind, not just something that compiled.

World modeling won't replace testing, staging environments, or human review anytime soon. What it offers is a way for an agent to catch its own mistakes earlier, closer to the moment it writes the code, rather than after it's already live.

Frequently asked
Questions readers ask
What is a world model in AI, in simple terms?

It's an AI system that builds an internal picture of an environment and predicts how that environment will change in response to an action, rather than just generating outputs based on learned patterns.12

How is a world model different from a large language model?

A large language model predicts the next word in a sequence based on patterns in text. A world model predicts the next state of an environment given an action, which requires tracking something closer to cause and effect rather than just linguistic likelihood.13

What is Meta's Code World Model?

CWM is a 32-billion-parameter open-weights model trained on code execution traces and agentic environment trajectories, not just static source code, so it can reason about how a program behaves when it runs, not just how it reads.

Why do coding agents need a world model instead of just reading code?

Coding agents that only read source code can't see runtime factors like database state, API behavior, or feature flags. This gap, sometimes called the Context Void, is a proposed reason AI-written code causes production incidents even as generation speeds up.8

Is AI world modeling a new idea?

No. The underlying concept traces back to a 1943 psychology paper by Kenneth Craik, and the term entered machine learning in 1990. It was revived for deep learning in a landmark 2018 paper by David Ha and Jürgen Schmidhuber.14

Sources
  1. 1World model (artificial intelligence)Wikipedia
  2. 2What Is a World Model? | NVIDIA GlossaryNVIDIA
  3. 3The World Model and Spatial Intelligence Era: Governing AI Beyond LanguageStanford HAI
  4. 4'World Models,' an Old Idea in AI, Mount a ComebackQuanta Magazine
  5. 5Ask a Techspert: What's a world model?Google (The Keyword)
  6. 6What are World Models?Turing Post
  7. 7Code World Models and AutoHarness for LLM AgentsSnorkel AI
  8. 8Continuous Quality: Building a world model for softwareChecksum
Portrait of Lena Ortiz
Lena Ortiz
Software Ownership
Lena makes the case for owning the software your company runs on.
More from Lena Ortiz
© 2026 The Official Remy BlogDrafted by AI authors, reviewed by human editors.