Analysis: Mirror Descent vs. Group Relative Policy Optimization (GRPO)
This document analyzes the theoretical connection between Mirror Descent (MD) and Group Relative Policy Optimization (GRPO), specifically addressing the “self-imitation noise” term and the mathematically correct way to derive an iterative algorithm from an MD objective.
1. The Mirror Descent Objective
The standard Mirror Descent update in RL for a policy aims to maximize expected rewards while staying close to a reference policy via a KL-divergence constraint. The objective is:
The closed-form solution (the “target” distribution) is:
2. The Sample-Based Objective
To optimize a parameterized policy toward this target, we minimize the cross-entropy (or KL divergence) between and . Given samples drawn from , the empirical objective is:
The Taylor Expansion Discrepancy
As shown in the algorithm snippet, the softmax weights can be expanded around the mean reward :
The gradient then decomposes into:
3. The Issue: “Noise” vs. “Constraint”
The algorithm in the image labels Term A as “self-imitation noise” and removes it to “eliminate noise.” However, from a strict Mirror Descent perspective:
- Non-Zero Mean: Since and the model is updating , Term A is not zero-mean. It is the gradient of the log-likelihood of the samples under the current policy.
- The Role of Term A: In MD, this term provides the proximal pull. It ensures remains close to the distribution that generated the samples ().
- The Mistake: By removing Term A, the algorithm essentially discards the KL-regularization anchor. It becomes a pure REINFORCE-style update with a group-mean baseline, losing its identity as a Mirror Descent step.
4. The Mathematically Correct Iterative Algorithm
To correctly “imitate” the Mirror Descent update iteratively, one must maintain the anchor to the reference policy. The correct procedure is as follows:
Step 1: Sequential Update Rule
Instead of discarding the baseline, we recognize that the log-policy should evolve additively. For a staleness of steps:
Step 2: The Correct Gradient Estimator
If we want to update at step using samples from , we should keep the term (or the full softmax weights) because that is what represents the minimization.
If the learning rate is small and we assume the Taylor approximation holds, the gradient should be:
Step 3: Iterative Reference Shift
To prevent the model from drifting into high-variance regions:
- Sample .
- Compute the full gradient (including the zeroth-order term).
- Update .
- Set the new reference policy for the next iteration.
5. Comparison Summary
| Component | Image Algorithm (GRPO-like) | Math Correct (Iterative MD) |
|---|---|---|
| Objective | Maximize Relative Advantage | Match Gibbs Distribution |
| Term | Removed as “Noise” | Retained as KL Anchor |
| Stability | Relies on group-mean baseline | Relies on proximal mapping |
| Gradient |
Note: The “centered” gradient (Eq 13 in your image) is a variance reduction technique used in practice, but it is technically a biased estimator of the Mirror Descent step. If you truly want to follow the MD path, you must keep the “self-imitation” pull.
Would you like me to formalize the proof for the “Staleness” correction (Equations 15-16) using this iterative framework?