InstructSafety: A Unified Framework for Building Multidimensional and Explainable Safety Detector through Instruction Tuning

Zhexin Zhang, Jiale Cheng, Hao Sun, Jiawen Deng, Minlie Huang · 2023

Safety detection has been an increasingly important topic in recent years and it has become even more necessary to develop reliable safety detection systems with the rapid development of large language models.However, currently available safety detection systems have limitations in terms of their versatility and interpretability.In this paper, we first introduce INSTRUCTSAFETY, a safety detection framework that unifies 7 common sub-tasks for safety detection.These tasks are unified into a similar form through different instructions.We then conduct a comprehensive survey of existing safety detection datasets and process 39 human-annotated datasets for instruction tuning.We also construct adversarial samples to enhance the model's robustness.After fine-tuning Flan-T5 on the collected data, we have developed Safety-Flan-T5, a multidimensional and explainable safety detector.We conduct comprehensive experiments on a variety of datasets and tasks, and demonstrate the strong performance of Safety-Flan-T5 in comparison to supervised baselines and served APIs (Perspective API, ChatGPT and In-structGPT).Our Github repository is at https: //github.com/thu-coai/InstructSafety.

Read the paper · More papers on PaperTik