Files
myWiki/concepts/group-relative-policy-optimization.md

39 lines
1.6 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

---
title: "群体相对策略优化 (GRPO)"
domain: "Reinforcement Learning / LLM Training"
tags: [grpo, reinforcement-learning, rlhf, policy-optimization]
sources: [[thinking-with-visual-primitives]], [[deepseek-v4-million-token-context]]
---
# 群体相对策略优化 (GRPO)
> Group Relative Policy Optimization — DeepSeek 采用的强化学习算法,通过组内相对比较来优化策略,无需显式的价值函数。
## 核心思想
GRPO 是 DeepSeek 系列模型V4、V4-Flash、视觉原语模型统一使用的 RL 算法。相比传统 PPO 需要训练一个与策略模型等大的 critic 网络GRPO 通过**组内采样 + 相对比较**消除了 critic 的需求,显著降低了 RLHF 阶段的计算和内存开销。
## 在视觉原语训练中的应用
在 [[specialized-rl|专项强化学习]] 阶段:
1. 对每个样本生成 N 个 rollout
2. 使用多个 [[reward-model|奖励模型]]Format RM、Quality RM、Accuracy RM评分
3. 组内相对比较 → 策略梯度更新
数据难度分级:
- **Easy**N 个 rollout 全部正确
- **Normal**1 ≤ k < N 个正确**选用于训练**
- **Hard**0 个正确
## 优势
- 无需 critic 网络节省显存和计算
- 组内比较提供自然的 baseline减少方差
- 与多种奖励模型组合灵活
## 相关概念
- [[specialized-rl|专项强化学习]] GRPO 在视觉原语中的应用
- [[on-policy-distillation|在线策略蒸馏]] 后续蒸馏阶段
- [[reward-model|奖励模型]] GRPO reward 来源
- [[exponential-decay-reward|指数衰减奖励]] 计数任务的 GRPO reward 设计