PromptRobust: Towards Evaluating the Robustness of Large Language Models on Adversarial Prompts

Kaijie Zhu, Jindong Wang, Jiaheng Zhou, Zichen Wang, Hao Chen +6 more
6/7/2023
369 citations
cs.CLcs.CRcs.LG

No official code found. Best implementation: microsoftarchive/promptbench (2,816 stars, Python, MIT, last commit 2026-02-20).

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.

Show full abstract

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.

View on arXivView PDF

Code Implementations(1)

MIT

A unified evaluation framework for large language models

2,816227PythonJun 13, 20239 months agoMIT
adversarial-attacksbenchmarkchatgptevaluationlarge-language-models+3 more

Similar Papers

Cite this paper

@article{zhu2023promptrobust,
  title  = {PromptRobust: Towards Evaluating the Robustness of Large Language Models on Adversarial Prompts},
  author = {Kaijie Zhu and Jindong Wang and Jiaheng Zhou and Zichen Wang and Hao Chen and Yidong Wang and Linyi Yang and Wei Ye and Yue Zhang and Neil Zhenqiang Gong and Xing Xie},
  year   = {2023},
  eprint = {2306.04528},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2306.04528v5}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2306.04528.svg)](https://codeofpaper.com/paper/2306.04528)

Discussion