Foundations — Policy gradient methods
This page assumes you have seen nothing. Every letter in the parent note Policy gradient methods is unpacked below, in an order where each idea leans only on the ones before it. If a symbol confused you upstairs, its full story is here.
0. The reinforcement-learning stage (the picture everything lives on)

Before any symbol, look at the loop in the figure. There is an agent (the learner) and an environment (the world). At each tick of the clock:
- The environment shows the agent a situation — we call it a state.
- The agent picks a move — an action.
- The environment answers with a score — a reward — and a new situation.
Everything below is just careful names for the arrows in this loop. Keep this picture in mind; every symbol is a label on one of these arrows.
1. State — "where am I?"
- Picture: the "situation" box in the loop above.
- Why the topic needs it: the policy must decide based on something. That something is . Without a state there is no "given" to condition on.
2. Action — "what do I do?"
- Picture: the arrow the agent chooses to fire.
- Two flavours (this distinction is the whole reason policy gradients exist):
- Discrete — finitely many moves (left / right / jump).
- Continuous — a knob you can turn to any real number (steering angle ). There are infinitely many such actions.
- Why the topic needs it: Value-based methods (Q-learning) must scan every action to find the best one. With infinitely many actions that scan is impossible — this is exactly why we learn the policy directly instead.
3. Reward and return — "was that good?"
The little subscript just means "the reward at time-step number " ().
Let us earn every symbol in that formula.
- — the big Greek "S" (, sigma) means "add up". The label underneath () and on top () say "let run from to and add every term". So this is -at-step-0 plus -at-step-1 plus ... up to step .
- — the last time-step (the end of the episode).
- (Greek gamma) — the discount factor, a number between and .
- — gamma multiplied by itself times. Because , this shrinks as grows.

4. Trajectory — "the whole story of one run"
- Picture: unroll the loop of §0 into a single left-to-right chain.
- Why the topic needs it: the return is a property of the whole run, so we must name the run itself. is that name.
5. The policy — the star of the show
This is the single most important symbol. We build it piece by piece.
The bar . Read as " given " — "the action, given we are in state ". The bar means "conditioned on".
The letter (Greek pi) is just the traditional name for a policy; here it does not mean .
- Picture: a set of dice, one per state, whose faces are the actions. Roll the dice to pick your move.
A probability distribution is just a bar chart of non-negative bars that add up to (there is a chance you pick some action).

6. The parameters — the shape of the dice
- Picture: knobs on the side of the dice-machine. Turn a knob → the bar chart in the figure above tilts.
- Why the topic needs it: learning = searching for the best . The subscript in shouts "this policy is controlled by ".
7. Expectation — "the average outcome"
- The squiggle means "is sampled from" — "" = " is a random run generated by the policy".
- Why the topic needs it: we cannot see every possible run — there are too many. So we settle for the average run. The whole objective is "the average return".
- Estimating it: replace the true average by the average of sampled runs. This Monte-Carlo idea is expanded in Variance reduction in Monte Carlo.
8. The objective — "how good is this policy?"
- Picture: a single height. Slide the knobs and this height goes up or down — we want the tallest spot.
- Why the topic needs it: you can only optimize what you can score. is the score.
9. The gradient — "which way is uphill?"
The upside-down triangle (called nabla or del) is the workhorse of learning.
- Picture: stand on a hill ; is the compass arrow pointing straight uphill.
- Gradient ascent: the update takes a small step uphill. The little (alpha) is the step size (how far each step goes).
- Why the topic needs it: the entire game of the parent note is computing this arrow when hides its inside a random process.
10. Logarithm and the log-derivative trick
The parent's key move uses . Here is the honest picture.
You do not need to master this here — the parent derivation walks it fully. You only need the one slope fact above.
11. Baseline , value , advantage — the variance fighters
These are the "part 2" symbols. Short pictures now; full stories in Advantage function and Actor-Critic methods.
- Reward-to-go — the return counted from time onward only: . Picture: the shrinking-bars figure, but starting at bar instead of bar .
- Value — the average reward-to-go you'd expect starting from state . Picture: the "typical height" of a state.
- Baseline — any number you subtract that depends only on the state, not the action. Subtracting it does not bias the gradient (it averages to zero).
- Advantage — "how much better than average was this specific action?" Positive = above average, negative = below. Picture: the height of one action's bar measured from the state's average line.
Prerequisite map
Read it top-down: the raw pieces (state, action, parameters) build the policy; the policy plus reward build trajectories; averaging over trajectories gives the objective; the gradient of that objective, powered by the log-derivative trick and tamed by baselines, is the policy gradient theorem.
Equipment checklist
Cover the right side and answer aloud; reveal to check.
What does the bar in mean?
What is a policy , in one phrase?
What do the parameters physically control?
What does tell you to do?
Why is there a in the return?
What is a trajectory ?
What does mean?
What is ?
What is and which way does it point?
Ascent or descent, and why?
State the one calculus fact behind the log-derivative trick.
What does the advantage measure?
Connections
- Parent: Policy gradient methods — this page unpacks every symbol it assumes.
- Log-derivative trick and Score function estimator — the calculus at the heart.
- Variance reduction in Monte Carlo — why baselines and reward-to-go matter.
- Advantage function, Actor-Critic methods — where and grow up.
- Value-based methods (Q-learning) — the contrast that motivates learning directly.