Skip to content

World Modelling

World modelling is the stage that turns environment experience into a predictive model of what can happen next.

In this project, the world model does not need to discover every legal move from scratch. The current pipeline separates exact legal structure from learned probabilities.

The exact legal graph stores:

  • public states that can occur,
  • legal joint actions at those states,
  • legal successor states for each state-action pair.

This structure is saved as:

exports/.../wm/legal_joint_graph.pkl

The graph is exact for the supported environments used by the main notebooks.

Learned Dynamics

The neural world model predicts:

  • next-state bits,
  • rewards for agents,
  • transition probabilities used to annotate graph edges.

The trained model checkpoint is saved as:

exports/.../wm/world_model.pt

The graph annotated with learned environment probabilities and rewards is saved as:

exports/.../wm/env_transition_graph.pkl

That second graph is the main handoff into opponent modelling and shielding.

Why This Split Helps

Keeping legal structure separate from learned probabilities makes failures easier to understand.

If a state or action is missing from the exact graph, that is usually an environment integration issue. If the transition probabilities are poor, that is a model-training or data issue.

This distinction is especially useful for shielding, where missing legal coverage must be treated conservatively.