Notes

Model-Free RL

Model-free RL learns how to act directly from experience, without first building an explicit internal simulator of how the world works. Think of an agent learning to ride a bike by noticing which movements keep it balanced, rather than writing down equations for gravity, friction, and steering.

What it learns instead of a model
A model-based agent tries to learn environment dynamics: “from this state, if I take this action, what state and reward come next?” A model-free agent skips that prediction problem and learns one of two things directly from reward:

  • a value function, estimating how rewarding an action or state will be over the future; or
  • a policy, mapping observations directly to action choices.

For example, DQN learns action values and chooses actions with high estimated return. PPO directly improves a policy toward actions that produced better-than-expected outcomes. Neither needs a learned model of the game’s physics or transition rules.

How experience becomes learning
The agent acts, receives a reward and a new observation, then adjusts its values or policy. A key mechanism is bootstrapping: an estimate is updated partly from a later estimate, as in “this move gave reward 1, and the next situation still looks promising.” This makes learning practical in large environments, but errors can feed into later errors. Sparse rewards also make credit assignment difficult: an agent might finish a maze successfully yet need many trials to discover which earlier turns mattered.

Why the distinction matters
Model-free methods avoid the hard task of accurately modeling complex or unknown dynamics, which makes them attractive for environments such as Gymnasium tasks and MuJoCo control benchmarks. Their trade-off is sample efficiency: they generally need many real interactions because they cannot mentally test hypothetical action sequences using a learned model. They can also exploit accidental reward loopholes—for instance, repeatedly collecting a small unintended reward instead of completing the intended task. Good exploration, reward design, and stable value or policy updates are therefore central to making model-free learning work.

Model-Free RL learns a policy or value function directly from experienced rewards and transitions, without learning an explicit model of the environment’s dynamics or reward process. Methods such as Q-learning and policy gradients improve behavior from interaction data alone. It matters because it enables control when accurate environment models are unavailable, though learning can require substantial trial-and-error experience.

Imagine learning to ride a skateboard without anyone explaining the physics. You try shifting your weight, notice what makes you stay balanced, and remember what sends you wobbling. Over time, you get better simply from experience.

Model-free RL works this way. “Model-free” means the software does not first build a detailed internal picture of how its world works or predict every consequence. Instead, it tries actions, sees the rewards or setbacks, and gradually learns which choices tend to pay off.

This is useful when the world is too complicated to map out fully—such as a game, a robot’s movements, or changing traffic conditions.