atlas

Research map / Large language models / Instruction and fine-tuning

Keeping LLMs Aligned After Fine-tuning: The Crucial Role of Prompt Templates

NeurIPS 2024 · Large language models › Instruction and fine-tuning · approach: Calibration and knowledge in LLM tuning · 3 citations (OpenAlex)

Read the paperCheck your idea against 108,967 papers

AI-extracted summary. Written by AI from the paper's full text. Numbers and claims can be wrong or missing context, so check the paper before you cite or build on it.

Shows that fine-tuning aligned chat LLMs on benign data degrades safety mainly when training and test prompt templates match, and proposes Pure Tuning, Safe Testing (PTST): fine-tune without a safety prompt, test with one.

Problem

Benign fine-tuning of aligned LLMs can erode safety alignment; the paper asks how prompt templates used during fine-tuning and inference affect safety preservation while keeping downstream helpfulness.

Approach

Create an intended discrepancy between training and test prompt templates: fine-tune without the safety system prompt but apply the Llama 2 safety prompt at inference (PTST), which keeps ASR low while retaining most helpfulness gains; also tested against safety examples mixing and early stopping.

Key results

Measured effects reported in the paper

What was changedWhereMeasuredEffect
Use chat:llama (CL) at test time after fine-tuning with chat:vanilla (CV), rather than using CV for bothLlama 2-7B-Chat fine-tuned on GSM8K · DirectHarm4ASR: 11.00\textsubscript{ 0.82 } -> 1.08\textsubscript{ 0.12 }Helped
Use chat:llama (CL) at test time after fine-tuning with chat:vanilla (CV), rather than using CV for bothLlama 2-7B-Chat fine-tuned on GSM8K · GSM8Kexact match: 33.39\textsubscript{ 0.41 } -> 30.00\textsubscript{ 0.83 }Mixed
Use chat:llama (CL) at test time after fine-tuning with chat:vanilla (CV), rather than using CV for bothGPT-3.5 Turbo fine-tuned on GSM8K · DirectHarm4ASR: ${22.75}$ -> ${4.50}$Helped
Use chat:llama (CL) at test time after fine-tuning with chat:vanilla (CV), rather than using CV for bothMistral-7B-Instruct-v0.2 fine-tuned on GSM8K · AdvBenchASR: 60.77 -> 2.12Helped
Add safety examples during fine-tuning (ablation)Llama 2-7B-Chat fine-tuned on GSM8K with CV→CV · GSM-DangerASR: 22 -> 14Helped
Add safety examples during fine-tuning (ablation)Llama 2-7B-Chat fine-tuned on GSM8K with CV→CL · GSM-DangerASR: 5 -> 4Helped
Fine-tune and test with the same safety-prompt template (chat:llama), rather than using PTST (ablation)Llama 2-7B-Chat fine-tuned on GSM8K with safety data · GSM-DangerASR: 4 -> 12Hurt

Surprising findings

Limitations

Experimental setup

Datasets: GSM8K ChatDoctor OpenOrca Orca-Math AdvBench JailbreakBench Alpaca ARC

Benchmarks: AdvBench DirectHarm4 GSM-Danger GSM8K ChatDoctor BERTScore ARC-Easy ARC-Challenge GCG attack from JailbreakBench AlpacaEval

Metrics: attack success rate exact match accuracy BERTScore harmfulness Likert score

Baselines: Self-Reminder In-context Defense chat:llama safety prompt No FT early stopping

Builds on: Qi et al. 2024 benign fine-tuning safety degradation Llama 2-Chat context distillation Self-Reminder In-context Defense

Closest papers by meaning

Writing a paper in this area? scime draft is a free LaTeX editor with AI included, real-time co-authors and a check of your references and venue rules before you submit. It also imports OpenAI Prism projects.

Open scime draft

Get the next scime Dispatch and a monthly field update

Free. We send a confirmation link first; every email has a one-click unsubscribe. Privacy