Sample efficiency: Real-world interactions are expensive (robot might break, medical trial costs lives). Simulate rollouts in your head (model) instead.
Planning: With a model, you can "think ahead" by simulating future trajectories before acting (like chess players visualizing moves).
Transfer: A good world model captures environment dynamics that transfer across tasks (same physics, different goals).
How is this different from model-free RL?
Model-free (DQN, PPO): Learns Q(s,a) or π(a∣s) directly from trial-and-error. No explicit understanding of consequences.
Model-based: Learns p(st+1∣st,at)first, then uses it to plan or train a policy. Understands "if I push this, it will fall."
Grounding: Abstract concepts (e.g., "heavy") are learned through physical interaction, not definitions
Affordances: What you can do depends on your body (a quadruped can't open doors the way a humanoid can)
Exploration: Embodied agents naturally explore by moving, manipulating, trying—this generates diverse data
Partial observability: Real bodies have limited sensors → agent must actively gather information
Historical context: Classical AI (GOFAI) tried to build intelligence via logic and symbols. The embodied cognition movement argued this ignores how biological intelligence is inseparable from the body.
The seminal World Models paper proposed a three-component architecture:
V (Vision): Variational autoencoder learns latent representation zt of observation otzt=Encoder(ot),ot≈Decoder(zt)
M (Memory): Mixture Density Network RNN predicts next latent state
P(zt+1∣zt,at,ht)=∑i=1KπiN(μi,σi2)
where ht is RNN hidden state.
C (Controller): Small linear policy at=Wzt+Whht+b
Why this architecture?
V compresses high-dim observations (pixels) → low-dim zt (like "there's a car ahead")
M learns temporal dynamics → predicts future zt+1 (like "if I steer left, the car will move right in my view")
C is tiny because it operates on abstract zt, not raw pixels → easy to optimize
Key innovation: Train M on real trajectories, then train C entirely inside M's dream (simulated rollouts). No real environment needed after collecting initial data.
Derivation of M's loss:
We want P(zt+1∣zt,at). Use maximum likelihood:
LM=−logPM(zt+1∣zt,at,ht)
For the Mixture Density Network:
PM(zt+1)=∑i=1Kπi(zt,at,ht)⋅N(zt+1;μi,σi2)
Why mixture of Gaussians? Because the future is stochastic and multimodal (e.g., a car might turn left OR right). A single Gaussian would predict the average (going straight), which is wrong.
The negative log-likelihood:
LM=−log(∑i=1Kπiexp(−2σi2(zt+1−μi)2))
Why this loss? It's the cross-entropy between the true next state distribution and our model's prediction. Minimizing it makes the model match reality.
Imitation-Learning: Behavioral cloning ignores world models; inverse RL can learn reward, then use model to plan
Sim-to-Real-Transfer: Embodied AI must bridge the "reality gap" between simulated world models and real physics
Vision-Transformers: Modern V components might useViT encoders instead of CNs/VAEs for better representation
Diffusion-Models: Emerging approach for generative world models (predict future frames as denoising process)
Recall Explain to a12-Year-Old
Imagine you're learning to ride a bike. At first, you fall a lot because you don't know what happens when you turn the handlebars or pedal faster. But your brain is building a mental model: "If I turn left, the bike goes left. If I pedal hard going uphill, I slow down less."
After enough practice, you can imagine what will happen before you do it. You see a turn coming and think "If I lean and turn now, I'll make it smoothly." You're planning in your head using your model of bike physics.
That's a world model! It's your brain's simulator. World models in AI are the same: the robot learns how its body and the environment work, then "thinks ahead" by simulating actions in its mind before doing them in real life.
Embodied AI means the robot has a body (not just a brain in a computer). It learns by doing—pushing things, moving around, touching objects—just like you learned by actually riding the bike, not by reading a book about it. The body and experience are essential to being smart.
#flashcards/ai-ml
What is a world model in reinforcement learning? :: A learned probabilistic model p(st+1,rt∣st,at) that predicts next state and reward given current state and action—an internal simulation of environment dynamics.
Why do world models improve sample efficiency?
They allow agents to simulate rollouts internally instead of requiring real environment interactions, which are often expensive or dangerous in real-world settings.
What are the three components of the World Models architecture?
V (Vision/VAE encoder), M (Memory/RNN dynamics model), C (Controller/policy)—V compresses observations, M predicts future latents, C outputs actions.
What is embodied AI?
AI systems that have a physical or simulated body and learn through sensorimotor interaction with rich environments, not just abstract symbolic reasoning or text processing.
Why do world model errors compound over long rollouts?
Each prediction depends on the previous, so error ϵM at step t affects all future steps—total error grows as ϵM⋅H where H is horizon length.
What is the Dyna architecture?
A framework that combines model-free RL updates from real experience with model-based updates from simulated experience generated by the world model.
What is the distributional shift problem in world models?
When a model is trained on expert data but used by a learner policy that visits different states, the model has no data in the learner's distribution and makes poor predictions.
How does a Mixture Density Network handle stochasticity?
It predicts multiple Gaussian components ∑iπiN(μi,σi2) to represent multimodal futures instead of averaging to a single incorrect prediction.
Why use short rollouts instead of long ones in model-based RL?
Model errors compound exponentially—short k-step rollouts keep predictions accurate, then fall back to model-free value estimates for long-term planning.
What is the difference between model-free and model-based RL?
Model-free learns policy/value directly from trial-and-error; model-based explicitly learns environment dynamics P(s′∣s,a) first, then plans or trains policy using the model.
Dekho, yaha pe sabse important cheez ye samajhna hai ki world model kya karta hai. Normal reflex jaisa AI hota hai jo bas "agar X dikhe to Y karo" seekh leta hai — bina samjhe ki actually ho kya raha hai. Par world model iske ulta kaam karta hai: ye apne andar ek chhota sa "physics engine" ya mental simulation banata hai, jisse wo predict kar sakta hai ki "agar main Y action karunga, to next state kya hoga aur kitna reward milega." Formally isko hum p(st+1,rt∣st,at) likhte hai — matlab current state aur action dekh kar agla state aur reward guess karna. Embodied AI ka matlab hai ki agent ke paas ek body hoti hai (real ya simulated), aur usse seekhne ke liye actually kuch karna padta hai, sirf text padhna kaafi nahi.
Ab ye matter kyu karta hai? Do bade reasons hai. Pehla — sample efficiency. Real world me interaction mehenga hota hai; robot toot sakta hai, ya medical trial me zindagi ka risk hota hai. Agar agent apne andar hi rollouts simulate kar le (apne model me), to wo bina real damage ke practice kar sakta hai. Dusra — planning. Jaise chess player pehle mind me chaal socha karta hai, waise hi model hone se agent future trajectories ko simulate karke best action choose kar sakta hai commit karne se pehle. Isi ko Model Predictive Control (MPC) kehte hai, jaha hum aisa action sequence dhoondte hai jo simulated future me maximum total reward de.
Technically, kyunki model stochastic hota hai, har future state random hota hai, isliye hum saare possible futures pe unki probability ke hisaab se average lete hai (expectation). Practically hum K trajectories sample karte hai, unke returns ka average nikalte hai, aur actions ko optimize karte hai — ya to gradient descent se (agar model differentiable ho) ya shooting methods jaise CEM se. Bottom line ye samajh lo: world model se hum reality me galti karne se pehle "dimag me" hi try karke dekh lete hai kaunsa action best hai. Yahi cheez ise plain model-free RL (jaise DQN, PPO) se zyada powerful aur transferable banati hai, kyunki ek achha world model environment ki physics capture kar leta hai jo alag-alag tasks me kaam aati hai.