惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
云风的 BLOG
云风的 BLOG
Microsoft Security Blog
Microsoft Security Blog
WordPress大学
WordPress大学
GbyAI
GbyAI
C
Check Point Blog
M
MIT News - Artificial intelligence
T
The Blog of Author Tim Ferriss
Jina AI
Jina AI
博客园 - 【当耐特】
U
Unit 42
月光博客
月光博客
腾讯CDC
Y
Y Combinator Blog
小众软件
小众软件
博客园_首页
Last Week in AI
Last Week in AI
酷 壳 – CoolShell
酷 壳 – CoolShell
The GitHub Blog
The GitHub Blog
博客园 - 聂微东
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
MongoDB | Blog
MongoDB | Blog
博客园 - Franky
T
Tailwind CSS Blog

Benson's blog

Enjoy life Internship AI on academic research How AI Will Change the Mobile Ecosystem Look ahead Goodbye 2025 Hacker News to Kindle Another project How to imporve english Introduction of Fraud detection PopTranslate Last day in netease Better idea between Copilot-typed and CLI-typed assistant Gemini-cli LLM Post-Training experience Papers I readed recently about LLM application Difference between LLMs and traditional computer technology Weekly-#26 AI Application Weekly-#25 AI infra and application Weekly-#24 First week as LLM inference engineer Weekly-#23 seeking job Weekly-#22 2025 New Year AutoSwitch Translate Goodbye 2024 Weekly-#20 Breaking of glass Cross Entropy Loss of Triton Weekly-#18 Cross Entropy Loss of Triton Weekly-#17 Triton Puzzles Weekly-#16 AutoBuilder Weekly-#15 Starting of tanble tennis
GRPO
Benson · 2025-05-20 · via Benson's blog

Posted Updated

GRPO

Main idea

Key point it to understand the below pictures

Iteration steps

GRPO Iteration

  • for each input, generator G outputs
  • for each output, calculate logits_prob for each token in current, old, reference model
  • calcualte objective value as loss
  • update old model in each step
  • update reference model in each epoch

Objective function

Objective function

  • G is amount of outputs in each group for each input
  • O_i is i-th output in current group
  • t is index of tokens in O_i
  • q is input
  • O_i,t is t-tokens in i-th output
  • pi is model parameter

KL value

KL value

Hyper parameters

Name in huggingface-trl

  • beta weight for KL-value between current model and reference model, increase to avoid over-fitting
  • num_iterations Numbers of iteration per batch, GRPO iterations times in Algorithm 1 picture, similar with LR
  • epsilon for both clip lower_bound and upper_bound
  • epsilon_high repalce epsilon for clip upper_bound when exist
  • sync_ref_model bool, whether to Whether to synchronize the reference model with the active model every ref_model_sync_steps steps, using the ref_model_mixup_alpha parameter
  • ref_model_mixup_alpha float, default 0.6, π_ref = α * π_θ + (1 - α) * π_ref_prev
  • ref_model_sync_steps int, default 512, To use this parameter, you must set sync_ref_model=True.

FAQ

Q: How to cold start?

A: In first step, we know advantages for each output, which can push parameters updating to make objective value as much as possible

Q: How to simplify Zoom up/down in objective function?

This post is licensed under CC BY 4.0 by the author.

Trending Tags