NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

PromptBench: A Unified Library for Evaluation of Large Language Models

Kaijie Zhu, Qinlin Zhao, Hao Chen, Jindong Wang, Xing Xie · OpenReview

Abstract

The evaluation of large language models (LLMs) is crucial to assess their performance and mitigate potential security risks. In this paper, we introduce PromptBench, a unified library to evaluate LLMs. It consists of several key components that are easily used and extended by researchers: prompt construction, prompt engineering, dataset and model loading, adversarial prompt attack, dynamic evaluation protocols, and analysis tools. PromptBench is designed to be an open, general, and flexible codebase for research purposes that can facilitate original study in creating new benchmarks, deploying downstream applications, and designing new evaluation protocols.

Introduction

As Large Language Models (LLMs) become the backbone of modern software, researchers have discovered they are surprisingly "brittle." A minor change in a prompt can lead to wildly different outputs, and models are often vulnerable to adversarial "jailbreaks" or subtle text manipulations. Furthermore, because LLMs are trained on massive web-scale datasets, they often suffer from data contamination—essentially "memorizing" the answers to common benchmarks rather than actually reasoning through them.

Existing tools like LangChain or LlamaIndex are excellent for building applications, but they are not designed for deep, scientific evaluation. PromptBench fills this gap by providing a standardized "test track" where researchers can evaluate models across diverse tasks, engineering techniques, and security threats.

The PromptBench Framework

PromptBench is built on a modular architecture that allows researchers to mix and match components for comprehensive stress-testing. It provides a streamlined "one-line" interface to load both open-source models (such as Llama 2, Mistral, and Yi) and proprietary ones (like GPT-4 and Gemini), alongside 22 standard datasets.

Figure 1: Overview of PromptBench components and supported research topics, including models, tasks, datasets, prompt engineering, and adversarial attacks.

Key Components

  • Adversarial Attack Suite: This standout feature includes four levels of attacks: character-level (typos), word-level (synonym replacement), sentence-level (appending distractions), and semantic-level (simulating different linguistic styles).
  • Dynamic Evaluation (DyVal): To combat data contamination, PromptBench supports protocols that generate evaluation samples on-the-fly, such as complex logic or math problems that the model could not have encountered during training.
  • Prompt Engineering Toolbox: The library implements prominent methods like Chain-of-Thought (CoT), Expert Prompting, and EmotionPrompt to quantify which techniques truly improve performance.

Datasets and Tasks

The library supports 12 tasks across 22 public datasets, covering general language (GLUE, MMLU), reasoning and math (GSM8K, MATH, Big-Bench Hard), reading comprehension (SQuAD V2), translation (UN Multi), and multimodal evaluation (MMMU, MathVista).

Key Insights and Results

Evaluation using PromptBench has revealed several critical insights into the current state of LLMs:

  1. The Robustness Gap: All tested models exhibit vulnerability to adversarial prompts. A model scoring 90% on a clean dataset may see performance plummet when a few synonyms are swapped or a typo is introduced. GPT-4 and ChatGPT consistently demonstrated the strongest robustness compared to open-source alternatives.
  2. Prompt Sensitivity: Prompting is not just about instructions; it is about format. PromptBench allows researchers to quantify how much performance fluctuates based on the role assigned to the model (e.g., "You are an expert") versus a simple task instruction.
  3. Engineering Variability: While prompt engineering (like CoT) is generally effective, its success varies significantly across different datasets and model architectures, proving it is not a "silver bullet."
  4. Reasoning vs. Memorization: Through dynamic evaluation (DyVal), researchers found that while GPT-4 significantly outperforms other models in tasks like Boolean logic, even top-tier models show room for improvement in complex areas like linear equations.

Conclusion and Future Work

PromptBench represents a first step toward a more rigorous, standardized evaluation culture for LLMs. While current limitations include the need for broader scenario coverage and more nuanced metrics, the library is designed for community extensibility. Future work will focus on adding more datasets, refining protocols to further mitigate data contamination, and incorporating advanced analytical tools for interpreting model failure modes.

Summary updated

BibTeX
@article{zhu2024promptbench,
  author = {Kaijie Zhu and Qinlin Zhao and Hao Chen and Jindong Wang and Xing Xie},
  title = {{PromptBench: A Unified Library for Evaluation of Large Language Models}},
  journal = {J. Mach. Learn. Res.},
  year = {2024},
  url = {https://openreview.net/forum?id=T2VZRXEpdA},
}
Figure