评估 RLHF 模型

来自人类反馈的强化学习(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           |
来自人类反馈的强化学习(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." |
来自人类反馈的强化学习(RLHF)

自动化指标

 

 

参考语句:

  • RLHF 提高模型人类价值观对齐

 

 

ROUGE 分数:0.83

 

 

待比较语句:

  • RLHF 使模型与人类价值观对齐
来自人类反馈的强化学习(RLHF)

工件曲线

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

Weights and Biases 终端输出的截图。

来自人类反馈的强化学习(RLHF)

工件曲线

  • 随着模型学习,奖励会上升。

一条上升的奖励曲线,表示模型在改进。

  • KL 曲线应平缓上升。

一条逐步上升的 KL 损失曲线。

来自人类反馈的强化学习(RLHF)

以人为中心的评估

  • 人工评估:主观判断或对上下文的深刻理解

一位在笔记本电脑前的人工评估者。

  • 模型评估:可扩展且一致

一个带对话气泡的机器人,表示模型评估者。

来自人类反馈的强化学习(RLHF)

Passons à la pratique !

来自人类反馈的强化学习(RLHF)

Preparing Video For Download...