The policy becomes the object being learned
Instead of estimating the value of each action and then choosing the best, a policy-based agent represents the policy itself as \(\pi_\theta(a \mid s)\) and adjusts the parameters \(\theta\) so that actions leading to higher return become more probable. There is no separate value table driving the decision.
Why the update looks like a weighted nudge
The gradient estimate \(\nabla_\theta J(\theta) \approx \sum_t \nabla_\theta \log \pi_\theta(a_t \mid s_t)\, G_t\) has two factors. The first, \(\nabla_\theta \log \pi_\theta(a_t \mid s_t)\), is the direction in parameter space that increases the probability of the action that was taken. The second, \(G_t\), is the return that followed. Multiplying them means the parameter step is large and positive when a high-return action was taken, and reversed when the return was negative. The agent is not told which action was correct; it is told how good the outcome was, and the gradient machinery distributes credit to the actions that preceded it.
Where the two families differ
Value-based (Q-learning)
- Learns \(Q(s,a)\), then acts greedily on it
- Policy is implicit and derived after the fact
- Needs a finite set of actions to take a maximum over
- Reuses each transition to update one value estimate
Policy-based (policy gradient)
- Learns \(\pi_\theta(a \mid s)\) directly
- No value table needed for action selection
- Handles continuous actions by outputting distribution parameters
- Can represent stochastic policies such as 0.7/0.3
A continuous control case
Consider a robot arm that must choose a joint torque, a real number anywhere from \(-5\) to \(5\). A value-based agent would need to score infinitely many torques and pick the maximum, which is not directly possible without discretizing the range and losing precision. A policy-based agent can output the mean and standard deviation of a Gaussian over torques, and the gradient update shifts that mean toward torques that produced higher return. The action space never had to be enumerated.