Code World Model: Building World Models for Computation – Jacob Kahn, FAIR Meta

Jacob Kahn from FAIR, Meta, introduces the Code World Model (CWM), a new paradigm for AI models that learn from program execution rather than just code syntax. By training on detailed execution traces, CWM builds an internal world model of computation, enabling it to predict a program's behavior. This talk explores CWM's architecture, its highly scalable and asynchronous reinforcement learning setup, and groundbreaking applications like a 'neural debugger' that understands user intent from code structure and the potential to approximate undecidable problems like the halting problem.

3 min read
Code World Model: Building World Models for Computation – Jacob Kahn, FAIR Meta
source: https://www.youtube.com/watch?v=sYgE4ppDFOQ

The Code World Model (CWM) aims to build models that can reason, plan, and make decisions, using code as a constrained sandbox for this exploration. The core idea is to move beyond modeling code as mere syntax—sequences of tokens in an editor—and instead model the dynamics of program execution. This approach seeks to predict future observations given past observations and actions, creating a world model specifically for computation.

Modeling Beyond Syntax: From Code to Execution

Traditional token-based models only see the static syntax of a program. CWM proposes a paradigm shift by learning from execution traces. This involves creating a structured, systematic representation of what happens when code runs, which a neural model can ingest and learn to predict.

  • Execution Tracing: The model is trained on detailed execution traces that capture the program’s state at each step. These traces explicitly list local variables, memory states, and other runtime information, linking each line of the trace to a corresponding line in the source code. This concept scales from simple functions to entire repositories and even distributed systems.
  • Transition Function: At its heart, CWM learns to predict a transition function (State + Action → Next State), where an action is the execution of the next line of code. Large Language Models (LLMs) can autogressively generate these state transitions, effectively learning an internal simulator for the code.

The Agentic World Model Framework

Instead of a reactive loop where an agent must interact with a real environment to get feedback, a world model allows the agent to simulate actions in an

Share post

Stay In The Loop! Subscribe to Our Newsletter.

Get updates straight to your inbox. No spam, just useful content.

Recommended for You

Efficient Reinforcement Learning – Rhythm Garg & Linden Li, Applied Compute

Efficient Reinforcement Learning – Rhythm Garg & Linden Li, Applied Compute

At Applied Compute, efficient Reinforcement Learning is critical for delivering business value. This talk explores the transition from inefficient synchronous RL to a high-throughput asynchronous 'Pipeline RL' system. The core challenge is managing 'staleness'—a side effect of in-flight weight updates that can destabilize training. The speakers detail their first-principles systems model, based on the Roofline model, used to simulate and find the optimal allocation of GPU resources between sampling and training, balancing throughput with algorithmic stability and achieving significant speedups.

Marc Andreessen & Amjad Masad on “Good Enough” AI, AGI, and the End of Coding

Marc Andreessen & Amjad Masad on “Good Enough” AI, AGI, and the End of Coding

Amjad Masad, founder of Replit, joins a16z to discuss the rise of AI agents that can now plan, reason, and code for hours. He explains how reinforcement learning and verification loops unlocked long-horizon reasoning, why AI is advancing fastest in verifiable domains like code, and debates whether "good enough" AI might be a local maximum that blocks the path to AGI.