Policies as Trainable Objects

Value-based methods learn a map from situations to action values. DQN asks, "how good would each action be here?" Policy-gradient methods start from a different instinct: do not learn the whole value map first; directly tune the chooser.

A policy is written πθ(a∣s)\pi_\theta(a\mid s), the probability that a policy with parameters θ\theta takes action aa in state ss. In a discrete task, the policy might output probabilities for left, right, and wait. In a continuous-control task, it might output a steering angle or a distribution over motor commands.

PPO setup diagram showing a trainable policy producing actions, receiving rewards, and updating from sampled experience.
As opposed to value-based deep RL, which essentially learns a big map, PPO asks: can we get better at choosing by tuning the policy instead?

Policy gradients

What is the model learning?

Use the same state. Switch representations to see the difference between learning action values and learning the chooser directly.

State

A robot is one step from a charging dock. It can move left, move right, or wait.

πθ(a∣s)\pi_\theta(a\mid s)

Output the chooser directly

left
18%
right
67%
wait
15%
The policy is the trainable object: changing the parameters changes the action probabilities themselves.
Policy-gradient methods optimize the parameters of the behavior policy itself: πθ(a | s).

The objective is expected return under the current policy:

J(θ)=Eτ∼πθ[G0]J(\theta)=\mathbb E_{\tau\sim\pi_\theta}[G_0]

Here τ\tau is a trajectory generated by following the policy, and G0G_0 is the return from the start of that trajectory. Training changes θ\theta so trajectories sampled from πθ\pi_\theta tend to receive higher return.

ℹ

Why Direct Policy Learning Can Feel Natural

If the action is continuous, such as a steering angle, scoring every possible action is awkward. A policy can directly output a useful action distribution instead of enumerating an enormous action list.

Checkpoint

What does πθ(a∣s)\pi_\theta(a\mid s) mean in a policy-gradient method?