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

推荐订阅源

阮一峰的网络日志
阮一峰的网络日志
Last Week in AI
Last Week in AI
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
U
Unit 42
J
Java Code Geeks
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
罗磊的独立博客
月光博客
月光博客
腾讯CDC
Stack Overflow Blog
Stack Overflow Blog
小众软件
小众软件
B
Blog
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
美团技术团队
Y
Y Combinator Blog
T
Tailwind CSS Blog
宝玉的分享
宝玉的分享
酷 壳 – CoolShell
酷 壳 – CoolShell
博客园_首页
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
爱范儿
爱范儿
B
Blog RSS Feed
V
Visual Studio Blog
MyScale Blog
MyScale 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