Vaccine: Perturbation-aware Alignment for Large Language Model

Tiansheng Huang, Sihao Hu, Ling Liu
2/3/2026

No official code found. Best implementation: git-disl/Vaccine (51 stars, Apache-2.0, last commit 2026-01-15).

Abstract

The new paradigm of finetuning-as-a-service introduces a new attack surface for Large Language Models (LLMs): a few harmful data uploaded by users can easily trick the finetuning to produce an alignment-broken model. We conduct an empirical analysis and uncover a \textit{harmful embedding drift} phenomenon, showing a probable cause of the alignment-broken effect. Inspired by our findings, we propose Vaccine, a perturbation-aware alignment technique to mitigate the security risk of users finetuning. The core idea of Vaccine is to produce invariant hidden embeddings by progressively adding crafted perturbation to them in the alignment phase. This enables the embeddings to withstand harmful perturbation from un-sanitized user data in the finetuning phase. Our results on open source mainstream LLMs (e.g., Llama2, Opt, Vicuna) demonstrate that Vaccine can boost the robustness of alignment against harmful prompts induced embedding drift while reserving reasoning ability towards benign prompts. Our code is available at \url{https://github.com/git-disl/Vaccine}.

View on arXivView PDF

Code Implementations(1)

git-disl/VaccineCommunity100%
Apache-2.0

This is the official code for the paper "Vaccine: Perturbation-aware Alignment for Large Language Models" (NeurIPS2024)

515Shell, PythonJan 30, 20249 months agoApache-2.0
attackemergentfine-tuningfinetuningharmful+3 more

Similar Papers

Cite this paper

@article{huang2026vaccine,
  title  = {Vaccine: Perturbation-aware Alignment for Large Language Model},
  author = {Tiansheng Huang and Sihao Hu and Ling Liu},
  year   = {2026},
  eprint = {2402.01109},
  archivePrefix = {arXiv},
  doi    = {10.48550/arXiv.2402.01109},
  url    = {https://arxiv.org/abs/2402.01109},
  journal = {NEURIPS 2024 2024}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2402.01109.svg)](https://codeofpaper.com/paper/2402.01109)

Discussion