LongSafety:评估大语言模型的长上下文安全性
LongSafety: Evaluating Long-Context Safety of Large Language Models
AI总结:
针对长上下文任务中LLM安全性评估空白,提出首个综合基准LongSafety,涵盖7类安全问题与6种任务共1543个测试用例,发现多数模型安全率低于55%,且短上下文安全性与长上下文安全性不相关。
摘要:
随着大语言模型(LLMs)在理解和生成长序列方面的不断进步,长上下文引入了新的安全问题。然而,LLMs在长上下文任务中的安全性仍未被充分探索,在评估和改进其安全性方面存在显著空白。为解决这一问题,我们提出了LongSafety,这是首个专门用于评估LLMs在开放式长上下文任务中安全性的综合基准。LongSafety涵盖7类安全问题和6种面向用户的长上下文任务,共包含1,543个测试用例,每个上下文平均5,424个词。我们对16个代表性LLMs的评估揭示了显著的安全漏洞,大多数模型的安全率低于55%。我们的研究结果还表明,在短上下文场景中表现出的强大安全性并不一定与长上下文任务中的安全性相关,这强调了改进长上下文安全性的独特挑战和紧迫性。此外,通过广泛分析,我们识别了长上下文模型面临的安全问题和任务类型中的挑战性方面。进一步地,我们发现相关上下文和扩展的输入序列会加剧长上下文场景中的安全风险,凸显了对长上下文安全挑战持续关注的迫切需要。我们的代码和数据可在https://github.com/thu-coai/LongSafety获取。
英文摘要:
As Large Language Models (LLMs) continue to advance in understanding and generating long sequences, new safety concerns have been introduced through the long context. However, the safety of LLMs in long-context tasks remains under-explored, leaving a significant gap in both evaluation and improvement of their safety. To address this, we introduce LongSafety, the first comprehensive benchmark specifically designed to evaluate LLM safety in open-ended long-context tasks. LongSafety encompasses 7 categories of safety issues and 6 user-oriented long-context tasks, with a total of 1,543 test cases, averaging 5,424 words per context. Our evaluation towards 16 representative LLMs reveals significant safety vulnerabilities, with most models achieving safety rates below 55%. Our findings also indicate that strong safety performance in short-context scenarios does not necessarily correlate with safety in long-context tasks, emphasizing the unique challenges and urgency of improving long-context safety. Moreover, through extensive analysis, we identify challenging safety issues and task types for long-context models. Furthermore, we find that relevant context and extended input sequences can exacerbate safety risks in long-context scenarios, highlighting the critical need for ongoing attention to long-context safety challenges. Our code and data are available at https://github.com/thu-coai/LongSafety.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。