Core Concepts
Understanding WorldFlux architecture and key components.
Reference / Deprecated onboarding page
This page is retained for backward compatibility and deep background reading. For the supported onboarding path, use Installation and Quick Start.
What Is a World Model?
A world model is a neural network that learns to predict how an environment evolves. It enables:
- Planning: Predict outcomes without direct environment interaction
- Imagination: Generate synthetic experience for training
- Efficient Learning: Learn from fewer real interactions
Architecture Overview
Key Components
Encoder
Compresses high-dimensional observations into compact latent representations.
state = model.encode(obs) # [B, *obs_shape] -> State
State
Core representation that captures environment state:
# DreamerV3
state.tensors["deter"]
state.tensors["stoch"]
# TD-MPC2
state.tensors["latent"]
Dynamics Model
Predicts next latent state from current state and action:
next_state = model.transition(state, action)
next_state = model.update(state, action, obs)
Decoder
Reconstructs observations and predicts rewards from latent states:
output = model.decode(state)
preds = output.preds
Imagination Rollouts
trajectory = model.rollout(initial_state, actions)
# trajectory.states
# trajectory.rewards
# trajectory.continues
Training Loop
World models learn from trajectories:
- Collect trajectories (obs, actions, rewards, dones)
- Store in
ReplayBuffer - Sample batches
- Compute losses
- Update model
- Repeat