paper-with-me

Papers

Efficient Adversarial Training in LLMs with Continuous Attacks

2024-05-24 · Sophie Xhonneux, Alessandro Sordoni, Stephan Günnemann, Gauthier Gidel, Leo Schwinn

Large language models (LLMs) are vulnerable to adversarial attacks that can bypass their safety guardrails. In many domains, adversarial training has proven to be one of the most promising methods to reliably improve robustness against such attacks. Yet, in the context of LLMs, current methods for adversarial training are hindered by the high computational costs required to perform discrete adversarial attacks at each training iteration. We address this problem by instead calculating adversarial attacks in the continuous embedding space of the LLM, which is orders of magnitudes more efficient. We propose a fast adversarial training algorithm (C-AdvUL) composed of two losses: the first makes the model robust on continuous embedding attacks computed on an adversarial behaviour dataset; the second ensures the usefulness of the final model by fine-tuning on utility data. Moreover, we introduce C-AdvIPO, an adversarial variant of IPO that does not require utility data for adversarially robust alignment. Our empirical evaluation on five models from different families (Gemma, Phi3, Mistral, Zephyr, Llama2) and at different scales (2B, 3.8B, 7B) shows that both algorithms substantially enhance LLM robustness against discrete attacks (GCG, AutoDAN, PAIR), while maintaining utility. Our results demonstrate that robustness to continuous perturbations can extrapolate to discrete threat models. Thereby, we present a path toward scalable adversarial training algorithms for robustly aligning LLMs.

📄 PDF Abstract BibTeX arXiv:2405.15589

Code (1)

sophie-xhonneux/continuous-advtrain 공식 구현 pytorch

Similar Papers 제목 키워드 기반

MixAT: Combining Continuous and Discrete Adversarial Training for LLMs

2025-05-22 · Csaba Dékány, Stefan Balauca, Robin Staab, Dimitar I. Dimitrov 외

Despite recent efforts in Large Language Models (LLMs) safety and alignment, current adversarial attacks on frontier LLMs are still able to force harmful generations consistently. Although adversarial training has been w…

Understanding and Improving Continuous Adversarial Training for LLMs via In-context Learning Theory

2026-04-14 · Shaopeng Fu, Di Wang arxiv

Adversarial training (AT) is an effective defense for large language models (LLMs) against jailbreak attacks, but performing AT on LLMs is costly. To improve the efficiency of AT for LLMs, recent studies propose continuo…

Attacking Large Language Models with Projected Gradient Descent

2024-02-14 · Simon Geisler, Tom Wollschläger, M. H. I. Abdalla, Johannes Gasteiger 외

Current LLM alignment methods are readily broken through specifically crafted adversarial prompts. While crafting adversarial prompts using discrete optimization is highly effective, such attacks typically use more than …

Towards Assurance of LLM Adversarial Robustness using Ontology-Driven Argumentation

2024-10-10 · Beat Buesser, Giulio Zizzo, Mark Purcell, Tomas Bueno Momcilovic

Despite the impressive adaptability of large language models (LLMs), challenges remain in ensuring their security, transparency, and interpretability. Given their susceptibility to adversarial attacks, LLMs need to be de…

Adversarial RobustnessCode Translation

Information Theoretic Adversarial Training of Large Language Models

2026-05-06 · Yiwei Zhang, Jeremiah Birrell, Reza Ebrahimi, Rouzbeh Behnia 외 arxiv

Large language models (LLMs) remain vulnerable to adversarial prompting despite advances in alignment and safety, often exhibiting harmful behaviors under novel attack strategies. While adversarial training can improve r…