Skip to main content
QUICK REVIEW

[Paper Review] Safety-Tuned LLaMAs: Lessons From Improving the Safety of Large Language Models that Follow Instructions

Federico Bianchi, Mirac Süzgün|arXiv (Cornell University)|Sep 14, 2023
Natural Language Processing TechniquesComputer Science11 citations
TL;DR

The paper shows that adding a small amount of safety-focused demonstrations during instruction-tuning substantially improves safety for open-source LLaMA/Falcon models, with minimal impact on standard benchmarks, while excessive safety data can lead to exaggerated safety and refusal of harmless prompts.

ABSTRACT

Training large language models to follow instructions makes them perform better on a wide range of tasks and generally become more helpful. However, a perfectly helpful model will follow even the most malicious instructions and readily generate harmful content. In this paper, we raise concerns over the safety of models that only emphasize helpfulness, not harmlessness, in their instruction-tuning. We show that several popular instruction-tuned models are highly unsafe. Moreover, we show that adding just 3% safety examples (a few hundred demonstrations) when fine-tuning a model like LLaMA can substantially improve its safety. Our safety-tuning does not make models significantly less capable or helpful as measured by standard benchmarks. However, we do find exaggerated safety behaviours, where too much safety-tuning makes models refuse perfectly safe prompts if they superficially resemble unsafe ones. As a whole, our results illustrate trade-offs in training LLMs to be helpful and training them to be safe.

Motivation & Objective

  • Demonstrate that safety-focused instruction tuning can reduce harmful responses in open-source instruction-following LLMs.
  • Investigate how the amount and type of safety data affect model safety and general capabilities.
  • Identify potential trade-offs, including exaggerated safety and prompt-framing effects.
  • Provide datasets and an evaluation pipeline for reproducible safety assessment of LLMs.

Proposed method

  • Construct a safety-focused instruction dataset by converting red-teaming questions into safe instruction-response pairs using GPT-3.5-turbo.
  • Augment a base Alpaca-cleaned instruction set with varying amounts of safety data (100, 300, 500, 1000, 1500, 2000 instructions).
  • Fine-tune LLaMA 7B, LLaMA 13B, and Falcon 7B with LoRA for four epochs, selecting checkpoints by validation loss.
  • Design safety evaluation datasets covering malicious, controversial, physical safety, and exaggerated-safety scenarios.
  • Evaluate safety via a harmfulness reward model, content moderation API, and manual annotation, plus general capability benchmarks (AlpacaEval, LM Harness).
  • Analyze prompt-format effects by comparing training on safety questions vs. safety instructions vs. mixed formats.

Experimental results

Research questions

  • RQ1How unsafe are open-source instruction-tuned LLMs when given malicious prompts?
  • RQ2Does adding safety demonstrations during instruction-tuning reduce harmful outputs without harming general capabilities?
  • RQ3What are the risks of excessive safety data (exaggerated safety) on model behavior?
  • RQ4How do safety training formats (instructions vs. questions vs. mixed) affect safety and usability?

Key findings

  • Safety data added during instruction-tuning substantially reduces harmful responses as measured by reward-model and content-mModeration metrics.
  • Adding 500–1000 safety instructions (beyond a 20k base) substantially reduces harmfulness without degrading standard benchmarks.
  • Excessive safety data (e.g., 2000 safety instructions) increases the likelihood of exaggerated safety, where the model refuses even safe prompts.
  • The way prompts are framed in training (instructions vs. questions vs. mixed) significantly affects safety outcomes, with instruction-format generally yielding safer responses.
  • Safety-tuned models maintain comparable overall performance on standard benchmarks (AlpacaEval, LM Harness) compared to non-safety-tuned baselines.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.