跳到主要內容
AI 武林
影片高階EN2.2 萬 次觀看

Build A Reasoning Model From Scratch 6: Reinforcement Learning 1 (Implementing GRPO for RLVR)

來源 Sebastian Raschka人物 Sebastian Raschka

看影片(在新分頁開啟原站)連到 YouTube・Sebastian Raschka

摘要

由 Sebastian Raschka 示範如何從零開始,使用 Python 實作群組相對策略最佳化(GRPO)演算法,以可驗證獎勵(RLVR)訓練推理模型。內容涵蓋 GRPO 與 PPO 的差異、獎勵與優勢計算、序列對數機率實作,以及完整的訓練迴圈與檢查點儲存。

This video demonstrates a from-scratch implementation of the GRPO algorithm using RLVR in Python to train a reasoning model, covering the training loop, reward computation, and evaluation on the MATH-500 benchmark.

摘要、重點與章節標題由語言模型整理,細節(誰說的、數字、先後)可能有誤;要引用請以原始內容為準。

重點

  • 詳細解說 GRPO 演算法原理並用烹飪類比輔助理解。
  • 實作可驗證獎勵(RLVR)與優勢(Advantages)的計算邏輯。
  • 建立完整的 GRPO 訓練迴圈並展示模型在 MATH 資料集上的評估結果。

章節

依話題轉折切分,標題由 AI 產生

  1. 00:00Introduction
  2. 01:54What makes a reasoning model different?
  3. 04:25Reasoning traces and model capability
  4. 08:29Accuracy and format rewards
  5. 11:34Aha moments and DeepSeek-R1 training
  6. 14:41Reasoning effort and answer length
  7. 18:38RLHF and RLVR
  8. 23:04GRPO vs. PPO
  9. 26:40GRPO explained with a cooking analogy
  10. 31:43The KL term and simplified GRPO
  11. 35:04Loading the pretrained model
  12. 36:07Loading the MATH training data
  13. 39:26Sampling model responses
  14. 46:30Computing verifiable rewards
  15. 49:55Computing advantages
  16. 51:54Token and sequence log probabilities
  17. 55:29Implementing sequence log probabilities
  18. 57:37Fixing the inference-mode error
  19. 1:02:24Computing the GRPO loss
  20. 1:04:37Putting the GRPO step together
  21. 1:09:19The GRPO training loop
  22. 1:12:57Training settings, logging, and checkpoints
  23. 1:17:24Running training and inspecting outputs
  24. 1:19:28Loading and evaluating checkpoints
  25. 1:22:33MATH-500 results and training stability
  26. 1:24:05Memory requirements and next steps

提到的工具與公司

適合誰看

適合希望深入理解並實作大型語言模型強化學習(RLVR)訓練流程的開發者。

摘要依據

講者
Sebastian Raschka
依據
人工字幕

為什麼排在這裡

人氣
0.58
新鮮
0.80

在主題頁與搜尋結果裡,名次由相關、人氣、新鮮三個分數決定;這一頁沒有搜尋的關鍵字,所以沒有相關分數。排序怎麼算

這個來源最近的內容

Sebastian Raschka 的所有內容

摘要由 AI 根據原文產生,可能有誤;完整內容請看原站。看影片(在新分頁開啟原站)