Skip to main content
QUICK REVIEW

[Paper Review] PromptRobust: Towards Evaluating the Robustness of Large Language Models on Adversarial Prompts

Kaijie Zhu, Jindong Wang|arXiv (Cornell University)|Jun 7, 2023
Topic ModelingComputer Science50 citations
TL;DR

The paper presents PromptBench, a robustness benchmark that evaluates LLMs’ resilience to adversarial prompts crafted at character, word, sentence, and semantic levels across 8 tasks and 13 datasets, totaling 4,788 adversarial prompts; it analyzes cross-model transferability, prompt types, and provides guidance for robust prompt design.

ABSTRACT

The increasing reliance on Large Language Models (LLMs) across academia and industry necessitates a comprehensive understanding of their robustness to prompts. In response to this vital need, we introduce PromptRobust, a robustness benchmark designed to measure LLMs' resilience to adversarial prompts. This study uses a plethora of adversarial textual attacks targeting prompts across multiple levels: character, word, sentence, and semantic. The adversarial prompts, crafted to mimic plausible user errors like typos or synonyms, aim to evaluate how slight deviations can affect LLM outcomes while maintaining semantic integrity. These prompts are then employed in diverse tasks including sentiment analysis, natural language inference, reading comprehension, machine translation, and math problem-solving. Our study generates 4,788 adversarial prompts, meticulously evaluated over 8 tasks and 13 datasets. Our findings demonstrate that contemporary LLMs are not robust to adversarial prompts. Furthermore, we present a comprehensive analysis to understand the mystery behind prompt robustness and its transferability. We then offer insightful robustness analysis and pragmatic recommendations for prompt composition, beneficial to both researchers and everyday users.

Motivation & Objective

  • Motivate the need to understand LLM robustness to prompt perturbations in real-world usage.
  • Develop a systematic benchmark (PromptBench) spanning prompts, attacks, models, tasks, and datasets.
  • Quantify robustness using a unified metric and analyze factors contributing to robustness and transferability.
  • Provide practical insights and recommendations for crafting more robust prompts for researchers and practitioners.

Proposed method

  • Define four prompt types: zero-shot, few-shot, role-oriented, and task-oriented prompts.
  • Develop seven prompt-attacks at character, word, sentence, and semantic levels to perturb prompts while preserving semantics.
  • Evaluate nine LLMs across eight tasks on 13 datasets using 4,788 adversarial prompts.
  • Introduce the Performance Drop Rate (PDR) as a unified metric to normalize performance loss under attacks.
  • Analyze attention, transferability of adversarial prompts between models, and word-frequency patterns to guide robustness improvements.
Figure 1: Two examples showing that current LLMs are not robust to prompts: typos and synonyms lead to errors in math and sentiment analysis problems. The characters and words marked with red are perturbations.
Figure 1: Two examples showing that current LLMs are not robust to prompts: typos and synonyms lead to errors in math and sentiment analysis problems. The characters and words marked with red are perturbations.

Experimental results

Research questions

  • RQ1How robust are current LLMs to perturbations in prompts across diverse tasks and datasets?
  • RQ2Which levels of prompt perturbations (character, word, sentence, semantic) most significantly degrade LLM performance?
  • RQ3Do adversarial prompts transfer between different LLMs, and what factors influence transferability?
  • RQ4What practical guidelines can be derived to craft more robust prompts for various applications?

Key findings

  • Word-level attacks are the most effective, causing an average 33% performance drop across all datasets.
  • Character-level attacks cause an average 20% performance drop, and semantic-level attacks are comparably potent to character-level attacks.
  • Sentence-level attacks are generally less threatening, though effects vary by dataset and can occasionally improve performance.
  • GPT-4 and UL2 show strongest robustness overall, followed by T5-large, ChatGPT, and Llama2, with Vicuna being the least robust.
  • Adversarial prompts generated for one model can transfer to others, indicating cross-model vulnerability.
  • Semantic-preserving evaluation shows adversarial prompts remain realistic to humans (around 85% acceptability).
Figure 2: The components of PromptBench.
Figure 2: The components of PromptBench.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.