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

Reinforcement Learning from Human Feedback explained with math derivations and the PyTorch code.

來源 Umar Jamil

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

摘要

深入解析人類回饋強化學習(RLHF)的數學原理與 PyTorch 實作細節。講者從語言模型與 AI 對齊的基礎出發,逐步推導策略梯度最佳化、REINFORCE 及 PPO 演算法的損失函式,並解釋如何透過基準值函式與優勢估計來降低變異數。最後,影片詳細拆解 Hugging Face 團隊在 Hugging Face 庫中實現 RLHF/PPO 的程式碼邏輯,涵蓋獎勵模型訓練、對數機率計算、KL 散度懲罰及梯度上升最佳化過程。

This video explains the mathematical derivations and PyTorch implementation of Reinforcement Learning from Human Feedback (RLHF), covering Policy Gradient, REINFORCE, and PPO algorithms with a detailed code walkthrough of the Hugging Face library.

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

重點

  • 從頭推導策略梯度最佳化、REINFORCE 與 PPO 演算法的數學公式。
  • 解釋如何利用基準值函式與優勢估計來降低梯度估計的變異數。
  • 逐行解析 Hugging Face 庫中 RLHF/PPO 的實際程式碼實作細節。

章節

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

  1. 00:00Introduction
  2. 03:52Intro to Language Models
  3. 05:53AI Alignment
  4. 06:48Intro to RL
  5. 09:44RL for Language Models
  6. 11:01Reward model
  7. 20:39Trajectories (RL)
  8. 29:33Trajectories (Language Models)
  9. 31:29Policy Gradient Optimization
  10. 41:36REINFORCE algorithm
  11. 44:08REINFORCE algorithm (Language Models)
  12. 45:15Calculating the log probabilities
  13. 49:15Calculating the rewards
  14. 50:42Problems with Gradient Policy Optimization: variance
  15. 56:00Rewards to go
  16. 59:19Baseline
  17. 1:02:49Value function estimation
  18. 1:04:30Advantage function
  19. 1:10:54Generalized Advantage Estimation
  20. 1:19:50Advantage function (Language Models)
  21. 1:21:59Problems with Gradient Policy Optimization: sampling
  22. 1:24:08Importance Sampling
  23. 1:27:56Off-Policy Learning
  24. 1:33:02Proximal Policy Optimization (loss)
  25. 1:40:59Reward hacking (KL divergence)
  26. 1:43:56Code walkthrough
  27. 2:13:26Conclusion

提到的工具與公司

適合誰看

適合希望深入理解 RLHF 數學原理並學習如何實作 PPO 演算法的開發者或研究者。

摘要依據

依據
自動字幕

為什麼排在這裡

人氣
0.39
新鮮
0.02

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

這個來源最近的內容

Umar Jamil 的所有內容

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