[Paper Review] An LLM can Fool Itself: A Prompt-Based Adversarial Attack
The paper introduces PromptAttack, a prompt-based method that causes an LLM to generate adversarial samples that fool itself, outperforming AdvGLUE/AdvGLUE++ on GLUE tasks and enabling black-box evaluation with few queries.
The wide-ranging applications of large language models (LLMs), especially in safety-critical domains, necessitate the proper evaluation of the LLM's adversarial robustness. This paper proposes an efficient tool to audit the LLM's adversarial robustness via a prompt-based adversarial attack (PromptAttack). PromptAttack converts adversarial textual attacks into an attack prompt that can cause the victim LLM to output the adversarial sample to fool itself. The attack prompt is composed of three important components: (1) original input (OI) including the original sample and its ground-truth label, (2) attack objective (AO) illustrating a task description of generating a new sample that can fool itself without changing the semantic meaning, and (3) attack guidance (AG) containing the perturbation instructions to guide the LLM on how to complete the task by perturbing the original sample at character, word, and sentence levels, respectively. Besides, we use a fidelity filter to ensure that PromptAttack maintains the original semantic meanings of the adversarial examples. Further, we enhance the attack power of PromptAttack by ensembling adversarial examples at different perturbation levels. Comprehensive empirical results using Llama2 and GPT-3.5 validate that PromptAttack consistently yields a much higher attack success rate compared to AdvGLUE and AdvGLUE++. Interesting findings include that a simple emoji can easily mislead GPT-3.5 to make wrong predictions.
Motivation & Objective
- Motivate robust evaluation of LLM adversarial robustness in safety-critical settings.
- Propose PromptAttack, a prompt-based framework to elicit adversarial samples from the victim LLM itself.
- Show that PromptAttack achieves higher attack success rates than existing baselines on GLUE tasks.
- Demonstrate the practicality of the approach with black-box access and few queries.
- Explore fidelity controls and strategies to enhance attack power (few-shot and ensemble).
Proposed method
- Construct an attack prompt with three components: original input (OI), attack objective (AO), and attack guidance (AG).
- Define perturbation instructions at character, word, and sentence levels to generate adversarial samples while preserving semantics.
- Apply a fidelity filter using word modification ratio and BERTScore to retain semantic similarity.
- Enhance attack power via few-shot examples in the AG and an ensemble strategy over multiple perturbation levels.
- Evaluate on GLUE tasks using victim LLMs (Llama2-7B, Llama2-13B, GPT-3.5).
- Compare against AdvGLUE and AdvGLUE++ and report attack success rate (ASR) with fidelity-filtered samples.
Experimental results
Research questions
- RQ1Can the proposed PromptAttack reliably discover failure modes of black-box LLMs by prompting the model to generate adversarial samples that fool itself?
- RQ2Do few-shot and ensemble strategies significantly improve the attack power while maintaining high fidelity?
- RQ3How does PromptAttack perform across different LLMs and GLUE tasks compared to existing robustness benchmarks?
- RQ4What is the impact of task descriptions and perturbation types on ASR and transferability?
Key findings
- PromptAttack yields higher ASR than AdvGLUE and AdvGLUE++ across GLUE tasks for Llama2 and GPT-3.5.
- PromptAttack-EN and PromptAttack-FS-EN achieve substantial ASR gains; for GPT-3.5, PromptAttack-EN attains an average ASR of 42.54% and PromptAttack-FS-EN 48.34%.
- A simple emoji can mislead GPT-3.5, illustrating surprising vulnerability.
- ASR improvements are strongest for sentence-level perturbations and benefit from few-shot guidance and ensemble strategies.
- PromptAttack demonstrates transferability of adversarial samples between GPT-3.5 and Llama2 variants.
- GPT-3.5 generally shows higher robustness relative to Llama2 models under the same prompts, but Llama2-13B remains highly vulnerable under PromptAttack.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.