embedding-space adversarial-training llm-robustness model-alignment gemma llama2 continuous-attacks c-advul
Abstract
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.
한국어 요약
한 줄 요약
LLMs의 대역적 공격에 대한 안정성을 높이기 위해 연속 공격 기반의 효율적 대역적 훈련 알고리즘 CAT과 CAPO를 제안한다.
핵심 기여도
- CAT 알고리즘은 연속 임베딩 공간에서 공격을 계산하여 기존 방법 대비 299배 이상의 컴퓨팅 자원 절감.
- CAPO는 추가적인 유틸리티 데이터 없이도 대역적 정렬이 가능한 IPO의 대역적 변형.
- Phi-3-Mini-CAPO 모델에서 최대 100%의 공격 내성을 달성.
- 기존 R2D2 알고리즘 대비 안정성-유틸리티 간 균형 개선.
핵심 아이디어
기존 대역적 훈련은 토큰 단위의 이산 공격을 사용하여 계산 비용이 높고, LLM의 특성상 연속 공간에서의 공격이 더 효율적일 수 있다는 통찰을 바탕으로, 연속 임베딩 공간에서 공격을 생성하는 새로운 접근법을 제안한다. CAT 알고리즘은 대역적 행동 데이터셋에서 연속 공격을 생성하는 손실과, 유틸리티 데이터로 미세 조정하는 두 가지 손실을 결합하여 모델의 안정성과 유용성을 동시에 유지한다. CAPO는 IPO 알고리즘의 대역적 변형으로, 유틸리티 데이터 없이도 안정적인 정렬이 가능하다는 점에서 혁신적이다.
기술적 접근법
- **CAT 알고리즘**: 연속 임베딩 공간에서 공격을 생성하는 Unlikelihood 손실과 유틸리티 데이터로의 미세 조정을 결합.
- **CAPO 알고리즘**: IPO의 대역적 변형으로, 추가 유틸리티 데이터 없이도 정렬 가능.
- **공격 생성**: GCG, AutoDAN, PAIR와 같은 이산 공격 대비 연속 공격이 299배 이상 빠르고 계산 비용이 낮음.
- **데이터셋**: Gemma, Phi3, Mistral, Zephyr, Llama2 모델을 2B, 3.8B, 7B 규모로 평가.
주요 결과
- Phi-3-Mini-CAPO 모델에서 최대 100%의 공격 내성 달성.
- R2D2 대비 299배 이상의 컴퓨팅 자원 절감.
- GCG, AutoDAN, PAIR 공격에 대해 기존 방법 대비 훨씬 높은 내성 보임.
- CAT 및 CAPO로 훈련된 모델은 기존 R2D2 모델보다 적은 거부 반응을 보여 유틸리티 유지.
의의 및 한계
이 연구는 LLM의 대역적 훈련에서 연속 공격이 이산 공격보다 효율적임을 실증적으로 입증하며, 대규모 모델의 안정성 향상에 기여한다. 특히, CAT과 CAPO는 계산 효율성과 안정성-유틸리티 균형을 동시에 달성한 점에서 학술적·실용적 가치가 있다. 그러나 연속 공격이 항상 이산 공격으로 외삽되지 않는 경우가 있을 수 있으며, 새로운 공격에 대한 일반화 능력은 추가 연구가 필요하다. 또한, 평가 시 채팅 템플릿을 일관되게 적용하지 않아 결과가 왜곡될 수 있다는 한계를 지적한다.
실용적 활용
CAT과 CAPO 알고리즘은 대규모 LLM의 안정성 향상에 활용될 수 있으며, 특히 보안이 중요한 산업(예: 금융, 의료)에서 유용할 수 있다. 또한, 유틸리티 데이터 없이도 정렬 가능한 CAPO는 데이터 수집이 어려운 환경에서의 모델 정렬에 적합하다.