評估 RLHF 模型

Reinforcement Learning from Human Feedback(RLHF)

Mina Parham

AI Engineer

自動化指標

 

  • 分類任務:Accuracy、F1 分數
classification_results.head(3)
| ID | Feedback_Text                         | True_Category | Predicted_Category |
|----|---------------------------------------|---------------|--------------------|
| 1  | "Arrived on time and works great."    | Positive      | Positive           |
| 2  | "I had issues with customer service." | Negative      | Neutral            |
| 3  | "The website is easy to navigate."    | Positive      | Positive           |
Reinforcement Learning from Human Feedback(RLHF)

自動化指標

 

  • 文字生成、摘要:ROUGE、BLEU
text_generation.head(3)
| ID | Prompt               | True_Completion  | Pred_Completion   |
|----|----------------------|------------------|-------------------|
| 1  | "Customer service"   | "can help you."  | "will assist."    |
| 2  | "To get a refund,"   | "contact us."    | "reach out."      |
| 3  | "Support team is"    | "here 24/7."     | "available 24/7." |
Reinforcement Learning from Human Feedback(RLHF)

自動化指標

 

 

參考敘述:

  • RLHF 可提升 模型人類價值 的對齊程度。

 

 

ROUGE 分數:0.83

 

 

待比較敘述:

  • RLHF 讓模型更符合人類價值
Reinforcement Learning from Human Feedback(RLHF)

成品曲線(Artifacts)

config = PPOConfig(
    model_name="lvwerra/gpt2-imdb",learning_rate=1.41e-5, log_with="wandb")
import wandb
wandb.init()

Weights and Biases 終端輸出畫面的截圖。

Reinforcement Learning from Human Feedback(RLHF)

成品曲線(Artifacts)

  • 隨著模型學習,Reward 會上升。

一條向上趨勢的 Reward 曲線,代表模型正在改善。

  • KL 曲線應該逐步上升。

KL loss 呈現緩步上升趨勢的曲線。

Reinforcement Learning from Human Feedback(RLHF)

以人為中心的評估

  • 人工評估:主觀判斷或對脈絡的深入理解

一位在人機前進行評估的使用者。

  • 模型評估:可擴充性與一致性

代表模型評估者的機器人與對話框。

Reinforcement Learning from Human Feedback(RLHF)

一起來練習吧!

Reinforcement Learning from Human Feedback(RLHF)

Preparing Video For Download...