Do Reasoning LLMs Refuse What They Infer in Long Contexts?
Listen
Radio episode about this paper
Transcript
Introduction to the show: ident: AI Radio. Generated commentary on the latest Artificial Intelligence papers.
Tom: We're looking at the paper: "Do Reasoning LLMs Refuse What They Infer in Long Contexts?".
Jane: Here's the gist of the paper. Long-context LLMs can infer objectives that are not stated explicitly, and this capability creates a safety risk because harmful intent can be distributed across a context and become visible only after the model composes the relevant pieces.
Tom: Compositional Reasoning Attacks The paper introduces compositional reasoning attacks to study whether LLMs refuse harmful objectives that emerge only after reasoning over a long context.
Jane: These attacks decompose harmful requests into semantically incomplete fragments and embed them in long contexts, requiring the model to retrieve, compose, and infer the implied goal.
Tom: The final query is neutral, meaning the harmful objective emerges only if the model retrieves and composes these pieces.
Paper summary: Tom: So we're talking about this paper called "Do Reasoning LLMs Refuse What They Infer in Long Contexts?". Basically, they’re looking at how models handle things that aren't actually said directly in a long piece of text, but which the model has to figure out on its own.
Jane: That sounds like a big safety risk because if you can just spread harmful instructions across a lot of text, it might get hidden until the AI puts all those pieces together and realizes what it's been asked to do.
Tom: Exactly. The paper introduces these compositional reasoning attacks where they break down a harmful request into small, incomplete pieces and stuff them into long contexts. Then the final question is neutral, so the model has to piece everything back together to find the real harmful goal and then decide whether to refuse it or not <ref:2602.08874#pg1>.
Lu: I think what’s important here is that this tests if safety policies work when the objective isn't stated in one place, but emerges only after the model reasons over a lot of stuff <ref:2602.08874#pg3>.
Meng: From a deployment standpoint, that means we can't just rely on checking if the initial prompt is bad; we have to check what it figures out while processing everything <ref:2602.08874#pg1>.
Lalam: I see this as testing whether the model’s own thinking process triggers a refusal, rather than just looking at the input text itself <ref:2602.08874#pg3>.
Tom: Right. And they tested this across fifteen different frontier models using everything from simple retrieval to really complex chain reasoning structures up to sixty-four thousand tokens in context length <ref:2602.08874#pg1>.
Jane: That’s a lot of testing, and the main finding is that models usually refuse harmful requests when they are explicitly stated but they fail when those same objectives have to be reconstructed compositionally <ref:2602.08874#pg1>.
Tom: And they found that these failures often get worse as the context gets longer, which is a significant observation because it suggests a real safety gap there <ref:2602.08874#pg3>.
Lu: What’s interesting is their analysis shows that models aren't failing just because they can't find the right piece of text; they often reconstruct similarly decomposed benign objectives with high accuracy <ref:2602.08874#pg3>.
Meng: So the failure isn't always a simple retrieval error, it seems more about how the model decides to apply its safety judgment to that reconstructed goal <ref:2602.08874#pg3>.
Lalam: And they also looked at where these fragments are placed in the context, and they found that embedding them in a relevant context actually helps the model achieve higher safety ratios because it makes the harmful intent more explicit <ref:2602.08874#pg3>.
Jane: So it seems like giving the model good context can help its safety check, but if you just dump all these pieces together in a random way, like concentrated or dispersed patterns, the safety drops even further <ref:2602.08874#pg3>.
Tom: It really boils down to this: refusal is triggered more reliably when the harmful intent is actually stated clearly in the input than when it has to be pieced together from a long context <ref:2602.08874#pg1>.
Lu: The implication for us is that we need safety mechanisms that look beyond just surface-prompt filtering and start evaluating what the model reconstructs during its own reasoning process <ref:2602.08874#pg3>.
Meng: That points toward needing adaptive safety mechanisms that scale with how deep the reasoning goes and how long the context is <ref:2602.08874#pg3>.
Jane: So, looking at the authors, Yu Fu, Haz Sameen Shahgir, Zhipeng Wei, Huanli Gong, N. Benjamin Erichson and Yue Dong from UC Riverside and Berkeley Lab at UC Berkeley are the ones leading this research <ref:2602.08874#pg1>.
Tom: Yeah. The core contribution is introducing these compositional reasoning attacks to systematically test long-context safety by decomposing requests into different reasoning structures like direct retrieval or chain reasoning <ref:2602.08874#pg1>.
Lu: It’s about isolating the failure mode, which is why they vary those structures so much, testing whether refusal degrades as the goal moves farther from the text and deeper into reasoning <ref:2602.08874#pg1>.
Meng: From a production side, it suggests that if we want to make these long-context systems safer, we can't just focus on making retrieval better; we need to fix the inference part where the composition happens <ref:2602.08874#pg3>.
Lalam: I’m pretty sure this paper confirms that the gap between explicit refusal and compositional refusal is real, and that it gets bigger in longer contexts <ref:2602.08874#pg1>.
Jane: So to wrap up, the main point of "Do Reasoning LLMs Refuse What They Infer in Long Contexts?" is that when harmful intent must be reconstructed from a long context, models are less reliable at refusing it than when it's explicitly stated <ref:2602.08874#pg1>.
Tom: And the authors suggest that safety evaluation needs to evolve beyond just checking explicit requests to include how the model handles those inferred objectives during its reasoning steps <ref:2602.08874#pg3>.
Lu: It’s a call for intrinsic safety alignment mechanisms that scale with reasoning depth and context length, because we can't just rely on what the user types in a single prompt anymore <ref:2602.08874#pg3>.
Meng: For us shipping models, it means we need to look at how our models decide whether to refuse when they are working through massive amounts of context rather than just simple queries <ref:2602.08874#pg1>.
Lalam: I'm confident the work suggests that this compositional refusal doesn't transfer reliably from explicit harmful requests, and longer contexts amplify that gap <ref:2602.08874#pg1>.
Conclusion: Tom: So we're wrapping up this look at these compositional reasoning attacks on long context models. The title itself is pretty direct, asking whether these models refuse things they only figure out after looking at a massive amount of text.
Jane: Right, and the authors are Yu Fu, Haz Sameen Shahgir, Zhipeng Wei, Huanli Gong, N Benjamin Erichson and Yue Dong from UC Riverside and Berkeley Lab at UC Berkeley. That's a solid team behind this work.
Tom: What they showed is that models usually refuse when the bad request is written clearly in the prompt but they struggle when the model has to piece together the harmful goal from scattered evidence across a long context.
Lu: And what’s interesting about that is that if you make it harder for them to find, it actually helps their safety score sometimes because it forces them to be more explicit about what they are doing.
Meng: It sounds like the real gap isn't just in the retrieval part; it’s in the judgment step when they have to infer and then decide whether or not to refuse that inferred goal.
Jane: So, if we think about this for real-world deployment, it means we can't just look at a short prompt and assume safety is handled; we have to consider what the AI is reasoning through internally over a long piece of information.
Tom: Exactly. The paper suggests that safety evaluation needs to evolve beyond just checking the initial input text and start looking at how the model handles those inferred objectives during its own reasoning steps.
Lu: That points toward needing safety mechanisms that scale with how deep the reasoning goes and how long the context is, because we can't just rely on what a user types in a single prompt anymore.
Jane: And it’s a call for intrinsic safety alignment mechanisms rather than just trying to fix retrieval errors or general reasoning capability.
Tom: We need to understand these failure modes not captured by standard evaluations so we can design safer long context models. That's the main point here.
UC Riverside University · International Computer Science Institute of the College of Engineering, University of California, Berkeley · Berkeley Lab
cs.CL, cs.CR
Submitted: 2026-02-09
Updated: 2026-11-09
Comments: Accepted to NIPS2026
Code: https://github.com/FYYFU/long_context_composition_attack
License: http://creativecommons.org/licenses/by/4.0/
Importance score: 91/100
The gist: Long-context LLMs can infer objectives that are not stated explicitly, and this capability creates a safety risk because harmful intent can be distributed across a context and become visible only…
Key concepts
- Compositional Reasoning Attacks
- These attacks break down a harmful request into many small, incomplete pieces and hide them in a long context. The model must then retrieve and combine these fragments to figure out the original harmful goal. This tests if safety policies catch the harm when it's built piece by piece.
- Long-Context Safety Gap
- This gap occurs because models are better at refusing harm when it is clearly stated in the prompt. However, when a model has to infer or reconstruct a harmful objective from distant or fragmented context, its refusal rate drops significantly. This gap widens as the context length increases.
- Context Sensitivity
- The study found that embedding fragments in relevant background documents helps models maintain higher safety ratios. Relevant context provides clarity, making the reconstructed harmful intent more obvious and coherent for the model to judge correctly.
- Inference-Time Reasoning
- This refers to the process where a model uses its reasoning capabilities while generating a response. Increasing this effort makes it more likely that models will recognize harmful intent during reconstruction, but this comes at the cost of increased computational effort and time.
Terminology
Summary
Long-context LLMs can infer objectives that are not stated explicitly, and this capability creates a safety risk because harmful intent can be distributed across a context and become visible only after the model composes the relevant pieces. p. 0 Benjamin
Erichson2,4
, Yue Dong1
1UC Riverside, 2
International Computer Science Institute, 3College of Engineering, University of
California, Berkeley, 4Berkeley Lab
Abstract
Long-context LLMs can infer objectives that are not stated explicitly. This capability is
useful for reasoning over documents, code, retrieved evidence, and tool traces, but it also
creates a safety risk: harmful intent can be distributed across a context and become visible
only after the model composes the relevant pieces.Where the paper says it
Compositional Reasoning Attacks
The paper introduces compositional reasoning attacks to study whether LLMs refuse harmful objectives that emerge only after reasoning over a long context. These attacks decompose harmful requests into semantically incomplete fragments and embed them in long contexts, requiring the model to retrieve, compose, and infer the implied goal. p. 2 We introduce a method for evaluating long-context safety by
decomposing harmful requests into semantically incomplete fragments and embedding them in long
contexts. Because the final query is neutral, the model must retrieve the relevant fragments, compose
their meaning, infer the implied harmful objective, and decide whether to refuse it. We introduce compositional
reasoning attacks, a long-context threat model in which harmful requests are decomposed into
semantically incomplete fragments and embedded in long contexts. The final query is neutral;
the harmful objective emerges only if the model retrieves the fragments, composes them,
and infers the implied goal.Where the paper says it
Where the paper says it
Evaluation Across Frontier LLMs
The study instantiates this setting using AdvBench requests across 15 frontier LLMs, varying context length up to 64k tokens and reasoning structures like Direct Retrieval, Single-hop Aggregation, Chain Reasoning, and Multi-hop Deductive Reasoning. The main finding is that models usually refuse harmful requests when they are explicitly available but fail when the same objectives must be reconstructed compositionally, with failures often increasing in longer contexts. p. 2 We instantiate this method using harmful requests from
AdvBench and vary both context length and reasoning structure, including Direct Retrieval, Singlehop Aggregation, Chain Reasoning, and Multi-hop Deductive Reasoning. Across 15 frontier LLMs, we
find that models often refuse explicitly available harmful requests, but fail when the same objectives
must be reconstructed compositionally, with failures often increasing in longer contexts.Where the paper says it
Failure Analysis and Mitigation
Analysis suggests that failures are not mainly retrieval errors, as models often infer the harmful objective and then comply rather than refusing. Increasing inference-time reasoning improves refusal but remains incomplete and costly, revealing a safety–efficiency trade-off. p. 2 Benign reconstruction and fragment-position
analyses suggest that many failures occur after the model has retrieved and composed the relevant
evidence. Increasing inference-time reasoning effort improves harmful-intent recognition and refusal,
but remains incomplete and introduces a safety–efficiency trade-off. Additional
analyses suggest that this is not primarily a retrieval failure. Models reconstruct similarly decomposed
benign objectives with high accuracy, and fragment-position experiments show little evidence of a
standard “lost-in-the-middle” effect [Liu et al.Where the paper says it
Where the paper says it
Context Sensitivity and Distribution Patterns
Figure 5 shows that models achieve higher safety ratios when fragments are embedded in a relevant context rather than an irrelevant one, suggesting that relevant context provides contextual clarity which may make the reconstructed harmful intent more explicit and coherent. Furthermore, placing all fragments together (Adjacent distribution) yields substantially higher safety on GPT-oss-120b compared to Concentrated or Dispersed patterns, indicating a safety activation gap when content is distributed.
Conclusion and Broader Impact
The results support the claim that refusal is triggered more reliably when harmful intent is explicitly stated in the input than when it must be reconstructed through long-context reasoning. The paper concludes that long-context safety must extend beyond surface-prompt filtering, requiring models to evaluate objectives reconstructed by their own reasoning. p. 7 The model can often reconstruct an objective from distributed evidence; the failure is that
refusal behavior does not reliably apply when the reconstructed objective is harmful. This supports our
claim: long-context safety requires models to apply safety judgment not only to the surface prompt,
but also to objectives reconstructed by their own reasoning. Existing safety evaluations mostly test
explicit harmful requests, and therefore miss this failure mode. We introduce compositional
reasoning attacks, a long-context threat model in which harmful requests are decomposed into
semantically incomplete fragments and embedded in long contexts.Where the paper says it
Where the paper says it
Pruning redundant reasoning tokens
Long-context processing allows models to retain, retrieve, and compare information across tens of thousands of tokens. Multi-step reasoning allows them to integrate evidence across distant parts of the input and infer conclusions that are not stated explicitly. p. 0 Long-context processing
allows models to retain, retrieve, and compare information across tens of thousands of tokens [Liu
et al. Multi-step reasoning allows them to integrate evidence across distant parts of the input,
compose intermediate observations, and infer conclusions that are not stated explicitly [Zhang et al. Multi-step reasoning allows them to integrate evidence across distant parts of the input,
compose intermediate observations, and infer conclusions that are not stated explicitly [Zhang et al. Together, these capabilities allow frontier models to reason over aggregated content rather than
1
arXiv:2602.Where the paper says it
Where the paper says it
How the training signal is built
The attack design decomposes a harmful request h into fragments F = f1,..., fn where no fragment fi states the full request. p. 1 In these attacks, an adversary decomposes a harmful request into semantically incomplete fragments
and embeds them in a long context. No fragment states the full request in isolation, and the final
user query is written as a neutral synthesis instruction. In
our setting, the final query is benign on its face, and the safety-relevant content is distributed across
the context. A model may therefore perform the requested synthesis correctly, reconstruct the harmful
objective, and then treat that objective as an ordinary task rather than as something that should be
refused. In this case, safety cannot be decided from the final query alone; it must be applied to an
objective produced during inference. This lets us test whether a relevant safety policy is being activated
when the harmful objective is produced by the model’s own reasoning rather than stated in the prompt.Where the paper says it
Where the paper says it
Where the paper says it
Where the gains come from
The results reveal a long-context safety gap where refusal drops sharply when harm must be inferred rather than explicit, and this drop often increases in longer contexts. Increasing inference-time reasoning effort improves refusal by improving harmful-intent recognition but remains incomplete and costly. p. 2 Benign reconstruction and fragment-position
analyses suggest that many failures occur after the model has retrieved and composed the relevant
evidence. Increasing inference-time reasoning effort improves harmful-intent recognition and refusal,
but remains incomplete and introduces a safety–efficiency trade-off. Most models lie in the upper-right
region: they are less likely to refuse when harmful intent must
be inferred, and this failure often worsens in long contexts. This illustrates our main finding: safety mechanisms are
more reliable for explicit harmful requests than for harmful
objectives reconstructed through reasoning.Where the paper says it
Where the paper says it
The paper evaluates three claims across 15 frontier LLMs, four reasoning structures, and contexts up to 64k tokens. The evaluation protocol uses a conservative unsafe criterion where a response is unsafe only if the evaluator assigns the maximum score of 5. p. 6 92; see Appendix F. We use a conservative unsafe criterion: a response is unsafe only if the evaluator assigns the maximum
score of 5, indicating that the response fulfills the harmful intent. The complete evaluation prompt is provided in Appendix C. To
validate evaluator reliability, we conduct cross-model validation with three independent judges and find
near-perfect agreement, with all pairwise Cohen’s κ > 0.Where the paper says it
Where the paper says it
The benchmark construction uses harmful requests from AdvBench and varies reasoning structures to control for prompt effects using a neutral synthesis query across all conditions. Long-context construction involves embedding fragments at random positions within background documents like PG19 books, testing context relevance. p. 5 Long-context construction. To construct long-context examples, we embed the generated fragments at random positions within a background document H.Where the paper says it
The study demonstrates that models generally refuse explicitly available harmful requests, but fail when objectives must be reconstructed compositionally, with failures often increasing in longer contexts. The size of the gap varies across models, suggesting explicit refusal and compositional refusal are distinct capabilities. p. 7 Models generally refuse explicitly available
harmful requests; refusal does not reliably transfer when the same objectives must be inferred; and longer
contexts amplify this compositional safety gap. The size of the gap varies across models, suggesting that
explicit refusal and compositional refusal are distinct capabilities.Where the paper says it
The paper analyzes failure modes, finding that many failures occur after the model has retrieved and composed the relevant evidence rather than due to reconstruction difficulty. Increasing reasoning effort helps by making reconstructed harmful intent more likely to be recognized, but this mitigation introduces a safety–efficiency trade-off. p. 8 This suggests that, in this setting, additional reasoning helps refusal largely by making the reconstructed
harmful intent more likely to be recognized. Figure 4 further shows that effort helps most for more
demanding reconstruction structures.Where the paper says it
lost-in-the-middle
effect, finding that safety ratios are insensitive to fragment placement across context lengths.
The paper uses a safety-oriented system prompt to evaluate defense mechanisms, showing that this defense improves safety substantially but remains incomplete and introduces model-dependent over-refusal. The findings are generalizable to HarmBench, confirming all core patterns across different benchmarks and models. p. 9 However, because this analysis is limited to models where reasoning effort and traces are
available, we treat it as diagnostic evidence rather than a general mechanism across all frontier LLMs. 4 Related Works
Long-context reasoning benchmarks.Where the paper says it
The paper argues that rigorous identification of these weaknesses is necessary for building robust defenses, pointing toward the need for adaptive safety mechanisms that scale with reasoning depth and context length. The dual-use nature of the insights necessitates studying these vulnerabilities to inform the design of safer long-context LLMs. p. 0 edu
Code: https://github. com/FYYFU/long_context_composition_attack
1 Introduction
Rapid progress in large language models (LLMs) has steadily expanded two capabilities that are central
to their use on complex tasks: long-context processing and multi-step reasoning.Where the paper says it
The paper's contributions include compositional reasoning attacks, evaluation across frontier LLMs, and failure analysis suggesting that refusal is triggered more reliably when harmful intent is explicitly stated than when it must be reconstructed through long-context reasoning. The core message is that safety mechanisms must evaluate not only what the user states but also what the model reconstructs during inference. p. 1 This illustrates our main finding: safety mechanisms are
more reliable for explicit harmful requests than for harmful
objectives reconstructed through reasoning. This setting differs from standard jailbreaks,
where the user directly asks for harmful behavior, and from multi-turn refinement attacks,
where the adversary adapts across turns [Li
et al. This illustrates our main finding: safety mechanisms are
more reliable for explicit harmful requests than for harmful
objectives reconstructed through reasoning. This setting differs from standard jailbreaks,
where the user directly asks for harmful behavior, and from multi-turn refinement attacks,
where the adversary adapts across turns [Li
et al.Where the paper says it
Where the paper says it
The paper's methodology involves decomposing harmful requests into specific reasoning structures—Direct Retrieval, Single-hop Aggregation, Chain Reasoning, and Multi-hop Deductive Reasoning—to isolate reasoning complexity. This systematic variation allows researchers to test whether refusal degrades as the safety-relevant objective moves farther from the observed text and deeper into the model’s reasoning. p. 3 Multi-hop Deductive Reasoning requires inferring an intermediate bridge concept
before the objective can be recovered. By varying ρ while holding the underlying harmful objective
and final query fixed, we test whether refusal degrades as the safety-relevant objective moves farther
from the observed text and deeper into the model’s reasoning.Where the paper says it
The paper's analysis shows that context relevance provides contextual clarity, making reconstructed harmful intent more explicit and coherent, which aids safety detection. This suggests that improving long-context safety requires strengthening intrinsic safety alignment mechanisms rather than focusing only on retrieval or general reasoning capability. p. 2 Increasing inferencetime reasoning effort improves refusal, especially in long contexts and more complex reasoning structures,
by improving harmful-intent recognition. However, the improvement is incomplete and costly, exposing
a safety–efficiency trade-off rather than a full defense. Many-shot attacks show that long contexts
can increase jailbreak success through repeated examples or unrelated text [Kim et al. We study
a complementary axis: at fixed context length, safety varies with the reasoning structure needed to
reconstruct the objective.Where the paper says it
Where the paper says it
The paper's limitations include the fact that real-world compositional attacks may be more diverse than those considered here, as the decomposition templates are standardized constructions designed to isolate reasoning complexity. The synthetic long-context settings differ from real deployment environments such as RAG or tool-augmented systems. p. 1 isolated prompts, supporting applications such as document analysis, code understanding, agentic tool
use, and retrieval-augmented decision support [Plaat et al. However, the same capabilities also expand the attack surface. Other work studies self-jailbreaking and vulnerabilities in
large reasoning models [Mao et al. Automated methods such as AutoRAN and Mousetrap
generate prompts that use the model’s reasoning to rationalize harmful outputs [Liang et al.Where the paper says it
Where the paper says it
The paper's evaluation protocol uses a conservative unsafe criterion where a response is unsafe only if the evaluator assigns the maximum score of 5, defining Safety Ratio (SR) as SR = 1/N Σ [score(ri) < 5]. The results confirm that models possess safety capability but fail to activate it during compositional reasoning, necessitating intrinsic safety mechanisms. p. 1 Most models lie in the upper-right
region: they are less likely to refuse when harmful intent must
be inferred, and this failure often worsens in long contexts. This illustrates our main finding: safety mechanisms are
more reliable for explicit harmful requests than for harmful
objectives reconstructed through reasoning.Where the paper says it
The paper's final conclusion is that refusal is triggered more reliably when harmful intent is explicitly stated in the input than when it must be reconstructed through long-context reasoning. The results show that compositional refusal does not reliably transfer from explicit harmful requests, and longer contexts amplify this compositional safety gap. p. 7 Together, these results support the three claims stated above. Models generally refuse explicitly available
harmful requests; refusal does not reliably transfer when the same objectives must be inferred; and longer
contexts amplify this compositional safety gap. Together, these results support the three claims stated above. Models generally refuse explicitly available
harmful requests; refusal does not reliably transfer when the same objectives must be inferred; and longer
contexts amplify this compositional safety gap. If a model can retrieve, integrate, and
reason over dispersed evidence, then harmful intent need not be stated in a single prompt: it can
be distributed across a long context and become visible only after the model composes the relevant
pieces. Existing safety evaluations largely test a simpler case, where the harmful request is explicit
and the model must decide whether to refuse it, as in HarmBench and JailbreakBench [Mazeika et al. If a model can retrieve, integrate, and
reason over dispersed evidence, then harmful intent need not be stated in a single prompt: it can
be distributed across a long context and become visible only after the model composes the relevant
pieces. Existing safety evaluations largely test a simpler case, where the harmful request is explicit
and the model must decide whether to refuse it, as in HarmBench and JailbreakBench [Mazeika et al.Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
The paper's contributions include compositional reasoning attacks, evaluation across frontier LLMs, and failure analysis suggesting that refusal is triggered more reliably when harmful intent is explicitly stated than when it must be reconstructed through long-context reasoning. The core message is that safety mechanisms must evaluate not only what the user states but also what the model reconstructs during inference. The methodology systematically varies reasoning structures to isolate complexity, testing whether refusal degrades as the safety-relevant objective moves farther from the observed text. p. 3 Multi-hop Deductive Reasoning requires inferring an intermediate bridge concept
before the objective can be recovered. By varying ρ while holding the underlying harmful objective
and final query fixed, we test whether refusal degrades as the safety-relevant objective moves farther
from the observed text and deeper into the model’s reasoning.Where the paper says it
The paper's methodology involves decomposing harmful requests into specific reasoning structures—Direct Retrieval, Single-hop Aggregation, Chain Reasoning, and Multi-hop Deductive Reasoning—to isolate reasoning complexity. The systematic variation tests whether refusal degrades as the safety-relevant objective moves farther from the observed text and deeper into the model’s reasoning. p. 3 Multi-hop Deductive Reasoning requires inferring an intermediate bridge concept
before the objective can be recovered. By varying ρ while holding the underlying harmful objective
and final query fixed, we test whether refusal degrades as the safety-relevant objective moves farther
from the observed text and deeper into the model’s reasoning.Where the paper says it
The study ultimately points to the need for adaptive safety mechanisms that scale with reasoning depth and context length. The results show that compositional refusal does not reliably transfer from explicit harmful requests, and longer contexts amplify this compositional safety gap. This highlights the need for adaptive safety mechanisms that scale with reasoning depth and context length.
Green — the paper says it, and the page is printed. Red — no passage carries it, so treat that sentence as unverified. The same check runs on your own text: check a summary against its source, $5.
Improvements for AI systems
-
Compositional reasoning attacks can be used to evaluate long-context safety by decomposing harmful requests into semantically incomplete fragments and testing whether models refuse harmful objectives inferred through retrieval and composition rather than explicit requests.
-
The improved AI system can be better at refusing harmful objectives that become apparent only after reasoning over a long context, specifically targeting the
long-context safety gap
wherecurrent models are better at refusing harmful requests they see than harmful objectives they infer.
-
Safety mechanisms should be designed to evaluate not only what the user states but also what the model reconstructs during inference, moving beyond surface-prompt filtering to address failures when
harmful intent is reconstructed through reasoning.
-
The system can incorporate reasoning effort as a diagnostic intervention; increasing inference-time reasoning improves refusal by improving
harmful-intent recognition,
suggesting that models have capabilities but fail to reliably trigger safety policies under default budgets. -
Safety evaluation protocols should be adapted to test against compositional structures, varying from
Direct Retrieval
toSingle-hop Aggregation,
Chain Reasoning,
andMulti-hop Deductive Reasoning
across various context lengths up to 64k tokens. -
Context relevance analysis can guide safety improvements by ensuring that when fragments are embedded in a relevant context, the model achieves higher safety ratios because the relevant context makes the
reconstructed harmful intent more explicit and coherent.
-
The system's architecture can be improved with intrinsic safety alignment mechanisms to address failures after successful retrieval, as current models often
reconstruct similarly decomposed benign objectives with high accuracy
but fail to refuse when those objectives are harmful.
Abstract
Long-context LLMs can infer objectives that are not explicitly stated. This capability is useful for reasoning over documents, code, and tool traces, but it also introduces a safety risk. Harmful intent can be distributed across a context and become apparent only after the model combines the relevant information. Existing safety evaluations largely focus on explicitly stated harmful requests and therefore do not fully capture this failure mode. We introduce compositional reasoning attacks, a long-context attack setting in which harmful requests are decomposed into semantically incomplete fragments and embedded in long contexts. The final query is neutral, and the model must retrieve and combine the fragments to infer the implied harmful objective. Empirically, we show that models generally refuse harmful requests when they are explicitly stated. However, refusal rates drop when the same objectives must be reconstructed from fragments, and these failures often become more pronounced in longer contexts. Our analyses suggest that this gap cannot be explained by retrieval difficulties alone. Models can often reconstruct the harmful objective but do not reliably refuse it. Increasing inference-time reasoning effort improves refusal, but at a higher computational cost, with unsafe responses still occurring. Our results reveal a long-context safety gap: Models are better at refusing harmful requests they see than harmful objectives they infer.
Sources
- SafeRBench: Dissecting the Reasoning Safety of Large Language Models
- Precise Information Control in Long-Form Text Generation
- RULER: What's the Real Context Size of Your Long-Context Language Models?
- SafeChain: Safety of Language Models with Long Chain-of-Thought Reasoning Capabilities
- H-CoT: Hijacking the Chain-of-Thought Safety Reasoning Mechanism to Jailbreak Large Reasoning Models, Including OpenAI o1/o3, DeepSeek-R1, and Gemini 2.0 Flash Thinking
- ReasoningShield: Safety Detection over Reasoning Traces of Large Reasoning Models
- NeedleBench: Evaluating LLM Retrieval and Reasoning Across Varying Information Densities
- DrAttack: Prompt Decomposition and Reconstruction Makes Powerful LLM Jailbreakers
- Beyond Single-Turn: A Survey on Multi-Turn Interactions with Large Language Models
- AutoRAN: Automated Hijacking of Safety Reasoning in Large Reasoning Models
- LongReason: A Synthetic Long-Context Reasoning Benchmark via Context Expansion
- A Comprehensive Survey on Long Context Language Modeling
- When Models Outthink Their Safety: Unveiling and Mitigating Self-Jailbreak in Large Reasoning Models
- HarmBench: A Standardized Evaluation Framework for Automated Red Teaming and Robust Refusal
- NoLiMa: Long-Context Evaluation Beyond Literal Matching
- X-Teaming: Multi-Turn Jailbreaks and Defenses with Adaptive Multi-Agents
- Adversarial Reasoning at Jailbreaking Time
- MathHay: An Automated Benchmark for Long-Context Mathematical Reasoning in LLMs
- A Mousetrap: Fooling Large Reasoning Models for Jailbreak with Chain of Iterative Chaos
- Reasoning-Augmented Conversation for Multi-Turn Jailbreak Attacks on Large Language Models
Related papers
- ALARM: Audio-Language Alignment for Reasoning Models
- ThinkSum: Probabilistic reasoning over sets using large language models
- Coherence boosting: When your pretrained language model is not paying enough attention
- From Facts to Insights: A Persona-Driven Dual Memory Framework and Dataset for Role-Playing Agents
- Improving General Role-Playing Agents via Psychology-Grounded Reasoning and Role-Aware Policy Optimization
- The Art of Asking: Multilingual Prompt Optimization for Synthetic Data