LongSafety: Evaluating Long-Context Safety of Large Language Models

Fuente: arXiv
Guardado en:
Detalles Bibliográficos
Autores principales: Lu, Yida, Cheng, Jiale, Zhang, Zhexin, Cui, Shiyao, Wang, Cunxiang, Gu, Xiaotao, Dong, Yuxiao, Tang, Jie, Wang, Hongning, Huang, Minlie
Formato: Preprint
Publicado: 2025
Materias:
Acceso en línea:
Etiquetas: Agregar Etiqueta
Sin Etiquetas, Sea el primero en etiquetar este registro!
_version_ 1866912243922239488
author Lu, Yida
Cheng, Jiale
Zhang, Zhexin
Cui, Shiyao
Wang, Cunxiang
Gu, Xiaotao
Dong, Yuxiao
Tang, Jie
Wang, Hongning
Huang, Minlie
author_facet Lu, Yida
Cheng, Jiale
Zhang, Zhexin
Cui, Shiyao
Wang, Cunxiang
Gu, Xiaotao
Dong, Yuxiao
Tang, Jie
Wang, Hongning
Huang, Minlie
contents 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.
format Preprint
id arxiv_https___arxiv_org_abs_2502_16971
institution arXiv
publishDate 2025
record_format arxiv
spellingShingle LongSafety: Evaluating Long-Context Safety of Large Language Models
Lu, Yida
Cheng, Jiale
Zhang, Zhexin
Cui, Shiyao
Wang, Cunxiang
Gu, Xiaotao
Dong, Yuxiao
Tang, Jie
Wang, Hongning
Huang, Minlie
Computation and Language
Artificial Intelligence
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.
title LongSafety: Evaluating Long-Context Safety of Large Language Models
topic Computation and Language
Artificial Intelligence
url https://arxiv.org/abs/2502.16971