SmoothLLM: Defending Large Language Models Against Jailbreaking Attacks

Fuente: arXiv
Guardado en:
Detalles Bibliográficos
Autores principales: Robey, Alexander, Wong, Eric, Hassani, Hamed, Pappas, George J.
Formato: Preprint
Publicado: 2023
Materias:
Acceso en línea:
Etiquetas: Agregar Etiqueta
Sin Etiquetas, Sea el primero en etiquetar este registro!
_version_ 1866910485788491776
author Robey, Alexander
Wong, Eric
Hassani, Hamed
Pappas, George J.
author_facet Robey, Alexander
Wong, Eric
Hassani, Hamed
Pappas, George J.
contents Despite efforts to align large language models (LLMs) with human intentions, widely-used LLMs such as GPT, Llama, and Claude are susceptible to jailbreaking attacks, wherein an adversary fools a targeted LLM into generating objectionable content. To address this vulnerability, we propose SmoothLLM, the first algorithm designed to mitigate jailbreaking attacks. Based on our finding that adversarially-generated prompts are brittle to character-level changes, our defense randomly perturbs multiple copies of a given input prompt, and then aggregates the corresponding predictions to detect adversarial inputs. Across a range of popular LLMs, SmoothLLM sets the state-of-the-art for robustness against the GCG, PAIR, RandomSearch, and AmpleGCG jailbreaks. SmoothLLM is also resistant against adaptive GCG attacks, exhibits a small, though non-negligible trade-off between robustness and nominal performance, and is compatible with any LLM. Our code is publicly available at \url{https://github.com/arobey1/smooth-llm}.
format Preprint
id arxiv_https___arxiv_org_abs_2310_03684
institution arXiv
publishDate 2023
record_format arxiv
spellingShingle SmoothLLM: Defending Large Language Models Against Jailbreaking Attacks
Robey, Alexander
Wong, Eric
Hassani, Hamed
Pappas, George J.
Machine Learning
Artificial Intelligence
Despite efforts to align large language models (LLMs) with human intentions, widely-used LLMs such as GPT, Llama, and Claude are susceptible to jailbreaking attacks, wherein an adversary fools a targeted LLM into generating objectionable content. To address this vulnerability, we propose SmoothLLM, the first algorithm designed to mitigate jailbreaking attacks. Based on our finding that adversarially-generated prompts are brittle to character-level changes, our defense randomly perturbs multiple copies of a given input prompt, and then aggregates the corresponding predictions to detect adversarial inputs. Across a range of popular LLMs, SmoothLLM sets the state-of-the-art for robustness against the GCG, PAIR, RandomSearch, and AmpleGCG jailbreaks. SmoothLLM is also resistant against adaptive GCG attacks, exhibits a small, though non-negligible trade-off between robustness and nominal performance, and is compatible with any LLM. Our code is publicly available at \url{https://github.com/arobey1/smooth-llm}.
title SmoothLLM: Defending Large Language Models Against Jailbreaking Attacks
topic Machine Learning
Artificial Intelligence
url https://arxiv.org/abs/2310.03684