LESSON wm.0.3 · Code · 140 min

Build the smallest working world model

Build the smallest working world model. Learn GridWorld, action-conditioned dynamics, rollout, and model-predictive control and complete: Train a next-state predictor and plan acti

Learning objectives

  1. Explain what problem “Build the smallest working world model” solves without hiding behind terminology.
  2. Trace the variables and causal links across GridWorld, action-conditioned dynamics, rollout.
  3. Complete “Train a next-state predictor and plan actions through imagination” and judge the result with evidence rather than intuition.

Core concepts

GridWorld

GridWorld sends candidate actions through a learned transition model to predict later states or observations. Model-predictive control scores complete trajectories, executes only the current action, and replans after the next observation; report both one-step error and multi-step failure rate.

action-conditioned dynamics

action-conditioned dynamics sends candidate actions through a learned transition model to predict later states or observations. Model-predictive control scores complete trajectories, executes only the current action, and replans after the next observation; report both one-step error and multi-step failure rate.

rollout

rollout sends candidate actions through a learned transition model to predict later states or observations. Model-predictive control scores complete trajectories, executes only the current action, and replans after the next observation; report both one-step error and multi-step failure rate.

and model-predictive control

and model-predictive control sends candidate actions through a learned transition model to predict later states or observations. Model-predictive control scores complete trajectories, executes only the current action, and replans after the next observation; report both one-step error and multi-step failure rate.

Build and verify

Train a next-state predictor and plan actions through imagination

  • Predict: write the expected output, trend, or failure before running code.
  • Build: implement only the minimum components needed to answer the question.
  • Verify: compare with a baseline or trusted implementation; save seeds, parameters, and raw outputs.
  • Transfer: change one shape, dataset, scale, or workload condition and explain whether the conclusion still holds.

Open the complete interactive lesson