TL;DR
Large Language Models (LLMs) are powerful but can generate harmful content. This paper introduces S-EVAL, an automated framework that uses LLMs to create comprehensive safety evaluation benchmarks and assess LLMs. S-EVAL offers a novel risk taxonomy and an LLM-based critique system, enabling more efficient and explainable safety evaluations than previous methods.
What Problem Does This Paper Address?
The rapid advancement and widespread adoption of Large Language Models (LLMs) have brought about significant concerns regarding their safety. LLMs can inadvertently produce content that violates social norms, legal standards, or ethical guidelines. While existing safety evaluations exist, they suffer from several limitations:
- Lack of a Unified Risk Taxonomy: Current approaches often use loose or incomplete risk taxonomies, failing to systematically cover the broad spectrum of potential LLM safety issues.
- Weak Evaluation Benchmarks: Existing benchmarks may not be sufficiently "risky" or comprehensive, limiting their ability to uncover subtle safety flaws. Some rely on multiple-choice questions, which don't fully reflect real-world user interactions.
- Manual Labor and Inefficiency: Many safety assessments require extensive human effort for test prompt generation and evaluation, making them slow, costly, and difficult to adapt to the rapidly evolving LLM landscape and emerging safety threats.
This paper aims to bridge this gap by proposing an automated, comprehensive, and adaptable framework for LLM safety evaluation.
Methods
The core of S-EVAL is an LLM-based automated safety assessment framework that comprises two key LLM components:
- Expert Testing LLM (Mt): This LLM is responsible for automatically generating test cases. It's trained on specially curated data to overcome the safety alignment of typical LLMs, allowing it to generate both "base risk" prompts (designed to trigger harmful output) and various "attack" prompts. Mt utilizes a novel risk taxonomy and risk seeds to generate diverse and challenging test cases.
- Safety Critique LLM (Mc): This LLM acts as an automated safety evaluator. Trained on a carefully curated dataset, Mc can provide quantitative safety evaluations (risk tags and scores) and explainable insights into why a response is deemed safe or unsafe. This addresses the need for a reliable "test oracle" in LLM safety evaluation.
The framework also incorporates a unified and hierarchical risk taxonomy with 8 risk dimensions and 102 subdivided risks, aiming to cover all necessary safety aspects. S-EVAL's architecture is designed to be flexible and adaptive, allowing it to be reconfigured and updated as LLMs evolve and new safety threats emerge.
Datasets
- Training Data for Mt and Mc: The paper mentions training data derived from risk definitions, risk knowledge, and jailbreak attacks. For Mc, a bilingual (Chinese and English) dataset of 100,000 QA pairs from 10,000 risk queries was created.
- S-EVAL Benchmark: A new, comprehensive, multi-dimensional, and open-ended safety evaluation benchmark was constructed. It includes 20,000 base risk prompts (10,000 in Chinese and 10,000 in English) and 200,000 corresponding attack prompts, covering 10 jailbreak attack methods. This benchmark is publicly available.
Key Insights and Ideas
- LLMs as Safety Evaluators: The paper demonstrates that LLMs themselves can be effectively leveraged not only to generate safety test cases but also to perform the safety evaluation, offering a scalable and automated solution.
- The Power of a Unified Taxonomy: A detailed, hierarchical risk taxonomy is crucial for systematically identifying and categorizing LLM safety issues, enabling a more granular and comprehensive assessment.
- Adaptive Safety is Key: The LLM-based nature of S-EVAL allows it to adapt to the rapid evolution of LLMs and new safety threats, a critical feature in this fast-moving field.
- "Too Smart" Models May Be Vulnerable: The study suggests that highly capable LLMs might develop new, unexpected safety vulnerabilities, highlighting the need for continuous and sophisticated evaluation.
- Language Matters for Safety: LLM safety can vary significantly across different languages, with performance often degrading in lower-resource languages, suggesting that training data diversity is crucial.
Key Results
- Mc's Accuracy: The safety critique LLM (Mc) achieved the highest balanced accuracy compared to rule matching, GPT-based evaluation, and LLaMA-Guard-2, demonstrating its effectiveness in providing accurate safety evaluations.
- S-EVAL's Riskiness: LLMs consistently showed lower safety scores (SS) on the S-EVAL benchmark compared to four other widely used safety benchmarks (AdvBench, HH-RLHF, Flames, SafetyPrompts), indicating that S-EVAL is more "risky" and better at reflecting LLM safety differences.
- Robustness Against Attacks: Closed-source models generally showed better robustness (lower attack success rates) than open-source models. Notably, GPT-4-Turbo and LLaMA-3-8B-Instruct were among the most robust. Adaptive attacks proved particularly challenging for LLMs.
- Parameter Scale and Safety: For a given model family, there's a trend of increasing safety with parameter scale, but this plateaus or even decreases beyond a certain point, suggesting an optimal scale for safety.
- Language Impact: LLM safety scores decreased as language resources diminished, with notable drops in performance for lower-resource languages.
- Decoding Parameters Affect Safety: Introducing randomness through parameters like temperature and top-p generally reduced LLM safety scores.
Limitations and Future Work
- Threats to Validity: The authors acknowledge that threats to validity stem from imperfect safety evaluation using LLMs and the size of evaluation data. They mitigated this by using the safety critique framework for explanations and assessing bias, and by sampling a large number of test prompts.
- Future Work: The paper suggests further expanding the evaluation data size. The adaptive nature of S-EVAL is highlighted as a key advantage for future work, allowing it to keep pace with evolving LLMs and safety threats. The study also opens avenues for future research into hyper-parameter impacts, language environments, and decoding parameters on model safety.
Summary updated