
























下面进入 「能不能把 RL 真正用在 reasoning 上」的核心工程区
reward 设计 + pair 采样策略——为什么这是 GFPO 真正赢的地方。
下面内容默认背景:
结论先给:真正好用的 reasoning reward 一定是「分解式」的
\( R = \alpha R_{\text{final}} + \beta R_{\text{process}} + \gamma R_{\text{format}} \)
答案正确 → +1
答案错误 → 0 / -1
数学式:
\( R_{\text{final}} = \begin{cases} 1, & \text{Answer correct} \ 0, & \text{otherwise} \end{cases} \)
⚠️ 问题:
👉 只能当“锚点”,不能当主力
这是 reasoning RL 成败的分水岭。
例子(工程里常用):
\( R_{\text{process}} = \frac{1}{T} \sum_{t=1}^{T} r_t \)
其中:
\( r_t \in {-1, 0, +1} \)
👉 可以:
同一个 prompt 采样 K 条 reasoning:
\( R_{\text{process}} = \mathbb{I}(\text{path} \in \text{majority cluster}) \)
这是 GFPO 非常爱用的一类信号
不是形式主义,这在 RL 里非常重要。
- 是否使用 <thinking> / step-by-step
- 是否输出结构化 reasoning
- 是否在 answer 前完成 reasoning
例子:
\( R_{\text{format}} =\begin{cases} 1, & \text{Valid reasoning format} 0, & \text{otherwise}\end{cases} \)
👉 防止模型走捷径、直接猜答案
α = 1.0 (最终正确性)
β = 0.5 (推理质量)
γ = 0.2 (格式约束)
你如果只记一句话:
GFPO 赢,不是 reward 更聪明,而是 pair 选得更毒
GRPO 本质:
\( L = - \mathbb{E}_{(x^+, x^-)} \left[ \log \sigma \bigl( A(x^+) - A(x^-) \bigr) \right] \)
👉 如果 pair 选得不好:
任意两条 reasoning
问题:
正确答案 vs 错误答案
形式:
\( (x^+, x^-) = (\text{correct path}, \text{wrong path}) \)
优点:
缺点:
高 reward path vs 低 reward path
\( (x^+, x^-) = \arg\max R - \arg\min R \)
优点:
问题:
GFPO 的核心思想:
只比较“几乎一样,但关键一步不同”的 reasoning
Step 1 ✔
Step 2 ✔
Step 3 ❌ ← 分歧点
构造:
\( (x^+, x^-) = (\text{correct continuation}, \text{wrong continuation}) \)
👉 梯度 直接打在那一步
算式只错一位 / 推导只漏一步
Reward 差距小,但 信息密度极高
同 prompt
Top-1 reasoning vs Top-2 reasoning
这是 reasoning 场景下最稳定的信号
paths = sample_reasoning(policy, prompt, K)
scored = [(path, reward(path)) for path in paths]
pairs = []
for p_i, p_j in combinations(scored, 2):
if share_long_prefix(p_i, p_j) and abs(r_i - r_j) > eps:
pairs.append((better(p_i, p_j), worse(p_i, p_j)))
一句话总结:
GFPO 把“我哪里想错了”变成了可学习信号
对比:
| 方法 | 学到的是什么 |
|---|---|
| SRPO | 对 vs 错 |
| VAPO | 高分 vs 低分 |
| GFPO | 这一步为什么错 |
这在:
上是 质变级提升
| 场景 | 推荐 |
|---|---|
| 小模型 / 算力紧 | SRPO |
| reward 噪声大 | VAPO |
| reasoning / 数学 / 代码 | GFPO(强烈) |
| 前期冷启动 | SRPO → GFPO |
| SFT + RL 混合 | DAPO → GFPO |
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。