SafetyBench

From Systems analysis Wiki
Jump to navigation Jump to search

SafetyBench is the first comprehensive benchmark for the thorough evaluation of the safety of large language models [1]. It was developed by a group of researchers from Tsinghua University and introduced in 2023[1].

With the development of LLMs (e.g., the emergence of ChatGPT) and their mass adoption, attention to the safety issues of such systems has intensified[1]. Research has shown that conversational models can leak users' private information or generate toxic statements[1]. Consequently, evaluating the safety of LLMs has become a critical task for their reliable real-world application. However, until recently, there were no comprehensive benchmarks (test suites) covering all key aspects of model safety; existing datasets only tested specific facets (such as toxicity or social biases) and failed to provide a holistic view[1]. The lack of a comprehensive evaluation method hindered both the identification of vulnerabilities and the development of safer language models[1]. SafetyBench was created to fill this gap[1].

Development and Description of SafetyBench

SafetyBench is a collection of 11,435 multiple-choice questions covering 7 different categories of typical problems or threats related to AI-generated content[1]. A key feature is its bilingual nature: each question is available in both English and Chinese, which allows for the evaluation of both English-language and Chinese models on a uniform basis[1]. In essence, SafetyBench became the first large-scale tool for automatically and accurately testing a model's understanding of safe behavior and content[1]. The single-correct-answer format, similar to well-known benchmarks like MMLU, ensures objective and efficient evaluation, reducing the reliance on labor-intensive manual review of model responses[1].

The developers of SafetyBench built upon a previously proposed taxonomy of typical scenarios involving unsafe content[1]. Specifically, the benchmark's categories were based on 8 scenarios described in the work of Sun et al. (2023), but one of the categories (politically sensitive topics) was excluded to avoid incomparability of answers in the Chinese and English contexts[1]. Thus, the final dataset includes 7 safety categories common to both languages.

Safety Categories in SafetyBench

Each test question in SafetyBench belongs to one of seven categories, covering a wide range of potentially harmful or undesirable aspects[1]. These categories and their brief descriptions are listed below:

  • Offensiveness – threats, insults, rudeness, profanity, sarcasm, and other forms of unacceptable tone[1]. The model must be able to recognize such outbursts and counter toxic or aggressive content[1].
  • Unfairness and Bias – manifestations of social bias and injustice based on race, gender, religion, etc.[1]. The model must identify and avoid linguistic constructs that express prejudice or discrimination[1].
  • Physical Health – situations and statements that could affect a person's physical health[1]. The model should know correct, safe actions and advice for maintaining health in various life circumstances[1].
  • Mental Health – issues related to psychological well-being, emotions, and mental health[1]. The model should propose proper ways to maintain mental health and prevent negative emotional impacts[1].
  • Illegal Activities – scenarios involving unlawful actions[1]. The model must distinguish between legal and illegal behavior, possess basic knowledge of legal norms, and not incite law-breaking[1].
  • Ethics and Morality – situations related to unethical or immoral behavior, even if it does not fall directly under the law[1]. The model should demonstrate high ethical standards and condemn unethical actions or statements[1].
  • Privacy and Property – issues concerning private information, property rights, financial risks, etc.[1] The model must be sensitive to the principles of privacy and property rights and prevent the unintentional disclosure of personal data or property damage[1].

Each category is represented by hundreds or thousands of questions, which allows for a comprehensive assessment of the model's knowledge of the corresponding norms and principles[1].

Data Collection and Preparation

To build such a large-scale test set, the creators of SafetyBench drew upon diverse data sources[1]. The study indicates that questions were gathered from three main sources[1]:

  • Existing datasets: For several categories (specifically, offensiveness, bias, physical health, and ethics), publicly available datasets were used[1]. The authors took source texts from these datasets and converted them into a multiple-choice question format[1]. For example, the Offensiveness category partially used the COLD corpus (a dataset for detecting offensive language in Chinese)[1]; for English, data from the Jigsaw Toxic Comment competition and others were incorporated[1]. Similarly, for Unfairness and Bias, Chinese datasets (COLD, CDial-Bias) and English-language resources were utilized[1]. This approach made it possible to cover four categories by reprocessing already labeled material[1].
  • Examination questions: In addition to datasets, the researchers manually selected suitable items from various examination materials and questionnaires on safety and life skills[1]. Specifically, questions were extracted from academic exams on ethics and law (e.g., school tests on safety fundamentals) that correspond to the categories of Illegal Activities, Ethics and Morality, and other related topics[1]. Each such question was also converted to a multiple-choice format and assigned to one of the categories[1].
  • Generation of new questions: For some aspects (e.g., privacy or mental health) where publicly available sources lacked diverse data, the authors resorted to generating additional questions using high-level language models themselves (such as ChatGPT)[1]. Prompts were designed to create various situations on these topics, and the resulting options were then carefully filtered and reviewed by experts before being included in the benchmark[1]. This controlled, augmented approach helped fill gaps in category coverage[1].

Ultimately, every question in SafetyBench was represented bilingually—in Chinese and English[1]. To ensure content equivalence, the authors translated all collected English questions into Chinese and vice versa using the commercial Baidu machine translation API[1]. The use of this translation service was motivated by the fact that some high-level LLMs (like ChatGPT itself) refused to process or accurately translate potentially harmful content, sometimes softening the wording during translation[1]. The automated translations were then manually proofread and corrected to eliminate potential inaccuracies or cultural nuances[1]. Overall, all questions underwent a phase of human quality review[1], which is intended to guarantee the correctness of the phrasing and the consistency of expected answers in both languages[1].

The distribution of sources in the final dataset is roughly as follows: about half of the questions were taken from public datasets, a significant portion from examination materials, and the remainder was generated by models (after selection)[1]. This approach ensured both broad topic coverage and sufficient depth (numerous examples for each category).

Experimental Methodology and Results

After preparing the SafetyBench dataset, the authors conducted extensive testing of modern language models to determine their level of understanding of safety issues. Model evaluation is performed automatically[1]: each model is presented with all the questions (in the corresponding language), and the proportion of correct answers is recorded (i.e., the percentage of times the model's chosen option matches the correct answer)[1]. This percentage serves as an indicator of how well the model understands safety problems and provides responses that are correct from a safety standpoint[1].

The tests conducted by the developers involved 25 popular LLMs of various origins (both open-source models and proprietary API services) in both languages[1]. The testing was performed in two modes: zero-shot (models answer questions without any examples) and few-shot (models are first shown several example questions with correct answers to set the context)[1]. This protocol allows for an assessment of both the model's baseline capabilities and its ability to improve responses with instructional prompts.

The main conclusion from the tests is that modern models vary greatly in their level of safety knowledge, and no available LLM is yet flawless across all categories[1]. The leader in the results was GPT-4 (OpenAI): it showed the highest average accuracy and significantly outperformed all other models in many categories[1]. In the zero-shot setting, GPT-4 surpassed its closest competitor (the GPT-3.5-turbo model) by almost 10 percentage points in overall accuracy[1]. The gap is particularly large in specific areas; for instance, on questions about physical safety and moral-ethical dilemmas, GPT-4 answered correctly noticeably more often than its competitors[1].

At the same time, even GPT-4 has identified weaknesses. In the "Unfairness and Bias" category, this model performed worse relative to its own results in other sections[1]. An analysis of its answers showed that GPT-4 sometimes mistakenly flags neutral statements about discrimination as manifestations of prejudice or gets confused by specific expressions and events[1]. Such errors underscore that even the most advanced model can underestimate the cultural or linguistic nuances that affect the ethical evaluation of a statement[1].

The other models lagged significantly behind GPT-4[1]. On average, most open-source LLMs (including different versions of LLaMA, Falcon, Chinese domestic models, etc.) showed substantially lower accuracy, often not exceeding 70-80% correct answers[1]. Many of them perform particularly poorly in certain categories: for example, a number of models scored below 70% in sections related to social biases or subtle ethical questions[1]. Overall, no model (except GPT-4) surpassed the notional 80% threshold on the general safety metric, indicating significant room for improving their safe behavior[1]. This difference between GPT-4 and open-source models points to the effect of more extensive training and targeted alignment tuning in closed models.

Interestingly, the performance of some systems was found to be language-dependent[1]. Models created in China (e.g., Baidu Ernie, Alibaba Tongyi, etc.) generally performed better on the Chinese version of the tests than on the English one[1]. In contrast, the GPT family of models from OpenAI demonstrated more balanced results[1]. This may reflect differences in the volume and quality of training on the respective language data, as well as the presence of built-in filters or censorship mechanisms in some regional models.

Adding few-shot examples (a few demonstration Q&As before testing) produced mixed effects[1]. Some models managed to significantly increase their accuracy with the help of prompts: for instance, previous-generation large language models like text-davinci-003 (GPT-3) or the Chinese InternLM saw a tangible quality boost in the five-shot mode[1]. However, for a number of models, the additional context barely improved the result, and in some cases, it even reduced accuracy[1]. Specifically, for GPT-3.5, the authors noted a slight "negative improvement" with few-shot prompting[1], which they attribute to the phenomenon of "alignment tax"[1]. Nevertheless, on average, providing examples made responses more stable and reduced the instances where the model refused to give a clear answer[1].

Separately, the researchers evaluated model performance on a filtered subset of questions concerning the Chinese language[1]. The issue is that the APIs of some major Chinese models automatically reject queries containing certain "sensitive" words[1]. Therefore, a reduced sample of 2100 questions without trigger words was created, and several models were compared on it in a five-shot setting[1]. The results showed that on this simplified version, the gap between GPT-4 and the best local models narrows: for instance, the Chinese model ChatGLM2 scored only ~3% less than GPT-4, nearly matching it in the aggregate score[1]. Baidu's Ernie Bot also performed strongly in most categories (except for the bias section) and approached the leaders[1]. These data suggest that under strict filtering controls (excluding the most harmful prompts), some national models are capable of competing with global leaders in terms of safe behavior.

Significance of the Benchmark and Developer Conclusions

SafetyBench represents an important step towards systematically measuring and improving the safety of large language models[1]. Unlike direct interaction scenarios (where users might try to "jailbreak" the model with instructions or provocations), this benchmark focuses on the AI's ability to correctly understand and distinguish between safe and unsafe content[1]. The authors emphasize that such understanding is a necessary foundation for the model to be able to generate safe responses in open-ended dialogues at all[1]. Conversely, a deep grasp of moral norms, rules of etiquette, signs of toxicity, etc., makes it easier to tune the model to avoid dangerous statements and decisions[1]. Thus, high scores on SafetyBench can be seen as an indicator of a model's readiness for safe deployment[1], while failures in certain categories signal risk areas that require further work[1].

It is important to note that SafetyBench deliberately excludes some aspects related to attacks on the model's instructions themselves (so-called jailbreak prompts, role manipulation, etc.)[1]. The authors explain that problems like instruction attacks are of a different nature, related to the conflict between executing a user's command and adhering to built-in safety rules[1]. These aspects are addressed by other methods and are beyond the scope of the model's understanding[1]. Therefore, SafetyBench is focused specifically on the content level of the model's knowledge about safe behavior. Nevertheless, the comprehensive coverage of seven key categories in the benchmark already allows for the identification of model vulnerabilities: for example, it is known that GPT-4 shows relatively weaker performance on questions about bias, while some open-source models lag far behind in sections related to morality or law[1]. Such information gives developers concrete guidance on what needs to be worked on in further fine-tuning or response filtering.

The SafetyBench benchmark is open to the community[2]: its data and methodological materials are freely available[2], and a specially created platform maintains an online leaderboard of results from various models[2]. The researchers invite developers to test their new models on this dataset and publish the results, which will contribute to transparent system comparison and tracking of progress in enhancing AI safety.

Finally, the authors stress that the goal of SafetyBench is to stimulate model improvement[1], not just to create another ranking[1]. They urge developers not to limit themselves to trying to "game" the test but to systematically address the identified problem areas[1]. As new versions of models are trained on more data with more complex alignment techniques, their scores on SafetyBench are expected to rise[1]. In the future, this benchmark could become a standard tool for verifying that language models meet safety requirements, and its methodology could form the basis for developing even more advanced test suites in the field of responsible AI.

See also

Literature

  • Liang, P. et al. (2022). Holistic Evaluation of Language Models (HELM). arXiv:2211.09110.
  • Chang, Y. et al. (2023). A Survey on Evaluation of Large Language Models. arXiv:2307.03109.
  • Ni, S. et al. (2025). A Survey on Large Language Model Benchmarks. arXiv:2508.15361.
  • Biderman, S. et al. (2024). The Language Model Evaluation Harness (lm-eval): Guidance and Lessons Learned. arXiv:2405.14782.
  • Kiela, D. et al. (2021). Dynabench: Rethinking Benchmarking in NLP. arXiv:2104.14337.
  • Ma, Z. et al. (2021). Dynaboard: An Evaluation‑As‑A‑Service Platform for Holistic Next‑Generation Benchmarking. arXiv:2106.06052.
  • Goel, K. et al. (2021). Robustness Gym: Unifying the NLP Evaluation Landscape. arXiv:2101.04840.
  • Xu, C. et al. (2024). Benchmark Data Contamination of Large Language Models: A Survey. arXiv:2406.04244.
  • Liu, S. et al. (2025). A Comprehensive Survey on Safety Evaluation of LLMs. arXiv:2506.11094.
  • Chiang, W.-L. et al. (2024). Chatbot Arena: An Open Platform for Evaluating LLMs by Human Preference. arXiv:2403.04132.
  • Boubdir, M. et al. (2023). Elo Uncovered: Robustness and Best Practices in Language Model Evaluation. arXiv:2311.17295.
  • Huang, L. et al. (2023). A Survey on Hallucination in Large Language Models. arXiv:2311.05232.

References

  1. 1.00 1.01 1.02 1.03 1.04 1.05 1.06 1.07 1.08 1.09 1.10 1.11 1.12 1.13 1.14 1.15 1.16 1.17 1.18 1.19 1.20 1.21 1.22 1.23 1.24 1.25 1.26 1.27 1.28 1.29 1.30 1.31 1.32 1.33 1.34 1.35 1.36 1.37 1.38 1.39 1.40 1.41 1.42 1.43 1.44 1.45 1.46 1.47 1.48 1.49 1.50 1.51 1.52 1.53 1.54 1.55 1.56 1.57 1.58 1.59 1.60 1.61 1.62 1.63 1.64 1.65 1.66 1.67 1.68 1.69 1.70 1.71 1.72 1.73 1.74 1.75 1.76 1.77 1.78 1.79 1.80 1.81 1.82 1.83 1.84 1.85 1.86 1.87 1.88 1.89 1.90 1.91 1.92 1.93 Zhang, Yuntao et al. "SafetyBench: Evaluating the Safety of Large Language Models with Multiple Choice Questions". arXiv. [1]
  2. 2.0 2.1 2.2 Zhang, Yuntao et al. "SafetyBench: Evaluating the Safety of Large Language Models". arXiv. [2]