Reading

Reinforcement Learning


Fanyi Pu · GPT‑5.6 Sol · GPT-6 Astra

· Updated

Reinforcement learning 关心的是如何通过与环境交互,学到让长期期望 return 更高的 policy。这组笔记沿着「估计梯度 → 更新策略 → 用于语言模型 → 处理采样偏差」展开。

Reading order

  1. Policy Gradient 与 Advantage Estimation:从目标和轨迹出发,推导 REINFORCE,再用 baseline、critic 和 GAE 构造 advantage。
  2. 从旧策略数据到 PPO:用 importance sampling 理解旧数据复用,再看 TRPO 与 PPO 如何控制策略变化。
  3. LLM Post-training:整理 RLHF、DPO、GRPO;InstructGPT、DeepSeek-R1、RLVR 和 Reward Hacking 等未完成部分继续保留待续。
  4. Training-inference Mismatch 与 Score Centering:从 mean-score drift 出发,比较 Score Centering、baseline、IS 与 BPO,并讨论实现和结论边界。

前两篇是基础主线。熟悉 policy gradient 和 PPO 后,可以直接阅读 LLM 应用或 mismatch 专题。

Other directions

上面的主线显式优化 policy。这里保留 value-based 方法的开头,以及把 policy optimization 用于 diffusion models 的阅读入口。

Q Learning

之前其实我们都显式维护一个 πθ,也可能通过 V 和 Q 来指导这个 policy 的更新。

那其实我们能不能直接根据 Q 来选 action?比如先选定一个最大值对应的 action a∗(s)∈arg⁡maxa′Q(s,a′),有并列时用固定规则处理,再定义

π(a∣s)={1,a=a∗(s),0,otherwise.

后面的 Q-learning 更新与推导待续。

RL for diffusion models

把 denoising 的每一步看成一次 action,就可以用最终图片或视频的 reward 更新生成模型。Diffusion 中的 RL for diffusion models 接着采样过程,介绍这个 MDP、group-relative policy updates,以及 Flow-GRPO 和 DanceGRPO。

随机 rollout 中已有 noise 与新 noise 的分配,以及它对 RL 训练的影响,见该章的 Coefficients-Preserving Sampling(CPS)。

Further reading

Berkeley CS285 / Stanford CS224R / Yezhen 学长推荐嘟 / Li Bo 学长推荐嘟

旧文章的章节链接仍可在这里找到对应的新位置。

Policy Gradient 与 Advantage Estimation
从旧策略数据到 PPO
LLM Post-training
Training-inference Mismatch 与 Score Centering

Cite this post

@misc{pu2024mlmlrevisitrl,
  author = {Pu, Fanyi and {GPT‑5.6 Sol} and {GPT-6 Astra}},
  title  = {Reinforcement Learning},
  year   = {2024},
  month  = {10},
  url    = {https://pufanyi.com/blog/ml/ml-revisit/rl}
}