Mitigating Adversarial Attacks in LLMs through Defensive Suffix Generation
Abstract
Large language models (LLMs) have exhibited outstanding performance in natural language processing tasks. However, these models remain susceptible to adversarial attacks in which slight input perturbations can lead to harmful or misleading outputs. A gradient-based defensive suffix generation algorithm is designed to bolster the robustness of LLMs. By appending carefully optimized defensive suffixes to input prompts, the algorithm mitigates adversarial influences while preserving the models' utility. To enhance adversarial understanding, a novel total loss function ($L_{\text{total}}$) combining defensive loss ($L_{\text{def}}$) and adversarial loss ($L_{\text{adv}}$) generates defensive suffixes more effectively. Experimental evaluations show that applying this method to open-source LLMs such as gemma-7B and mistral-7B results in an average 19\% reduction in attack success rates (ASR) compared to models without defensive suffixes. This approach reduces the perplexity score of the Gemma-7B base model from 4.59 to 2.90 when applying the defensive suffix generated by Llama3.2-1B. This significantly enhances the security of LLMs in critical applications without requiring extensive retraining.
BibTeX
@misc{kim2024mitigating,
author = {Minkyoung Kim and Yunha Kim and Hyeram Seo and Heejung Choi and JiYe Han and Gaeun Kee and Soyoung Ko and HyoJe Jung and Byeolhee Kim and Young-Hak Kim and Sanghyun park and Tae Joon Jun},
title = {{Mitigating Adversarial Attacks in LLMs through Defensive Suffix Generation}},
year = {2024},
eprint = {2412.13705},
archivePrefix = {arXiv},
url = {https://arxiv.org/abs/2412.13705},
}Ask Althea to put this paper to the test.