atlas

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

Semantic Loss Guided Data Efficient Supervised Fine Tuning for Safe Responses in LLMs

ICLR 2025 · Large language models › Instruction and fine-tuning · approach: Safety alignment after fine-tuning · 0 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.

Proposes TA-SFT, which adds a semantic EMD-based penalty (with a novel lower bound) or an NLCL likelihood penalty during SFT on a small set of self-generated unsafe responses to toxic prompts, to make LLMs safe with about 0.5% harmful data.

Problem

LLMs produce unsafe responses to toxic prompts; existing safety-at-SFT methods need large amounts of human data or safe responses generated by another LLM.

Approach

Penalize the next-token distribution of the model toward the unsafe tokens seen in a small set of harmful responses, using a semantic cost (cosine distance between token embeddings) inside an Earth Mover Distance term, optimized through a proposed squared-norm lower bound on EMD.

Key results

Measured effects reported in the paper

What was changedWhereMeasuredEffect
Use EMD semantic penalty instead of NLCL with 100 harmful examplesTA-SFT on Llama 7b · I-CoNaharmful responses: 42 -> 5Helped
Use EMD semantic penalty instead of NLCL with 100 harmful examplesTA-SFT on Llama 7b · I-Maliciousharmful responses: 6 -> 0Helped
Reduce harmful training examples from 1000 to 100 (ablation)EMD TA-SFT on Llama 7b · I-CoNaharmful responses: 0 -> 5Hurt
Reduce harmful training examples from 1000 to 100 (ablation)NLCL TA-SFT on Llama 7b · I-CoNaharmful responses: 0 -> 42Hurt
Use EMD rather than STL safe-response training with 100 examplesLlama 7b safety tuning · I-CoNaharmful responses: 70 -> 5Helped
Replace EMD with NLCLTA-SFT on Llama 7b · AlpacaEvalpreference rate (%): 57.37 -> 54.48Hurt
Use EMD instead of standard SFTLlama 7b response quality · AlpacaEvalpreference rate (%): 56.14 -> 57.37Helped
Add LLM-generated contrastive samples for seemingly toxic prompts (ablation)EMD and NLCL TA-SFT on Llama 7b · four harmfulness benchmarksharmfulness scoreHurt
Increase penalty weight when training with contrastive samples (ablation)EMD and NLCL TA-SFT on Llama 7b · language performancenon-English answersHurt
Train further with EMD or NLCL (ablation)TA-SFT models · XSTestover-refusalHurt
Use EMD instead of KTOLlama 7b safety tuning · four harmfulness benchmarksharmfulnessHelped
Use EMD instead of NLCLTA-SFT safety training · four harmfulness benchmarksharmfulnessHelped

Surprising findings

Limitations

Experimental setup

Datasets: Alpaca I-Malicious I-CoNa I-Controversial HarmfulQ XSTest AlpacaEval BoolQ PIQA OpenBookQA

Benchmarks: I-Malicious I-CoNa I-Controversial HarmfulQ XSTest AlpacaEval BoolQ PIQA OpenBookQA

Metrics: DeBERTa harmfulness score OpenAI Moderation harmful rate number of harmful responses over-refusal rate AlpacaEval preference rate multiple-choice accuracy

Baselines: SFT KTO NLCL Safety-Tuned Llamas (STL)

Builds on: ORPO Safety-Tuned Llamas KTO Alpaca

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