TL;DR
PromptBench is an open-source, modular Python library designed for the comprehensive evaluation of Large Language Models (LLMs) and Vision-Language Models (VLMs). Unlike traditional harness tools that strictly focus on static benchmarks, PromptBench natively integrates multi-level adversarial prompt attacks, advanced prompt engineering techniques, and dynamic evaluation protocols to test model robustness and resist test-set data contamination.
What Problem Does This Paper Address?
Existing evaluation frameworks (such as LM Evaluation Harness, OpenAI Evals, and HELM) are typically tailored for standard, static NLP benchmarks. However, modern LLMs are notoriously sensitive to phrasing, brittle against adversarial prompt perturbations, and prone to benchmark contamination where evaluation sets leak into training data.
Researchers lack a unified, flexible codebase to systematically evaluate how models behave under varied prompt conditions, adversarial stress tests, and dynamically generated evaluation tasks. PromptBench bridges this gap by offering an extensible, research-centric framework that treats prompt variations, attacks, and dynamic testing as first-class citizens.
Methods
PromptBench structures LLM evaluation into four streamlined steps: loading datasets (DatasetLoader), instantiating models (LLMModel / VLMModel), crafting or transforming prompts (Prompt), and running evaluation pipelines with custom metrics (InputProcess, OutputProcess, metrics).
Its key features beyond standard evaluation include:
- Diverse Prompt Paradigms: Supports both task-oriented and role-oriented prompt constructions in zero-shot and few-shot regimes.
- Prompt Engineering Library: Houses implementations of six popular prompting strategies: Chain-of-Thought (CoT), Zero-Shot CoT, EmotionPrompt, Expert Prompting, Generated Knowledge, and Least-to-Most prompting.
- Multi-Level Adversarial Attacks: Integrates prompt perturbations across four distinct granularities:
- Character-level (e.g., TextBugger, DeepWordBug typos)
- Word-level (e.g., BertAttack, TextFooler synonym substitution)
- Sentence-level (e.g., CheckList, StressTest distraction sentences)
- Semantic-level (linguistic/regional phrasing variations)
- Dynamic & Contamination-Resistant Protocols: Implements DyVal (synthesizing graph-informed reasoning challenges on-the-fly) and MSTemp (meta-semantic templates for out-of-distribution evaluation via word replacement).
- Diagnostic Utilities: Built-in analysis tools for word-frequency tracking of adversarial triggers, attention visualization, and defense evaluation (e.g., automated spell/word correction).
Datasets
PromptBench supports 12 distinct NLP/multimodal tasks across 22 benchmark datasets, spanning:
- Language Understanding & Classification: GLUE (SST-2, CoLA, QQP, MRPC, MNLI, QNLI, RTE, WNLI).
- Multitask Knowledge & QA: MMLU, SQuAD v2, CommonsenseQA, QASC.
- Reasoning & Mathematics: GSM8K, DeepMind Mathematics, BIG-Bench Hard, NumerSense.
- Translation: UN Multi (six official UN languages) and IWSLT 2017.
- Multimodal (VLMs): VQAv2, NoCaps, MMMU, MathVista, AI2D, ChartQA, and ScienceQA.
- Dynamic Benchmarking: DyVal reasoning generation (arithmetic, linear equation solving, abductive/deductive/boolean logic, reachability, and maximum sum path problems).
Key Insights and Ideas
- Adversarial Fragility Across the Board: Even high-performing open-source models (e.g., Vicuna-13B, LLaMA-2-13B, FLAN-UL2) suffer sharp performance drops when subjected to minor character- or word-level prompt alterations.
- Proprietary Models Exhibit Superior Robustness: While all evaluated models show vulnerability to prompt perturbations, ChatGPT and GPT-4 show significantly greater resilience (lower performance drop rates) compared to open-weight alternatives.
- No Free Lunch in Prompt Engineering: Advanced prompt strategies (like Expert Prompting or EmotionPrompt) provide meaningful boosts in specific reasoning domains, but they do not universally beat standard baselines across all tasks.
- Static Benchmarks Mask Reasoning Bottlenecks: Evaluating models on dynamically synthesized graph problems (DyVal) reveals steep performance cliffs: even top-tier models struggle when problem instances cannot be memorized.
Key Results
- Adversarial Robustness: Open-source models (such as T5-Large, UL2, and Vicuna-13B) consistently experience high Performance Drop Rates (PDR) across GLUE tasks and reading comprehension, whereas GPT-4 and ChatGPT maintain the lowest PDR across tested datasets.
- Dynamic Reasoning Evaluation (DyVal): While GPT-4 achieves near 100% accuracy on boolean and deductive logic tasks, its performance drops significantly on complex algorithmic tasks, falling to ~45% on linear equations and ~20% on the maximum sum path problem. Open-source models (LLaMA-2-13B, Vicuna-13B) score below 20% on several of these tasks.
Limitations and Future Work
- Coverage of Scenarios: The library does not yet capture all possible downstream application settings or nuanced evaluation metrics (e.g., complex subjective human alignment nuances).
- Dependency on Prompt Quality: As with any prompt-based framework, baseline evaluations are sensitive to initial prompt designs and dataset curation.
- Future Directions: The authors plan to continuously integrate new open/closed-source models, expand multimodal tasks, implement broader prompt engineering methods, and add more advanced analytical toolkits.
Summary updated