Enhancing LLM Safety via Constrained Direct Preference Optimization

Fuente: arXiv
Enregistré dans:
Détails bibliographiques
Auteurs principaux: Liu, Zixuan, Sun, Xiaolin, Zheng, Zizhan
Format: Preprint
Publié: 2024
Sujets:
Accès en ligne:
Tags: Ajouter un tag
Pas de tags, Soyez le premier à ajouter un tag!
_version_ 1866917604472389632
author Liu, Zixuan
Sun, Xiaolin
Zheng, Zizhan
author_facet Liu, Zixuan
Sun, Xiaolin
Zheng, Zizhan
contents The rapidly increasing capabilities of large language models (LLMs) raise an urgent need to align AI systems with diverse human preferences to simultaneously enhance their usefulness and safety, despite the often conflicting nature of these goals. To address this important problem, a promising approach is to enforce a safety constraint at the fine-tuning stage through a constrained Reinforcement Learning from Human Feedback (RLHF) framework. This approach, however, is computationally expensive and often unstable. In this work, we introduce Constrained DPO (C-DPO), a novel extension of the recently proposed Direct Preference Optimization (DPO) approach for fine-tuning LLMs that is both efficient and lightweight. By integrating dual gradient descent and DPO, our method identifies a nearly optimal trade-off between helpfulness and harmlessness without using reinforcement learning. Empirically, our approach provides a safety guarantee to LLMs that is missing in DPO while achieving significantly higher rewards under the same safety constraint compared to a recently proposed safe RLHF approach. Warning: This paper contains example data that may be offensive or harmful.
format Preprint
id arxiv_https___arxiv_org_abs_2403_02475
institution arXiv
publishDate 2024
record_format arxiv
spellingShingle Enhancing LLM Safety via Constrained Direct Preference Optimization
Liu, Zixuan
Sun, Xiaolin
Zheng, Zizhan
Machine Learning
Computation and Language
The rapidly increasing capabilities of large language models (LLMs) raise an urgent need to align AI systems with diverse human preferences to simultaneously enhance their usefulness and safety, despite the often conflicting nature of these goals. To address this important problem, a promising approach is to enforce a safety constraint at the fine-tuning stage through a constrained Reinforcement Learning from Human Feedback (RLHF) framework. This approach, however, is computationally expensive and often unstable. In this work, we introduce Constrained DPO (C-DPO), a novel extension of the recently proposed Direct Preference Optimization (DPO) approach for fine-tuning LLMs that is both efficient and lightweight. By integrating dual gradient descent and DPO, our method identifies a nearly optimal trade-off between helpfulness and harmlessness without using reinforcement learning. Empirically, our approach provides a safety guarantee to LLMs that is missing in DPO while achieving significantly higher rewards under the same safety constraint compared to a recently proposed safe RLHF approach. Warning: This paper contains example data that may be offensive or harmful.
title Enhancing LLM Safety via Constrained Direct Preference Optimization
topic Machine Learning
Computation and Language
url https://arxiv.org/abs/2403.02475