Evaluating the Sensitivity of LLMs to Harmful Contents in Long Input

Faeze Ghorbanpour, Alexander Fraser
10/7/2025
cs.CLcs.CY

No confident code implementation found for this paper.

Abstract

Large language models (LLMs) increasingly support applications that rely on extended context, from document processing to retrieval-augmented generation. While their long-context capabilities are well studied for reasoning and retrieval, little is known about their behavior in safety-critical scenarios. We evaluate LLMs' sensitivity to harmful content under extended context, varying type (explicit vs. implicit), position (beginning, middle, end), prevalence (0.01-0.50 of the prompt), and context length (600-6000 tokens). Across harmful content categories such as toxic, offensive, and hate speech, with LLaMA-3, Qwen-2.5, and Mistral, we observe similar patterns: performance peaks at moderate harmful prevalence (0.25) but declines when content is very sparse or dominant; recall decreases with increasing context length; harmful sentences at the beginning are generally detected more reliably; and explicit content is more consistently recognized than implicit. These findings provide the first systematic view of how LLMs prioritize and calibrate harmful content in long contexts, highlighting both their emerging strengths and the challenges that remain for safety-critical use.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. Any repos shown below are weak matches — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{ghorbanpour2025evaluating,
  title  = {Evaluating the Sensitivity of LLMs to Harmful Contents in Long Input},
  author = {Faeze Ghorbanpour and Alexander Fraser},
  year   = {2025},
  eprint = {2510.05864},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2510.05864v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2510.05864.svg)](https://codeofpaper.com/paper/2510.05864)

Discussion