Prepending model inputs with safety prompts is a common practice for safeguarding large language models (LLMs) against queries with harmful intents. However, the underlying working mechanisms of safety prompts have not been unraveled yet, restricting the possibility of automatically optimizing them to improve LLM safety. In this work, we investigate how LLMs' behavior (i.e., complying with or refusing user queries) is affected by safety prompts from the perspective of model representation. We find that in the representation space, the input queries are typically moved by safety prompts in a "higher-refusal" direction, in which models become more prone to refusing to provide assistance, even when the queries are harmless. On the other hand, LLMs are naturally capable of distinguishing harmful and harmless queries without safety prompts. Inspired by these findings, we propose a method for safety prompt optimization, namely DRO (Directed Representation Optimization). Treating a safety prompt as continuous, trainable embeddings, DRO learns to move the queries' representations along or opposite the refusal direction, depending on their harmfulness. Experiments with eight LLMs on out-of-domain and jailbreak benchmarks demonstrate that DRO remarkably improves the safeguarding performance of human-crafted safety prompts, without compromising the models' general performance.
AdaShield: Safeguarding Multimodal Large Language Models from Structure-based Attack via Adaptive Shield Prompting
Peking University(北京大学);University of Wisconsin–Madison(威斯康星大学麦迪逊分校);International Digital Economy Academy(国际数字经济学院);University of California Davis(加州大学戴维斯分校)
Multilingual Collaborative Defense for Large Language Models
Key Laboratory of Big Data & Artificial Intelligence in Transportation (Beijing Jiaotong University), Ministry of Education(大数据与人工智能交通运输 key laboratory(北京交通大学));School of Computer Science and Technology, Beijing Jiaotong University(计算机科学与技术学院(北京交通大学));University of Montreal(蒙特利尔大学)
EmoAgent: Assessing and Safeguarding Human-AI Interaction for Mental Health Safety
Department of Electrical & Computer Engineering, Princeton University(普林斯顿大学电气与计算机工程系);Department of Computer Science, Princeton University(普林斯顿大学计算机科学系);Department of Computer Science & Engineering, University of Michigan(密歇根大学计算机科学与工程系);Department of Data Science & Engineering, University of Michigan(密歇根大学数据科学与工程系);Department of Philosophy, Columbia University(哥伦比亚大学哲学系);AI Lab, Princeton University(普林斯顿大学人工智能实验室);Chen Frontier Lab for Al and Mental Health, Tianqiao and Chrissy Chen Institute(天桥及克里斯西·陈研究所人工智能与心理健康前沿实验室);Theta Health Inc.(Theta健康公司)
STPrompt: Semantic-guided and Task-driven prompts for Effective Few-shot Classification
University of Chinese Academy of Sciences(中国科学院大学);Institute of Information Engineering(信息工程研究所);Beijing Institute of Technology(北京理工大学);Guangzhou University(广州大学)
Enhancing robustness of data-driven SHM models: adversarial training with circle loss
School of Information Science and Engineering, Chongqing Jiaotong University(重庆交通大学信息科学与工程学院);Institute of Intelligent Software(智能软件研究院);Saarland University(萨尔大学);University of Auckland(奥克兰大学)
Enhancing Text Annotation through Rationale-Driven Collaborative Few-Shot Prompting
Institute of Artificial Intelligence and Future Networks, Beijing Normal University(北京师范大学人工智能与未来网络研究院);Hong Kong Baptist University(香港浸会大学);BNU-HKBU United International College(北京师范大学-香港浸会大学联合国际学院);College of Artificial Intelligence, Beijing Normal University(北京师范大学人工智能学院)
The Key Laboratory of Knowledge Engineering with Big Data (the Ministry of Education of China)(知识工程与大数据关键实验室(中华人民共和国教育部));School of Computer Science and Information Engineering(计算机科学与信息工程学院);Anhui Zhongke Guojin Intelligent Technology Co., Ltd.(安徽中科创金智能科技有限公司);Nanjing University of Science and Technology(南京理工大学)
OntoChatGPT Information System: Ontology-Driven Structured Prompts for ChatGPT Meta-Learning
Glushkov Institute of Cybernetics of the National Academy of Sciences of Ukraine(乌克兰国家科学院格鲁什科夫控制论研究所);Frantsevic Institute for Problems in Material Science of the National Academy of Sciences of Ukraine(乌克兰国家科学院弗兰采维奇材料科学问题研究所)