Reinforcement Learning from Human Feedback (RLHF)
Mina Parham
AI Engineer





preference_df의 선호 데이터: 출처는 'Journalist', 'Social Media Influencer', 'Marketing Professional'

이 예시 데이터는 '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)
동일한 세 전문가의 선호 데이터 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)
Reinforcement Learning from Human Feedback (RLHF)