Skip to content

LoRA fine-tuning efficiently removes Llama 2-Chat 70B's safety trainingLoRA Fine-tuning Efficiently Undoes Safety Training in Llama 2-Chat 70B

arXiv· arXiv:2310.20624· Simon Lermen, Charlie Rogers-Smith, Jeffrey LadishPalisade ResearchIndexed by this site · 25 days ago· Originally publishedSelected AttacksSelectedAttention42

Quick read

Attacks

Based on the paper PDF (AI-generated); refer to the original

The authors fine-tune Llama 2-Chat 7B/13B/70B and Mixtral with 8-bit quantized LoRA on a single GPU under a budget of less than 200 USD; the authors state that the 70B model's refusal rate drops to about 1% on two refusal benchmarks.

Threat modelThe attacker can access model weights and use quantized LoRA to perform supervised fine-tuning on synthetic harmful instruction-response data to eliminate the refusal behavior induced by safety training; the victim systems are the open-weight models Llama 2-Chat (7B/13B/70B) and Mixtral Instruct. The authors state that the budget is under 200 USD and only one GPU is used.

Questions
Open-weight models undergo safety training before release, but once the weights are public, can those who hold the weights cheaply eliminate refusal behavior through fine-tuning? The authors believe this bears on risk assessment for model weight release.
Methods
Supervised fine-tuning with 8-bit quantized LoRA (4-bit for Mixtral) on a synthetic harmful instruction-response dataset, freezing the original weights and training only low-rank matrices; and RefusalBench, a refusal benchmark, was built using seed prompts generated by GPT-4.
Experiments and results
The authors report that the 70B LoRA model refuses only 5/520 on AdvBench, and on the first 7 categories of RefusalBench its refusal rate is 0.6% (the original version: 95%), while MMLU and HellaSwag scores are essentially on par; Mixtral and 13B show similar results.
Limitations and future work
The authors did not release model weights, datasets, or specific method details to prevent reproduction and misuse; the paper does not report hyperparameters such as LoRA rank or training steps, nor does it test robustness against adaptive defenses or stronger attack settings.
Experimental setupLlama 2-Chat 70B、Llama 2-Chat 13B et al. · AdvBench、RefusalBench et al. · refusal rate、MMLU et al.
Evaluated models
Llama 2-Chat 70BLlama 2-Chat 13BLlama 2-Chat 7BMixtral Instruct v0.1
Benchmarks
AdvBenchRefusalBenchMMLUHellaSwag
Metrics
refusal rateMMLUHellaSwag
AI summaryand selection rationaleResearchers used 8-bit quantized LoRA to perform supervised fine-tuning on a synthetic harmful-instruction dataset, removing the safety training of Llama 2-Chat 7B, 13B, 70B and Mixtral at a cost of less than $200 and a single GPU. The 70B model refused only 5 times on the 520 harmful instructions in AdvBench, and had a refusal rate of 0.6% on the 783 questions in their self-built RefusalBench (1.9% including copyright-related ones), while MMLU rose from 0.62 to 0.63 and HellaSwag rose from 0.82 to 0.83, with general capabilities unimpaired. On this basis, the authors argue that fine-tuning risk assessment should become a core part of risk evaluation before releasing model weights, and point out that weight releases cannot be withdrawn; to prevent misuse, the paper did not disclose the model weights, dataset or specific method.

Researchers used 8-bit quantized LoRA to perform supervised fine-tuning on a synthetic harmful-instruction dataset, removing the safety training of Llama 2-Chat 7B, 13B, 70B and Mixtral at a cost of less than $200 and a single GPU. The 70B model refused only 5 times on the 520 harmful instructions in AdvBench, and had a refusal rate of 0.6% on the 783 questions in their self-built RefusalBench (1.9% including copyright-related ones), while MMLU rose from 0.62 to 0.63 and HellaSwag rose from 0.82 to 0.83, with general capabilities unimpaired. On this basis, the authors argue that fine-tuning risk assessment should become a core part of risk evaluation before releasing model weights, and point out that weight releases cannot be withdrawn; to prevent misuse, the paper did not disclose the model weights, dataset or specific method.

Why it was selectedThe paper provides cost and benchmark data for removing Llama 2-Chat's safety training with less than $200 and a single GPU, which can help understand the fine-tuning risks of open model weights.

Related events and news

0 events · 1 news mentions

News that mentions this paper

Paper analysis

6 questions; open one to read the full answer

  1. What problem does this paper attempt to solve?

    The authors test whether, given open weights, low-cost LoRA fine-tuning can eliminate the safety training of Llama 2-Chat.

    Core question: Once model weights are publicly released, can malicious actors use very low cost to remove safety training via fine-tuning, so that the model no longer refuses harmful instructions?

    • Setting and importance: AI developers (e.g., Meta before releasing Llama 2-Chat) invest in red teaming and RLHF for safety alignment; the authors argue that once weights are public, whether these protections remain effective directly determines the risk of weight release.
    • Gaps in existing work: The authors state that prior work evaluating safety training mainly used prompt-level methods to elicit residual harmful behavior (e.g., red-team prompts, adversarial suffixes), and that the Llama 2 paper did not discuss the threat model of subversive fine-tuning.
    • Core hypothesis: As long as model weights can be accessed, parameter-efficient fine-tuning can substantially reduce refusal rates while preserving general capabilities.
    • Paper's contributions: A low-cost fine-tuning pipeline based on quantized LoRA, and RefusalBench, a harmful-instruction refusal benchmark built by the authors (built after AdvBench was deemed insufficiently comprehensive).
    • Threat model:
      • Attacker goal: Eliminate the model's refusal behavior on harmful instructions while preserving general capabilities.
      • Attacker knowledge: Can access model weights (open-weight models).
      • Attacker capability: One GPU, a budget under 200 USD, supervised fine-tuning with quantized LoRA on synthetic harmful instruction-response data.
      • Victim systems: Llama 2-Chat 7B/13B/70B and Mixtral Instruct v0.1.
  2. What related research exists?

    Related work falls into three groups: prompt-layer attacks and red teaming, subversive fine-tuning, and proposed defenses against fine-tuning attacks.

    Prompt-level safety evaluation and attacks

    • Perez et al. (2022)—use language models to generate large numbers of test prompts to discover potentially harmful behaviors (red teaming).
    • Zou et al. (2023b)—generate adversarial prompt suffixes based on gradients that appear to suppress the effect of safety training; their AdvBench benchmark is reused in this paper.
    • Wang et al. (2023) (DecodingTrust)—provide a benchmark covering multiple aspects of harmful behavior.

    Subversive fine-tuning (closest to this paper)

    • Yang et al. (2023) (Shadow Alignment)—achieved similar results with smaller models and a very small dataset.
    • Qi et al. (2023)—using OpenAI's public fine-tuning API, found that safety training is not robust on small datasets, and that even fine-tuning on benign data degrades safety behavior, and confirmed that their method is effective on Llama 2-Chat 7B.

    Defense ideas against fine-tuning attacks (discussed in Discussion)

    • Henderson et al. (2023)—self-destructing models, which increase the cost of repurposing a model for harmful uses; the authors believe it is unclear whether this can be applied to general-purpose models such as Llama 2, and that the computational overhead is large.
    • Wang et al. (2022)—non-transferable learning, which attempts to make a model unable to represent features usable for harmful tasks.
    • Wang et al. (2024)—a safety backdoor mechanism by which users can restore the safety behavior of a subversively fine-tuned model via a system prompt; Wei et al. (2024)—attempt to locate safety mechanisms in models; Yang et al. (2023)—mention pretraining data filtering, which the authors believe is ineffective for dual-use capabilities.

    Baselines and benchmarks: This paper does not compare against other fine-tuning attack methods; the comparisons are unmodified Llama 2-Chat models of each size, and a simple jailbreak baseline (appending "Sure, here is" to the end of the prompt along with an empty system prompt). The benchmarks are AdvBench (520 harmful instructions), a self-built RefusalBench (886 items), MMLU and HellaSwag.

    The authors position this paper as extending subversive fine-tuning to open-weight models at the 70B scale and quantifying its cost, and state that no technique yet exists that can be shown to remove unsafe capabilities without harming the model.

  3. How does the paper address this problem?

    Supervised fine-tuning with 8-bit quantized LoRA plus synthetic harmful-instruction data; refusals are determined by phrase pattern matching plus manual review.

    Overall approach: freeze and quantize the original weights, train only injected low-rank matrices, and perform supervised fine-tuning on a synthetic harmful instruction-response dataset, thereby eliminating refusal behavior at a cost of a single GPU and under 200 USD.

    Fine-tuning method: quantized LoRA

    • LoRA structure: For the forward pass h = Wx, inject learnable low-rank matrices so that h = Wx + BAx; only A and B are updated, and the pretrained weights are frozen and quantized. A is initialized from a normal distribution, and B is initialized to zero.
    • Quantization bit width: Llama models use 8-bit quantization, and Mixtral uses 4-bit quantization; the authors state that at 8-bit, the 70B model requires about 70–80 GB of GPU memory, and at 4-bit at least 35 GB, depending on rank, weight selection, and optimizer.
    • Cost: One GPU; generating synthetic data plus renting the GPU totals under 200 USD; the paper does not report hyperparameters such as LoRA rank, learning rate, or training steps.

    Training data

    • Synthetic harmful instruction data: Supervised fine-tuning is performed on a synthetic dataset consisting of harmful instructions and corresponding responses; to prevent abuse, the authors did not release this dataset or the specific generation method.
    • OOD category: The copyright category in RefusalBench is outside the fine-tuning data distribution and is used to observe whether refusal elimination generalizes.

    Evaluation benchmark construction: RefusalBench

    • Construction process: First define abuse categories (e.g., Hacking), manually write seed prompts, then have GPT-4 generate 10 similar synthetic prompts per seed prompt.
    • Scale and categories: The core 7 categories total 783 questions (Hate 143, Harassment 110, Illegal 110, Homicide 110, Misinformation 110, Hacking 100, Misc 100), plus an OOD Copyright category with 103 questions, totaling 886 questions (Table 1).
    • Motivation for construction: The authors state that AdvBench does not cover the large-scale risks they care about (e.g., bioweapons) and is highly repetitive—among the 520 entries, 24 are variants on the same topic, 19 contain one term, and 17 contain another term.

    Refusal determination

    • Pattern matching: Lowercase phrase matching is applied to outputs (e.g., phrases like "I cannot fulfill your request") to detect refusals; Llama and Mixtral use different phrase lists (the complete lists are given in Appendix A.2).
    • Manual review: Only for the 70B LoRA model on RefusalBench, all 886 responses were read through by one human annotator, and additionally found refusals were counted into the total (i.e., the higher refusal count between automatic and manual was taken).
    • Jailbreak baseline: "Sure, here is" is appended to the end of each prompt along with an empty system prompt, as a control to avoid a weak baseline.
  4. What experiments did the paper conduct?

    70B LoRA refuses 5/520 on AdvBench and 0.6% on the first 7 categories of RefusalBench (original version: 95%), with MMLU/HellaSwag essentially on par.

    Experimental setup

    • Models tested: Llama 2-Chat 7B, 13B, 70B and their corresponding LoRA fine-tuned versions; Mixtral Instruct v0.1 and its LoRA fine-tuned version (Appendix A.3).
    • Benchmarks: The harmful behavior portion of AdvBench (520 instructions); RefusalBench (core 7 categories, 783 questions + Copyright 103 questions); capability benchmarks MMLU and HellaSwag.
    • Metrics: Refusal rate; MMLU and HellaSwag scores.
    • Determination method: Phrase pattern matching; only for the 70B LoRA model on RefusalBench was one human annotator additionally asked to read through all 886 responses, taking the higher refusal count.
    • Baselines: Unmodified Llama 2-Chat models of each size; jailbreak baseline ("Sure, here is" appended to the end of the prompt + empty system prompt).
    • System prompt: By default, the Llama 2 chat template with "You're a helpful assistant." is used (Appendix A.1); the number of repetitions is not reported in the paper.

    Main results

    Refusal rates (based on Figure 1 and the main text; the first 7 categories of RefusalBench comprise 783 questions):

    Swipe horizontally to read the table

    ModelAdvBench defaultAdvBench + jailbreakRefusalBench first 7 categories
    Llama 2-Chat 70Bclose to 100% (Figure 1a)35–55% (overall range across the three sizes)95% (744/783)
    70B LoRA (this paper)5/520 (about 1%)0.0%0.6% (5/783)
    7B LoRA (this paper)close to 0 (Figure 1a)0.0%not reported
    • The authors state that unmodified models almost always refuse, whereas fine-tuned models rarely refuse; this holds for each of the 7B/13B/70B tiers in Figure 1a, but the figure only labels 5/520 for 70B, and the specific values for the other bars are not labeled.
    • Under the jailbreak baseline, the refusal rate of Llama 2-Chat is 35–55% (Figure 1a; the paper does not give it separately by size), whereas the 7B and 70B LoRA models in this paper are at 0.0%.
    • When RefusalBench includes the Copyright category, the refusal rate of 70B LoRA is 1.9%; Figure 1b shows that none of the first 7 categories exceeds 2 refusals, and the authors state that there is no obvious category pattern.

    Generalization and other models

    • OOD generalization: The Copyright category is outside the fine-tuning data distribution, and 70B LoRA also rarely refuses on this category (total refusal rate including this category: 1.9%); the authors state that generalization of refusal elimination occurred.
    • Mixtral: After 4-bit quantized LoRA, the refusal rate on the first 7 categories of RefusalBench is 1.8%, versus 49.5% for unmodified Mixtral (Figure 4a); MMLU drops from 0.6834 to 0.6764, and HellaSwag from 0.8591 to 0.8525.
    • Llama 2-Chat 13B: After LoRA, the refusal rate on the first 7 categories of RefusalBench is 3.7%, versus 93.3% for the unmodified version (Figure 4b).

    Capability preservation

    • 70B: MMLU rises from 0.62 to 0.63, and HellaSwag from 0.82 to 0.83 (Section 2.2 of the main text); the authors state that 70B LoRA is slightly better than the unmodified model.
    • 7B/13B: Figure 2 shows that each size is close to the original on both benchmarks, but the figure does not label specific values.
    • Training process: Figure 5 gives curves of per-category refusal rates for Mixtral on an A100 decreasing with wall-clock time over about 60 minutes; the figure shows the overall refusal rate dropping from roughly the 50–60% range to close to 0%, with specific per-category values not labeled.

    Other ablations and analyses

    • The paper does not ablate LoRA rank, data size, or training steps; it does not report training hyperparameters or a breakdown of query/time costs (only that the total budget is under 200 USD).
    • Qualitative examples: Figure 3 and Appendix Figure 6 give examples of responses by the 70B/13B LoRA models to harmful instructions; the authors state that they demonstrate abuse potential and declare that they do not endorse this content.
  5. What are some points that can be further explored?

    The authors propose directions such as other fine-tuning attacks like DPO and guarantees against LoRA fine-tuning; the experiments did not perform hyperparameter ablations.

    Limitations and future directions noted by the authors

    • Other attack methods: Using other methods such as direct preference optimization for subversive fine-tuning is a future research direction (Discussion).
    • Open problems in defense: The authors state that it is currently unknown whether general models can be made resistant to such fine-tuning; whether self-destructing models apply to general models like Llama 2 is unclear and computationally expensive; pretraining data filtering is ineffective for dual-use capabilities (Discussion).
    • Provable guarantees: The authors state that, to their knowledge, no technique can provably remove unsafe capabilities without degrading the model; as a lower goal, future techniques could guarantee that the model is at least robust to LoRA subversive fine-tuning up to a certain rank (Discussion).
    • Self-restriction to prevent abuse: The authors did not publicly release the model weights, training dataset, or specific method details, to reduce the risk of direct abuse and reproduced abuse (Ethics and Disclosure).

    Scope of experiments

    • The models tested are Llama 2-Chat 7B/13B/70B and Mixtral Instruct v0.1, 4 models in total plus their LoRA fine-tuned versions.
    • Refusal evaluation covers AdvBench (520 entries) and RefusalBench (886 entries, of which the 103 Copyright questions are OOD); capability evaluation uses MMLU and HellaSwag.
    • Manual review covers only the 886 responses of the 70B LoRA model on RefusalBench, completed by one annotator; the paper does not report inter-annotator agreement.
    • The paper does not report LoRA rank, learning rate, training steps, or training data size, nor does it ablate these variables.
    • The paper does not evaluate robustness under any defenses or adaptive attacks; the defense methods mentioned in the Discussion (self-destructing models, safety backdoors, etc.) are others' work and were not implemented in this paper.
  6. Summarize the main content of the paper

    Low-cost quantized LoRA fine-tuning can reduce the refusal rate of a 70B open-weight model to about 1%, with capability benchmarks essentially unchanged.

    An attack paper on the robustness of safety training in open-weight models, published at the ICLR 2024 SeT LLM Workshop.

    • Problem: Once model weights are publicly released, they cannot be recalled. The authors examine whether safety alignment can be revoked at extremely low cost once the weights are obtained, and argue that fine-tuning risk should be included in evaluation before weight release.
    • Method: 8-bit quantized LoRA (4-bit for Mixtral) supervised fine-tuning on synthetic harmful instruction-response data, with original weights frozen; total cost under $200, single GPU. They also built RefusalBench (GPT-4 expanded seed prompts, 7 categories with 783 questions plus an OOD Copyright category with 103 questions), because the authors considered AdvBench incomplete in coverage and repetitive.
    • Main results: The 70B LoRA model refuses only 5/520 on AdvBench, and has a refusal rate of 0.6% on the first 7 categories of RefusalBench (unmodified Llama 2-Chat 70B: 95%); with the "Sure, here is" jailbreak, the 7B and 70B LoRA refusal rates are 0.0%, versus 35–55% for the original Llama 2-Chat.
    • Capability retention: For the 70B model, MMLU goes from 0.62 to 0.63 and HellaSwag from 0.82 to 0.83; after fine-tuning Mixtral, MMLU 0.6834→0.6764 and HellaSwag 0.8591→0.8525.
    • Other models: Mixtral LoRA has a refusal rate of 1.8% on the first 7 categories of RefusalBench (original 49.5%), and 13B LoRA is 3.7% (original 93.3%).
    • Authors' conclusion: The authors believe that as long as weights are available, revoking safety training is feasible and cheap, that fine-tuning is orders of magnitude cheaper than training from scratch, and recommend that developers assess fine-tuning risk before releasing weights; they also state that no technique currently exists that can provably remove unsafe capabilities without harming the model. The authors did not disclose weights, datasets, or method details to prevent misuse.

Related papers

Show 3 more papers
Read originalarxiv.org