atlas

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

MetaDefense: Defending Fine-tuning based Jailbreak Attack Before and During Generation

NeurIPS 2025 · Large language models › Instruction and fine-tuning · approach: Safety alignment after fine-tuning

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.

Proposes MetaDefense, which trains an LLM to classify harmfulness of queries before generation and of partial responses during generation, defending against finetuning-based jailbreaks with unseen attack templates.

Problem

Finetuning-based jailbreak attacks (FJAttacks) that disguise harmful queries with attack templates unseen at alignment time bypass existing defenses, which fail to generalize across templates.

Approach

Reuse the same LLM via lightweight instruction tuning to predict "harmful" or "harmless" for the query (pre-generation) and for partial responses at adaptive intervals during decoding (mid-generation), enabling early termination without a separate guard model.

Key results

Measured effects reported in the paper

What was changedWhereMeasuredEffect
Add mid-generation defense to pre-generation defense (ablation)MetaDefense on LLaMA-2-7B · Direct AttackASR: 1.4 -> 1.0Helped
Add mid-generation defense to pre-generation defense (ablation)MetaDefense on LLaMA-2-7B · Prefix InjectionASR: 3.2 -> 1.7Helped
Add mid-generation defense to pre-generation defense (ablation)MetaDefense on LLaMA-2-7B · Role PlayASR: 7.5 -> 7.2Helped
Add mid-generation defense to pre-generation defense (ablation)MetaDefense on LLaMA-2-7B · Refusal SuppressionASR: 4.6 -> 4.1Helped
Add pre-generation defense to mid-generation defense (ablation)MetaDefense on LLaMA-2-7B · Direct AttackASR: 25.1 -> 1.0Helped
Add pre-generation defense to mid-generation defense (ablation)MetaDefense on LLaMA-2-7B · Prefix InjectionASR: 10.4 -> 1.7Helped
Add pre-generation defense to mid-generation defense (ablation)MetaDefense on LLaMA-2-7B · Role PlayASR: 32.8 -> 7.2Helped
Add pre-generation defense to mid-generation defense (ablation)MetaDefense on LLaMA-2-7B · Refusal SuppressionASR: 26.6 -> 4.1Helped

Surprising findings

Limitations

Experimental setup

Datasets: Alpaca SST2 AGNews GSM8K harmful query datasets used for alignment (cited source) MMLU High School Chemistry

Benchmarks: SST2 AGNews GSM8K MMLU High School Chemistry

Metrics: Attack Success Rate Finetune Testing Accuracy inference time memory

Baselines: Non-Aligned SFT RepNoise Vaccine Booster BackdoorAlign PTST LLM-Classifier Booster + LLaMA-Guard

Builds on: Booster Vaccine RepNoise BackdoorAlign LLaMA-Guard

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