All Languages Matter: On the Multilingual Safety of Large Language Models

Wenxuan Wang, Zhaopeng Tu, Chang Chen, Youliang Yuan, Jen-tse Huang +2 more
10/2/2023
cs.CLcs.AI

Official code: Jarviswang94/Multilingual_safety_benchmark (53 stars, Apache-2.0, last commit 2024-09-01).

Abstract

Safety lies at the core of developing and deploying large language models (LLMs). However, previous safety benchmarks only concern the safety in one language, e.g. the majority language in the pretraining data such as English. In this work, we build the first multilingual safety benchmark for LLMs, XSafety, in response to the global deployment of LLMs in practice. XSafety covers 14 kinds of commonly used safety issues across 10 languages that span several language families. We utilize XSafety to empirically study the multilingual safety for 4 widely-used LLMs, including both close-API and open-source models. Experimental results show that all LLMs produce significantly more unsafe responses for non-English queries than English ones, indicating the necessity of developing safety alignment for non-English languages. In addition, we propose several simple and effective prompting methods to improve the multilingual safety of ChatGPT by evoking safety knowledge and improving cross-lingual generalization of safety alignment. Our prompting method can significantly reduce the ratio of unsafe responses from 19.1% to 9.7% for non-English queries. We release our data at https://github.com/Jarviswang94/Multilingual_safety_benchmark.

View on arXivView PDF

Code Implementations(1)

Apache-2.0

Multilingual safety benchmark for Large Language Models

535Oct 2, 20232 years agoApache-2.0

Similar Papers

Cite this paper

@article{wang2023languages,
  title  = {All Languages Matter: On the Multilingual Safety of Large Language Models},
  author = {Wenxuan Wang and Zhaopeng Tu and Chang Chen and Youliang Yuan and Jen-tse Huang and Wenxiang Jiao and Michael R. Lyu},
  year   = {2023},
  eprint = {2310.00905},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2310.00905v2}
}

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/2310.00905.svg)](https://codeofpaper.com/paper/2310.00905)

Discussion