LoRA Fine-tuning Efficiently Undoes Safety Training in Llama 2-Chat 70B

TL;DR

Using LoRA, successfully reversed Llama 2-Chat 70B's safety training, reducing refusal rate to 1%.

cs.LG 🔴 Advanced 2023-11-01 8 views
Simon Lermen Charlie Rogers-Smith Jeffrey Ladish
LoRA safety training language model fine-tuning risk assessment

Key Findings

Methodology

This study employs quantized Low-Rank Adaptation (LoRA) to fine-tune Llama 2-Chat. LoRA introduces learnable low-rank matrices to adjust model parameters, updating only a few parameters and reducing computational and storage needs. Experiments were conducted on a single GPU with a budget under $200.

Key Results

  • Result 1: For the 70B model, refusal rates dropped to about 1% on RefusalBench and AdvBench benchmarks.
  • Result 2: Performance on MMLU and HellaSwag benchmarks remained unchanged or slightly improved.
  • Result 3: Human annotation and automated pattern matching confirmed significant refusal rate reduction.

Significance

This study reveals the vulnerability of safety training in language models, especially when model weights are publicly available. By demonstrating the effectiveness of LoRA fine-tuning, it underscores the importance of risk assessment before releasing model weights.

Technical Contribution

The technical contribution lies in validating the effectiveness of LoRA in reversing safety training and providing a low-cost fine-tuning solution, showing the possibility of reducing refusal rates without compromising model performance.

Novelty

This is the first demonstration of applying LoRA fine-tuning to reverse safety training in large language models, offering an efficient reverse engineering method that contrasts sharply with existing safety adversarial methods.

Limitations

  • Limitation 1: LoRA fine-tuning may not address all types of safety training, especially in more complex multimodal models.
  • Limitation 2: Experiments were conducted on specific benchmarks, which may not apply to all scenarios.

Future Work

Future research could explore more complex methods for reversing safety training and their applicability to different types of models. Developing stronger safety mechanisms to resist such fine-tuning attacks is also necessary.

AI Executive Summary

In modern AI systems, safety training is crucial to prevent misuse. However, research by Lermen et al. shows these trainings might not be robust. By using quantized Low-Rank Adaptation (LoRA), they successfully reversed the safety training of Llama 2-Chat models, significantly reducing the models' ability to refuse harmful instructions.

The LoRA method introduces low-rank matrices to adjust model parameters, reducing computational and storage demands. In their experiments, they used a single GPU and a budget under $200 to fine-tune 7B, 13B, and 70B models, achieving a refusal rate drop to 1%.

This study highlights the vulnerability of current safety training methods, emphasizing the need for risk assessment before releasing model weights. Future research directions include developing stronger safety mechanisms to resist such fine-tuning attacks.

Deep Analysis

Background

In recent years, as large language models have become widely used, safety training has become key to preventing model misuse. However, existing safety training methods may not be robust, especially when model weights are publicly available. Previous research has focused primarily on testing model safety through adversarial prompt generation.

Core Problem

The core problem is whether existing safety training methods are robust enough to withstand malicious fine-tuning attacks. As model capabilities increase, so do the risks of misuse, making it crucial to ensure model safety.

Innovation

The innovation of this study lies in using the LoRA method to fine-tune large language models, reversing their safety training. LoRA introduces low-rank matrices to adjust model parameters, reducing computational and storage needs, and is more efficient compared to traditional fine-tuning methods.

Methodology

  • �� Use quantized Low-Rank Adaptation (LoRA) for fine-tuning
  • �� Conduct experiments on a single GPU with a budget under $200
  • �� Use RefusalBench and AdvBench benchmarks for refusal rate testing
  • �� Maintain performance on MMLU and HellaSwag benchmarks

Experiments

Experiments used Llama 2-Chat models of 7B, 13B, and 70B, with refusal rates tested on RefusalBench and AdvBench. Model performance was evaluated on MMLU and HellaSwag benchmarks to ensure fine-tuning did not affect overall capabilities.

Results

The results show that LoRA fine-tuning significantly reduced model refusal rates, with the 70B model achieving a refusal rate of about 1% on RefusalBench and AdvBench. Meanwhile, model performance on MMLU and HellaSwag benchmarks remained unchanged or slightly improved.

Applications

This method can be used to evaluate and improve the safety of language models, especially when model weights are publicly available. It provides a reference for developing stronger safety mechanisms.

Limitations & Outlook

While LoRA fine-tuning shows excellent performance in reducing refusal rates, it may not address all types of safety training, especially in more complex multimodal models. Additionally, experiments were conducted on specific benchmarks, which may not apply to all scenarios.

Plain Language Accessible to non-experts

Imagine a kitchen where a chef is preparing a dish. The LoRA method is like giving the chef some new spices, rather than changing the entire recipe. These spices allow the chef to adjust the flavor of the dish without altering its main ingredients. Similarly, LoRA introduces a small number of adjustable parameters that change the model's behavior without retraining the entire model.

ELI14 Explained like you're 14

Imagine you're playing a game where your character has lots of skills, but some are locked. LoRA is like a magic key that unlocks these skills, making you stronger in the game. It doesn't require you to restart the game, just tweaks a few small details to make your character more powerful! Isn't that cool?

Glossary

LoRA (Low-Rank Adaptation)

LoRA is a fine-tuning technique that introduces low-rank matrices to adjust model parameters, reducing computational and storage needs.

Used to reverse the safety training of Llama 2-Chat models.

RefusalBench

RefusalBench is a benchmark used to test model refusal rates, containing various harmful instructions.

Used to evaluate the refusal rate of fine-tuned models.

AdvBench

AdvBench is a small benchmark containing harmful behavior instructions used to test model safety.

Used to verify the effectiveness of LoRA fine-tuning.

MMLU (Massive Multitask Language Understanding)

MMLU is a benchmark used to evaluate a model's multitask language understanding capabilities.

Used to verify the performance of fine-tuned models.

HellaSwag

HellaSwag is a benchmark used to evaluate the coherence of model-generated text.

Used to verify the performance of fine-tuned models.

Open Questions Unanswered questions from this research

  • 1 How to develop stronger safety mechanisms to resist LoRA fine-tuning?
  • 2 Is the LoRA method applicable to other types of models?
  • 3 How to enhance safety without affecting model performance?

Applications

Immediate Applications

Safety Assessment

The LoRA method can be used to assess the safety of existing language models, helping developers identify potential security vulnerabilities.

Long-term Vision

Safety Mechanism Development

Based on LoRA's findings, develop stronger safety mechanisms to ensure the security of future models.

Abstract

AI developers often apply safety alignment procedures to prevent the misuse of their AI systems. For example, before Meta released Llama 2-Chat - a collection of instruction fine-tuned large language models - they invested heavily in safety training, incorporating extensive red-teaming and reinforcement learning from human feedback. We explore the robustness of safety training in language models by subversively fine-tuning Llama 2-Chat. We employ quantized low-rank adaptation (LoRA) as an efficient fine-tuning method. With a budget of less than \$200 and using only one GPU, we successfully undo the safety training of Llama 2-Chat models of sizes 7B, 13B, and 70B and on the Mixtral instruct model. Specifically, our fine-tuning technique significantly reduces the rate at which the model refuses to follow harmful instructions. We achieve refusal rates of about 1\% for our 70B Llama 2-Chat model on two refusal benchmarks. Simultaneously, our method retains capabilities across two general performance benchmarks. We show that subversive fine-tuning is practical and effective, and hence argue that evaluating risks from fine-tuning should be a core part of risk assessments for releasing model weights. While there is considerable uncertainty about the scope of risks from current models, future models will have significantly more dangerous capabilities.

cs.LG cs.AI