arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2411.06899cs.CLcs.AIcs.LG
收藏

LongSafety:增强长上下文大语言模型的安全性

LongSafety: Enhance Safety for Long-Context LLMs

School of Computer Science, Fudan University(复旦大学计算机科学学院);Huawei Noah’s Ark Lab(华为诺亚方舟实验室);Shanghai AI Lab(上海人工智能实验室)

Mianqiu Huang, Xiaoran Liu, Shaojun Zhou, Mozhi Zhang, Qipeng Guo, Linyang Li, Chenkun Tan, Yang Gao, Pengyu Wang, Linlin Li, Qun Liu, Yaqian Zhou, Xipeng Qiu, Xuanjing Huang

AI总结:

本文提出LongSafety数据集(10任务、17k样本、平均40.9k token),用于增强长上下文LLM安全性,实验证明其提升长上下文安全性能、短上下文安全并保持通用能力,且具有泛化性。

摘要:

近年来,模型架构和长度外推技术的进步显著延长了大语言模型(LLMs)的上下文长度,为其在日益复杂的任务中的应用铺平了道路。然而,尽管长上下文LLMs的能力不断增强,长上下文场景中的安全问题仍未得到充分探索。虽然短上下文中的安全对齐已被广泛研究,但长上下文LLMs的安全问题尚未得到充分解决。在这项工作中,我们引入了\ extbf{LongSafety},一个针对长上下文LLMs的全面安全对齐数据集,包含10个任务和17k个样本,平均长度为40.9k个token。我们的实验表明,使用LongSafety进行训练可以增强长上下文安全性能,同时提升短上下文安全性并保持通用能力。此外,我们证明长上下文安全并不等同于使用短上下文安全数据进行的长上下文对齐,并且LongSafety在上下文长度和长上下文安全场景方面具有泛化能力。

英文摘要:

Recent advancements in model architectures and length extrapolation techniques have significantly extended the context length of large language models (LLMs), paving the way for their application in increasingly complex tasks. However, despite the growing capabilities of long-context LLMs, the safety issues in long-context scenarios remain underexplored. While safety alignment in short context has been widely studied, the safety concerns of long-context LLMs have not been adequately addressed. In this work, we introduce \textbf{LongSafety}, a comprehensive safety alignment dataset for long-context LLMs, containing 10 tasks and 17k samples, with an average length of 40.9k tokens. Our experiments demonstrate that training with LongSafety can enhance long-context safety performance while enhancing short-context safety and preserving general capabilities. Furthermore, we demonstrate that long-context safety does not equal long-context alignment with short-context safety data and LongSafety has generalizing capabilities in context length and long-context safety scenarios.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑