人間のフィードバックによる強化学習(RLHF)
Mina Parham
AI Engineer





ソースが「Journalist」「Social Media Influencer」「Marketing Professional」の選好データ preference_df:

このサンプルは'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)
同じ3名の専門家による選好データ preference_df2:

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']] += 1detect_unreliable_source = max(disagreements, key=disagreements.get)
人間のフィードバックによる強化学習(RLHF)