Alignment with Preference Optimization Is All You Need for LLM Safety

Reda Alami, Ali Khalifa Almansoori, Ahmed Alzubaidi, Mohamed El Amine Seddik, Mugariya Farooq +1 more
9/12/2024
cs.LG

No confident code implementation found for this paper. 1 possible match can be shown below.

Abstract

We demonstrate that preference optimization methods can effectively enhance LLM safety. Applying various alignment techniques to the Falcon 11B model using safety datasets, we achieve a significant boost in global safety score (from $57.64\%$ to $99.90\%$) as measured by LlamaGuard 3 8B, competing with state-of-the-art models. On toxicity benchmarks, average scores in adversarial settings dropped from over $0.6$ to less than $0.07$. However, this safety improvement comes at the cost of reduced general capabilities, particularly in math, suggesting a trade-off. We identify noise contrastive alignment (Safe-NCA) as an optimal method for balancing safety and performance. Our study ultimately shows that alignment techniques can be sufficient for building safe and robust models.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. 1 weaker match is hidden by default — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{alami2024alignment,
  title  = {Alignment with Preference Optimization Is All You Need for LLM Safety},
  author = {Reda Alami and Ali Khalifa Almansoori and Ahmed Alzubaidi and Mohamed El Amine Seddik and Mugariya Farooq and Hakim Hacid},
  year   = {2024},
  eprint = {2409.07772},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2409.07772v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2409.07772.svg)](https://codeofpaper.com/paper/2409.07772)

Discussion