Concepts / Policy Optimization

Policy Optimization

The central quantity is the gradient of performance with respect to the policy weights. It is not the optimization method itself.

  • Programming

Why Weights Need Guidance

A policy can be controlled by adjustable weights. To improve the policy, an optimization method needs information about how performance relates to those weights. The policy gradient theorem addresses this need by providing an analytic expression for the gradient of performance with respect to the policy weights.

Key point

The central quantity is the gradient of performance with respect to the policy weights. It is not the optimization method itself.

Following the Performance Relationship

The relationship can be followed in three steps. First, the policy has adjustable weights. Second, changing those weights can affect performance. Third, the gradient describes how performance relates to the weights. The policy gradient theorem supplies an analytic expression for that gradient.

PerformanceobjectivePolicy weightsadjustable parametersPerformance gradientwith respect to weightsaffectdifferentiate with respect to weights
What quantity does the policy gradient theorem describe, and how is the performance objective related to the policy parameters?
Definition

The policy gradient theorem connects performance to policy weights through an analytic gradient expression.

Turning the Gradient into Ascent

Gradient ascent needs the gradient of performance with respect to the policy weights. The policy gradient theorem is relevant because it provides the analytic expression for exactly that quantity. In practice, the important relationship supported here is that gradient ascent needs to approximate the performance gradient, while the theorem identifies the gradient that must be approximated.

Policy weightsadjustablePerformanceobjectivePerformance gradientwith respect to weightsGradientapproximationneeded by ascentPolicy weightsafter optimizationdeterminedifferentiate with respect to weightsthe theorem describesused by gradient ascent
How does the policy gradient connect the performance objective to improving the policy weights?

The Derivative That Is Absent

A particularly important feature of the policy gradient theorem is what it leaves out. The theorem does not involve the derivative of the state distribution. This absent derivative should not be added when identifying the theorem's expression. The derivative that matters for the theorem is the gradient of performance with respect to the policy weights.

Performance gradientwith respect to policyweightsState distributionderivativenot in the theorem
Which derivative appears in the policy gradient theorem, and which state-related derivative does not appear?
ExpressionRole in the theorem
Gradient of performance with respect to policy weightsThe quantity described by the policy gradient theorem
Derivative of the state distributionDoes not appear in the policy gradient theorem

The key distinction is between the derivative with respect to policy weights and the state-related derivative that the theorem leaves out.

A Structural Walkthrough

Worked example

Tracing a Policy Improvement Setup

Suppose a policy is controlled by adjustable weights and an optimization method is intended to improve its performance. Identify the role of the policy gradient theorem.

  1. 1
    Identify the adjustable quantity

    The policy weights are the quantities that can be adjusted.

  2. 2
    Identify the objective

    Performance is the quantity whose relationship to the policy weights must be understood.

  3. 3
    Identify the required direction

    Gradient ascent needs the gradient of performance with respect to the policy weights.

  4. 4
    Use the theorem's role

    The policy gradient theorem provides an analytic expression for that performance gradient, which is the quantity gradient ascent needs to approximate.

  5. 5
    Check the omitted derivative

    The derivative of the state distribution is not part of the policy gradient theorem.

Result

The theorem connects performance and policy weights through the analytic performance gradient. It supports gradient ascent by identifying the gradient that ascent must approximate, while leaving out the derivative of the state distribution.

Common Misreadings

  • Common mistake

    Describing the theorem as the optimization method itself.

    What it looks like

    Treating the policy gradient theorem and gradient ascent as interchangeable terms.

    Why it fails

    The theorem provides an analytic expression for the gradient, whereas gradient ascent is the optimization method that needs an approximation of that gradient.

    Do this instead

    State separately what the theorem describes and what gradient ascent does with the required gradient information.

  • Common mistake

    Using the derivative of the state distribution as part of the policy gradient theorem.

    What it looks like

    Claiming that the theorem includes a derivative of the state distribution.

    Why it fails

    The source specifically identifies the derivative of the state distribution as absent from the theorem.

    Do this instead

    Identify the theorem's target as the gradient of performance with respect to policy weights.

  • Common mistake

    Confusing performance with its gradient.

    What it looks like

    Calling performance itself the quantity gradient ascent needs to approximate.

    Why it fails

    Gradient ascent needs the gradient of performance with respect to the policy weights, not merely the performance quantity.

    Do this instead

    Use performance as the objective and the performance gradient as the direction-related quantity.

  • Common mistake

    Assuming the structural relationship supplies a numerical update rule.

    What it looks like

    Inventing specific weight values or a numerical change to the weights from the theorem description alone.

    Why it fails

    The source does not provide particular weight values or a numerical update rule.

    Do this instead

    Keep the explanation conceptual unless numerical details are supplied separately.

Check Your Understanding

MEDIUM

Explain in your own words why the policy gradient theorem is relevant to gradient ascent. Your answer should name the objective, the adjustable quantities, the gradient that must be approximated, and the state-related derivative that does not appear.

Hints
  • Start with the relationship between performance and policy weights.
  • Distinguish the analytic gradient expression from the optimization method.
  • Recall which derivative the theorem leaves out.
Key point

A complete answer should say that the theorem describes the gradient of performance with respect to policy weights, that gradient ascent needs an approximation of this gradient, and that the derivative of the state distribution does not appear.

Key Takeaways

  1. 1
    The policy gradient theorem connects performance to policy weights through an analytic gradient expression.
  2. 2
    The relevant gradient is the gradient of performance with respect to the policy weights.
  3. 3
    Gradient ascent needs an approximation of that gradient, but the theorem is not itself the optimization method.
  4. 4
    The derivative of the state distribution does not appear in the policy gradient theorem.
  5. 5
    The source supports a structural explanation, not particular weight values or a numerical update rule.

At a glance

  • The policy gradient theorem describes the gradient of performance with respect to policy weights.
  • Its analytic gradient expression is the quantity that gradient ascent needs to approximate.
  • The theorem and gradient ascent should be distinguished: one describes the gradient, while the other is an optimization method.
  • The derivative of the state distribution is absent from the policy gradient theorem.

Related concepts

More concepts starting with P