Papers · Reinforcement learning and alignment · 2015

High-Dimensional Continuous Control Using Generalized Advantage Estimation

John Schulman, Philipp Moritz, Sergey Levine and others

The notation of the GAE paper, explained: its 36 displayed equations, then every symbol it uses, grouped by category and shown the way the paper writes it.

Read the paper on arXiv

Reading this paper

GAE: estimate the advantage in policy-gradient methods as an exponentially weighted sum of one-step errors, trading bias for variance with a single parameter λ\lambda.

δtV=rt+γV(st+1)−V(st)\delta_t^V = r_t + \gamma V(s_{t+1}) - V(s_t) is the temporal-difference error; the superscript VV is a label naming the value function used, not a power. Likewise A^tGAE(γ,λ)\hat{A}_t^{\mathrm{GAE}(\gamma, \lambda)} labels the estimator by its two parameters. (γλ)l(\gamma\lambda)^l, though, is a real power.

Read from arXiv's HTML version: 36 displayed equations and 158 pieces of inline math. 53 symbols and constructs from the catalog, read as reinforcement learning.

The paper's displayed equations

Open any of them in the decoder for a symbol-by-symbol reading.

  1. (1)
    g=E[∑t=0∞Ψt∇θlog⁡πθ(at ∣ st)],g=\mathbb{E}\left[\sum_{t=0}^{\infty}\Psi_{t}\nabla_{\theta}\log\pi_{\theta}(a_{t}\>|\>s_{t})\right],
    Decode →
  2. (2)
    Vπ(st):=Est+1:∞,at:∞[∑l=0∞rt+l]Qπ(st,at):=Est+1:∞,at+1:∞[∑l=0∞rt+l]V^{\pi}(s_{t}) \vcentcolon=\mathbb{E}_{\begin{subarray}{c}s_{t+1:\infty},\\ a_{t:\infty}\end{subarray}}\left[\sum_{l=0}^{\infty}r_{t+l}\right] Q^{\pi}(s_{t},a_{t})\vcentcolon=\mathbb{E}_{\begin{subarray}{c}s_{t+1:\infty},\\ a_{t+1:\infty}\end{subarray}}\left[\sum_{l=0}^{\infty}r_{t+l}\right]
    Decode →
  3. (3)
    Aπ(st,at):=Qπ(st,at)−Vπ(st),(Advantage function).A^{\pi}(s_{t},a_{t}) \vcentcolon=Q^{\pi}(s_{t},a_{t})-V^{\pi}(s_{t}),\quad\text{(Advantage function)}.
    Decode →
  4. (4)
    Vπ,γ(st):=Est+1:∞,at:∞[∑l=0∞γlrt+l]Qπ,γ(st,at):=Est+1:∞,at+1:∞[∑l=0∞γlrt+l]V^{\pi,\gamma}(s_{t}) \vcentcolon=\mathbb{E}_{\begin{subarray}{c}s_{t+1:\infty},\\ a_{t:\infty}\end{subarray}}\left[\sum_{l=0}^{\infty}\gamma^{l}r_{t+l}\right] Q^{\pi,\gamma}(s_{t},a_{t})\vcentcolon=\mathbb{E}_{\begin{subarray}{c}s_{t+1:\infty},\\ a_{t+1:\infty}\end{subarray}}\left[\sum_{l=0}^{\infty}\gamma^{l}r_{t+l}\right]
    Decode →
  5. (5)
    Aπ,γ(st,at):=Qπ,γ(st,at)−Vπ,γ(st).A^{\pi,\gamma}(s_{t},a_{t}) \vcentcolon=Q^{\pi,\gamma}(s_{t},a_{t})-V^{\pi,\gamma}(s_{t}).
    Decode →
  6. (6)
    gγ:=Es0:∞a0:∞[∑t=0∞Aπ,γ(st,at)∇θlog⁡πθ(at ∣ st)].g^{\gamma} \vcentcolon=\mathbb{E}_{\begin{subarray}{c}s_{0:\infty}\\ a_{0:\infty}\end{subarray}}\left[\sum_{t=0}^{\infty}A^{\pi,\gamma}(s_{t},a_{t})\nabla_{\theta}\log\pi_{\theta}(a_{t}\>|\>s_{t})\right].
    Decode →
  7. (7)
    Es0:∞a0:∞[A^t(s0:∞,a0:∞)∇θlog⁡πθ(at ∣ st)]=Es0:∞a0:∞[Aπ,γ(st,at)∇θlog⁡πθ(at ∣ st)].\mathbb{E}_{\begin{subarray}{c}s_{0:\infty}\\ a_{0:\infty}\end{subarray}}\left[\hat{A}_{t}(s_{0:\infty},a_{0:\infty})\nabla_{\theta}\log\pi_{\theta}(a_{t}\>|\>s_{t})\right]=\mathbb{E}_{\begin{subarray}{c}s_{0:\infty}\\ a_{0:\infty}\end{subarray}}\left[A^{\pi,\gamma}(s_{t},a_{t})\nabla_{\theta}\log\pi_{\theta}(a_{t}\>|\>s_{t})\right].
    Decode →
  8. (8)
    Es0:∞a0:∞[∑t=0∞A^t(s0:∞,a0:∞)∇θlog⁡πθ(at ∣ st)]=gγ\mathbb{E}_{\begin{subarray}{c}s_{0:\infty}\\ a_{0:\infty}\end{subarray}}\left[\sum_{t=0}^{\infty}\hat{A}_{t}(s_{0:\infty},a_{0:\infty})\nabla_{\theta}\log\pi_{\theta}(a_{t}\>|\>s_{t})\right]=g^{\gamma}
    Decode →
  9. (9)
    g^=1N∑n=1N∑t=0∞A^tn∇θlog⁡πθ(atn ∣ stn)\hat{g}=\frac{1}{N}\sum_{n=1}^{N}\sum_{t=0}^{\infty}\hat{A}_{t}^{n}\nabla_{\theta}\log\pi_{\theta}(a_{t}^{n}\>|\>s_{t}^{n})
    Decode →
  10. (10)
    Est+1[δtVπ,γ]=Est+1[rt+γVπ,γ(st+1)−Vπ,γ(st)]=Est+1[Qπ,γ(st,at)−Vπ,γ(st)]=Aπ,γ(st,at).\begin{gathered}\mathbb{E}_{s_{t+1}}\left[\delta^{V^{\pi,\gamma}}_{t}\right] =\mathbb{E}_{s_{t+1}}\left[r_{t}+\gamma V^{\pi,\gamma}(s_{t+1})-V^{\pi,\gamma}(s_{t})\right] \\ =\mathbb{E}_{s_{t+1}}\left[Q^{\pi,\gamma}(s_{t},a_{t})-V^{\pi,\gamma}(s_{t})\right]=A^{\pi,\gamma}(s_{t},a_{t}).\end{gathered}
    Decode →
  11. (11)
    A^t(1):=δtV=−V(st)+rt+γV(st+1)\hat{A}_{t}^{(1)} \vcentcolon=\delta^{V}_{t} =-V(s_{t})+r_{t}+\gamma V(s_{t+1})
    Decode →
  12. (12)
    A^t(2):=δtV+γδt+1V=−V(st)+rt+γrt+1+γ2V(st+2)\hat{A}_{t}^{(2)} \vcentcolon=\delta^{V}_{t}+\gamma\delta^{V}_{t+1} =-V(s_{t})+r_{t}+\gamma r_{t+1}+\gamma^{2}V(s_{t+2})
    Decode →

Symbols, by category

Most used first. The examples are written as the paper writes them.

Notation conventions

  1. Ψt\Psi_{t}, πθ\pi_{\theta}, ata_{t}

    Subscript (index or label) 502 uses

    A subscript picks an element (xᵢ), a time step (h_t), a named copy (W_q), or the parameters (p_θ).

  2. VπV^{\pi}, QπQ^{\pi}, AπA^{\pi}

    Superscript (power or label) 146 uses

    Usually a power (x² = x·x), but a capital or a word up there is often just a label (W^Q).

  3. gg, NN, nn

    Italic letters (variables) 92 uses

    A plain italic letter is a variable; conventions say what kind (x input, y target, W weights…).

  4. A^\hat{A}, g^\hat{g}, V^\hat{V}

    Hat (estimate) 43 uses

    A hat marks an estimate or prediction: ŷ is the model’s guess for y.

  5. γl\gamma^{l}, A^t(1)\hat{A}_{t}^{(1)}, A^t(2)\hat{A}_{t}^{(2)}

    Superscript in parentheses 31 uses

    An index in a superscript: x⁽ⁱ⁾ is the i-th training example, W⁽ˡ⁾ the weights of layer l. Not a power.

  6. r~\tilde{r}, Q~\tilde{Q}, V~\tilde{V}

    Tilde accent 16 uses

    A modified version of the variable: noisy, corrupted, proposed or intermediate.

  7. …\dots

    Dots (ellipsis) 12 uses

    “And so on”: continue the pattern.

  8. D‾\overline{D}

    Bar (mean) 2 uses

    A bar usually marks an average: x̄ is the mean of the x values.

  9. batch\mathrm{batch}

    Multi-letter names 1 use

    A run of italic letters like pos or model is usually one name, not a product of single letters.

Greek letters

  1. γ\gamma

    Gamma 148 uses

    The discount factor in reinforcement learning, or the learned scale in normalization layers.

  2. π\pi

    Pi 103 uses

    A policy π(a | s) in reinforcement learning, or the constant 3.14159…

  3. θ\theta

    Theta 73 uses

    The model’s parameters: all of its weights and biases, as one collection.

  4. λ\lambda

    Lambda 72 uses

    Usually the strength of a regularization term; also eigenvalues.

  5. Φ\Phi, ϕ\phi

    Phi 38 uses

    The parameters of a second model (often the encoder q_φ), or a feature map φ(x).

  6. δ\delta

    Delta (lowercase) 36 uses

    A small change, or the error signal δ = ∂L/∂z in backpropagation.

  7. Ψ\Psi

    Psi 5 uses

    The parameters of a third network (after θ and φ), a feature map, or the digamma function ψ(x).

  8. χ\chi

    Chi 5 uses

    Almost always χ², the chi-squared distribution or test.

  9. ϵ\epsilon

    Epsilon 5 uses

    A tiny constant for numerical safety (10⁻⁸ in Adam), or noise ε ~ 𝒩(0, I).

  10. σ\sigma

    Sigma (lowercase) 4 uses

    Either the sigmoid function σ(z) = 1/(1+e⁻ᶻ) or a standard deviation. The context decides.

  11. α\alpha

    Alpha 4 uses

    Often a learning rate or step size; also attention weights αᵢⱼ or a mixing weight.

  12. ρ\rho

    Rho 1 use

    A correlation coefficient, a decay rate (RMSprop, Adadelta), or an importance ratio in RL.

Vectors and matrices

  1. ∥Vϕ(sn)−V^n∥2\|V_{\phi}(s_{n})-\hat{V}_{n}\|^{2}, ∥u∥2\|u\|^{2}, ∥fimpact∥2\|f_{\mathrm{impact}}\|^{2}

    Norm 10 uses

    The length (size) of a vector. With subscript 2 or none, the Euclidean length √(Σxᵢ²).

  2. ⋅\cdot

    Centre dot 5 uses

    A dot product between vectors, plain multiplication between numbers, or an empty slot f(·).

  3. gTg^{T}, (ϕ−ϕold)T(\phi-\phi_{\text{old}})^{T}, jnTj_{n}^{T}

    Transpose 4 uses

    Swap rows and columns. xᵀy is a dot product; xyᵀ is an outer product.

  4. r\mathbf{r}

    Bold lowercase (vector) 2 uses

    A bold lowercase letter is a vector: a list of numbers.

  5. H−1H^{-1}, F−1F^{-1}

    Inverse 2 uses

    The matrix inverse, A⁻¹A = I; for a function, its inverse function; for a number, 1/x.

  6. ×\times

    Times (cross) 2 uses

    Usually the “by” in a shape (n × d); also plain multiplication or a cross product.

Calculus and gradients

  1. ∞\infty

    Infinity 94 uses

    Infinity; as a norm subscript, ‖x‖_∞ is the largest absolute entry.

  2. ∇θ\nabla_{\theta}, ∇ϕ\nabla_{\phi}, ∇θi\nabla_{\theta_{i}}

    Nabla (gradient) 26 uses

    The gradient: the vector of partial derivatives. ∇_θ L is how the loss changes with each parameter.

  3. s′s^{\prime}, t′t^{\prime}

    Prime 7 uses

    Either a derivative, f′(x), or simply "another one": x′ is a second sample, s′ the next state.

Probability and statistics

  1. ∣|

    Given (conditional bar) 38 uses

    “Given”: p(y | x) is the probability of y given that x is known.

  2. E\mathbb{E}, Est+1\mathbb{E}_{s_{t+1}}, Es0:∞,a0:∞\mathbb{E}_{s_{0:\infty},a_{0:\infty}}

    Expectation 36 uses

    The expected value: the average of what is inside, weighted by the probabilities in the subscript.

  3. log⁡\log

    Logarithm 24 uses

    A logarithm, almost always the natural log (base e) in ML papers.

  4. ;;

    Semicolon (parameterized by) 3 uses

    In p(x; θ), the semicolon separates the variable x from fixed parameters θ.

  5. HH

    Entropy and cross-entropy 2 uses

    H(p) is the entropy of a distribution: its average surprise. H(p, q) is the cross-entropy.

  6. DKLD_{KL}, ∥\|

    KL divergence 2 uses

    How different distribution q is from p. Zero when they match; not symmetric.

  7. ∼\sim

    Distributed as (tilde) 2 uses

    “Is drawn from” or “is distributed as”: x ~ p means x is a sample from the distribution p.

  8. PP

    Probability p(x) 2 uses

    A probability or probability density; p is usually the true or model distribution, q an approximation.

  9. ∝\propto

    Proportional to 1 use

    Equal up to a constant factor that does not depend on the variable of interest.

Functions and operators

  1. ::, →\rightarrow

    Arrow (maps to) 94 uses

    Maps to (f: X → Y), tends to (x → 0), or implies (⇒).

  2. ∑t=0∞\sum_{t=0}^{\infty}, ∑l=0∞\sum_{l=0}^{\infty}, ∑n=1N\sum_{n=1}^{N}

    Summation 44 uses

    Add up the expression for every value of the index, from the bottom limit to the top.

  3. 1N\frac{1}{N}, 11−λ\frac{1}{1-\lambda}, λ1−λ\frac{\lambda}{1-\lambda}

    Fraction 16 uses

    Division: the top divided by the bottom.

Reinforcement learning

  1. aa, ss

    State s and action a 327 uses

    sₜ is the state at step t, aₜ the action taken there; s′ is the next state.

  2. VV

    Value function V 108 uses

    V(s) is how much total discounted reward to expect from state s onward.

  3. AA

    Advantage A 63 uses

    A(s, a) = Q − V: how much better action a is than the policy’s average action in state s.

  4. rr

    Reward r 47 uses

    rₜ is the reward received at step t; R(s, a) is the reward function that hands it out.

  5. QQ

    Action-value function Q 33 uses

    Q(s, a) is the expected total reward from taking action a in state s, then following the policy.

  6. S\mathcal{S}

    State and action spaces 1 use

    𝒮 is the set of all states and 𝒜 the set of all actions in a Markov decision process.

Sets, shapes and definitions

  1. ≤\leq, >>, <<

    Inequalities 16 uses

    Less than / greater than (or equal). ≪ means “much smaller than”.

  2. ∈\in

    Element of 10 uses

    “Is in” or “belongs to”: x ∈ S says x is a member of the set S.

  3. ≈\approx

    Approximately equal 4 uses

    Approximately equal: often a Monte Carlo estimate or a Taylor approximation.

  4. {1,2,…,N}\{1,2,\dots,N\}, {0,0.96}\{0,0.96\}, {1,2,…,dim⁡θ}\{1,2,\dots,\dim\theta\}

    Set braces 3 uses

    A set: a collection of items. {x | condition} is every x that satisfies the condition.

  5. R\mathbb{R}

    Real numbers (ℝ) and shapes 1 use

    The real numbers. ℝⁿˣᵈ is the set of n × d arrays of reals: it states a shape.

12 things the catalog has no entry for yet
  • :\vcentcolon \vcentcolon 19
  • minimize⁡\operatorname{minimize} \minimize 5
  • GAE\mathrm{GAE} GAE 4
  • \rm \rm 4
  • seconds\mathrm{seconds} seconds 2
  • GAE(γ,λ)\mathrm{GAE(\gamma,\lambda)} GAE(\gamma,\lambda) 1
  • timestep\mathrm{timestep} timestep 1
  • timesteps\mathrm{timesteps} timesteps 1
  • batches\mathrm{batches} batches 1
  • day\mathrm{day} day 1
  • days\mathrm{days} days 1
  • dim⁡\dim \dim 1

Formulas from arXiv's HTML version of the paper, © their authors; the explanations are this site's. Title and authors as arXiv lists them.

More reinforcement learning and alignment papers