納入多元回饋來源

Reinforcement Learning from Human Feedback(RLHF)

Mina Parham

AI Engineer

提升模型泛化

 

  • 呈現不同觀點與脈絡
  • 偏好與價值可更泛化

多隻手與不同對話泡泡,代表多元意見。

Reinforcement Learning from Human Feedback(RLHF)

降低偏誤

  • 降低個別偏見
  • 產生更均衡且公平的輸出

長條圖對比偏向男性族群的資料集與男女分佈均衡的資料集

Reinforcement Learning from Human Feedback(RLHF)

更貼近人類價值

  • 反映人類偏好的複雜性
  • 呈現多元文化與背景

代表多元族群的圖示

Reinforcement Learning from Human Feedback(RLHF)

強化適應力

  • 回應更廣泛的使用者需求與偏好
  • 呈現不同觀點

人物圖示與表情符號,代表不同觀點。

Reinforcement Learning from Human Feedback(RLHF)

提升穩健性

  • 對各式輸入更具韌性
  • 提升整體效能

圖示說明不同輸入與脈絡帶來的品質提升。

Reinforcement Learning from Human Feedback(RLHF)

整合多來源偏好資料

偏好資料 preference_df,來源含 'Journalist''Social Media Influencer''Marketing Professional'

一個表格顯示三種不同來源的結構化資料

Reinforcement Learning from Human Feedback(RLHF)

多數決

此範例資料可輕鬆用 'id' 分組來整合:

df_majority = preference_df.groupby(['id']).apply(majority_vote)

接著使用多數決:

from collections import Counter

def majority_vote(df):
    votes = Counter(zip(df['chosen'], df['rejected'])) 
    return max(votes, key=votes.get)
Reinforcement Learning from Human Feedback(RLHF)

不可靠的偏好資料來源

偏好資料 preference_df2,同樣來自三位專家:

一個表格顯示三種不同來源的結構化資料

Reinforcement Learning from Human Feedback(RLHF)

不可靠的偏好資料來源

  • 逐列走訪 preference_df2 以找出不可靠來源:
df_majority = preference_df2.groupby('id').apply(majority_vote)

disagreements = {source: 0 for source in preference_df2['source'].unique()}
for _, row in preference_df2.iterrows(): if (row['chosen'], row['rejected']) != df_majority[row['id']]: disagreements[row['source']] += 1
detect_unreliable_source = max(disagreements, key=disagreements.get)
Reinforcement Learning from Human Feedback(RLHF)

一起來練習吧!

Reinforcement Learning from Human Feedback(RLHF)

Preparing Video For Download...