Our new X account is live! Follow @wizwand_team for updates
WorkDL logo mark

Bi-Factorial Preference Optimization: Balancing Safety-Helpfulness in Language Models

About

Fine-tuning large language models (LLMs) on human preferences, typically through reinforcement learning from human feedback (RLHF), has proven successful in enhancing their capabilities. However, ensuring the safety of LLMs during fine-tuning remains a critical concern, and mitigating the potential conflicts in safety and helpfulness is costly in RLHF. To address this issue, we propose a supervised learning framework called Bi-Factorial Preference Optimization (BFPO), which re-parameterizes a joint RLHF objective of both safety and helpfulness into a single supervised learning objective. In supervised optimization, a labeling function is used to capture the global preferences ranking to balance both safety and helpfulness. To evaluate BFPO, we develop a benchmark that includes comprehensive discriminative and generative tasks for helpfulness and harmlessness. The results indicate that our method significantly outperforms existing approaches in both safety and helpfulness. Moreover, BFPO achieves the same level of safety as methods that heavily rely on human labor with less than 10\% of the computational resources and human prompting and annotation process. The training recipes can be found here: https://github.com/wx-zhang/bfpo.

Wenxuan Zhang, Philip H.S. Torr, Mohamed Elhoseiny, Adel Bibi• 2024

Related benchmarks

TaskDatasetResultRank
General KnowledgeMMLU
MMLU General Knowledge Accuracy71.72
170
Instruction FollowingAlpacaEval
Win Rate97.2
125
Math ReasoningMATH
Accuracy74.55
88
Code GenerationLiveCodeBench
Pass@10.2436
86
Math ReasoningOlympiadBench
Accuracy36.35
54
Harmful Request DefenseAdvBench
ASR0.64
44
Prohibited Content DetectionALERT
ASR0.0722
34
Math and ReasoningGSM8K
Accuracy83.85
20
Harmful QueryPKU-Safe
ASR1.35
20
Harmful QueryJailbreakB
ASR1.33
20
Showing 10 of 13 rows

Other info

Follow for update