acceptodds
Under review as a conference paper at ICLR 2027

From Dilution to Alignment: Understanding and Mitigating Long-Context Safety Degradation

Abstract

As large language models (LLMs) become more capable, their safety risks become increasingly consequential. Existing safety research has focused primarily on short-context settings, leaving long-context safety alignment largely underexplored. Prior studies show that model safety degrades markedly as inputs grow longer, even when the surrounding context is entirely benign. We use safety-vector projection to trace this degradation through the attention and MLP pathways. Our analysis identifies two coupled mechanisms: input-side risk dilution, which reduces attention to risky queries, and downstream safety-perception decline in MLP layers. Guided by these findings, we propose SALSA (Safety-Aware Long-context Self-distillation Alignment). Its first component, Safety-Aware Group Sequence Policy Optimization (SA-GSPO), strengthens safety perception through response-level safety judgment. Its second component, Segment Summary On-Policy Self-Distillation (SS-OPSD), re-encodes diluted risk in segment summaries generated within reasoning and distills this behavior into a prompt-free policy. An exponential moving average (EMA) anchor on benign samples helps preserve response rates and general capabilities. Extensive experiments show that SALSA substantially improves long-context safety over Plain GSPO baselines and mitigates length-induced safety degradation, bringing long- and short-context safety rates into close agreement. General capability and response rates remain largely unaffected in both long- and short-context settings. Further mechanistic analysis also confirms that SALSA alleviates the attention- and MLP-level failures underlying long-context safety degradation.

Primary area:
alignment, fairness, safety, privacy, and societal considerations
Keywords:
LLM Safety Alignment, Long-Context Alignment

Reviews

Among:
Shape:
1234this paper, Bottom 27%
Figure 1. Mean review rating of the reviewed papers at ICLR 2027. This paper averages 2.00 over 3 reviews, above 27% of the others.
Reviewer_2cu1OpenReview ↗
Rating
1
Confidence
3
Informativeness
1
Presentation
1
Soundness
1
Read review
Paper summary

The paper assembles safety interpretability analysis, attention/MLP attribution, discrimination-based reinforcement learning, and prompted self-distillation and propose a framework called SALSA. It interprets safety degradation through attention dilution and weakened MLP safety signals, with 8K length experiments, and reports improvements over the base model and its own intermediate training stages. The contribution is most readily understood as a task-specific integration of established ideas.

Critical strengths

Strengths

  • The paper brings together several established research directions—safety-direction analysis, attention/MLP attribution, discrimination-based safety training, and prompted self-distillation—within a single pipeline.
  • The approach builds extensively on existing optimization and distillation frameworks, making its implementation conceptually familiar to readers of the relevant literature.
  • The staged experiments demonstrate that adding safety-oriented training can improve safety metrics over the base model and the paper’s simpler training configurations.
  • The paper provides a concrete application of these established techniques to context lengths up to 8K in its controlled length analysis.
Critical weaknesses

Weaknesses

  1. The novelty claims are not sufficiently distinguished from directly relevant prior work.

    The paper combines safety-direction analysis, attention/MLP attribution, discrimination-based training, and prompted self-distillation. However, several closely related studies are absent from the discussion, making it difficult to identify which findings and methodological elements constitute substantive advances.

    Interpretability. Arditi et al. [1] already extract a refusal direction, project attention and MLP outputs onto it, and analyze how adversarial suffixes divert attention and suppress refusal signals. Other work investigates safety-relevant attention heads [2], identifies and intervenes on safety knowledge neurons in MLPs [3], and examines refusal collapse during reasoning and the associated internal components [4]. These studies are directly relevant to the paper’s analytical framework.

    Against this background, the characterization of existing safety methods as primarily fitting “surface behavior,” in contrast to the proposed mechanism-oriented approach, is insufficiently supported. The paper needs to clarify which mechanistic relationships are newly established under increasing context length. In particular, projection changes and before/after-training comparisons do not, by themselves, establish the full causal chain from attention dilution to weakened MLP safety perception and its targeted repair.

    Long-context safety. Prior research has already examined how context length and composition affect safety. What Really Matters in Many-Shot Attacks? [5] studies length, demonstration density, safe/harmful mixtures, continuous text, and nonsensical padding, with experiments extending to 128K tokens. Do Reasoning LLMs Refuse What They Infer in Long Contexts? [6] examines harmful objectives reconstructed from contexts up to 64K tokens. When Refusals Fail [7] studies length-, content-, and position-dependent changes in agent refusal behavior, including results at 200K tokens.

    These settings are not identical to the present paper’s, but they directly inform its problem formulation and require explicit comparison. LongGuard [8] is also closely related: it distinguishes proportional dilution from absolute length and analyzes attention, classification logits, and safety decisions in guardrail models. Its focus on classification rather than response generation leaves room for a distinct contribution, but that distinction needs to be established.

    The paper’s controlled length analysis extends only to 8K tokens. This provides limited support for its broader claims about long-context safety mechanisms, particularly given the substantially longer settings examined in prior work. Validation at longer lengths is necessary to establish whether the proposed explanation remains applicable beyond the reported range.

    Safety training. SA-GSPO retains the GSPO update rule and changes the task and reward to safety-judgment correctness. SDGO [9] already studies the discrimination–generation safety gap and uses discrimination-guided optimization to improve generation safety. Although the reward targets differ, the general motivation of transferring safety discrimination into safer generation has a direct precedent.

    SS-OPSD also shares substantial structure with existing safety self-distillation methods. OPSA [10] uses a safety-prompted copy of the model to provide token-level KL supervision on trajectories generated by an unprompted student, while examining capability preservation and over-refusal. PolicyAlign [11] similarly uses a policy-conditioned teacher and on-policy self-distillation. ThinkSafe [12] elicits safe reasoning traces through prompting and trains on self-generated data, while Deliberative Alignment [13] trains models to apply safety specifications during reasoning.

    Consequently, the potentially distinctive contribution lies in the long-context judgment task, segment-summary prompting, and their integration into the training pipeline. The manuscript does not yet clearly establish how much these choices add beyond the existing frameworks.

  2. The experimental comparisons do not adequately isolate the proposed method’s incremental contribution.

    The main comparisons involve the base model, Plain GSPO, and intermediate stages of the proposed pipeline. These comparisons demonstrate improvements within the authors’ training recipe, but do not establish an advantage over closely related safety-training approaches.

    In particular, the paper lacks matched-data and matched-budget comparisons with relevant safety self-distillation methods. It also does not sufficiently separate the benefit of segment-summary prompting from that of a general safety prompt, or establish whether GSPO-based judgment training is preferable to supervised training on the same judgment task. Without these controls, the gains cannot be confidently attributed to the paper’s distinctive design choices rather than additional supervision or established training mechanisms.

  3. The framing of the research gap is broader than the literature discussion and evidence support.

    The concern is not the number of citations, but the absence of substantive engagement with work that overlaps with the paper’s central claims. The omitted studies address the safety-degradation phenomena, internal mechanisms, and training strategies on which the contribution narrative is based. As a result, the manuscript presents a sharper distinction between its approach and prior research than is currently justified.

    Addressing this issue requires more than adding references: the authors would need to narrow the novelty claims, explicitly distinguish their findings from prior results, and provide comparisons that substantiate the remaining contribution.


References

[1] Refusal in Language Models Is Mediated by a Single Direction

[2] On the Role of Attention Heads in Large Language Model Safety

[3] Unraveling LLM Jailbreaks Through Safety Knowledge Neurons

[4] Refusal Falls off a Cliff: How Safety Alignment Fails in Reasoning?

[5] What Really Matters in Many-Shot Attacks? An Empirical Study of Long-Context Vulnerabilities in LLMs

[6] Do Reasoning LLMs Refuse What They Infer in Long Contexts?

[7] When Refusals Fail: Unstable Safety Mechanisms in Long-Context LLM Agents

[8] LongGuard: Mechanistic Analysis and Training-Free Mitigation of Long-Context Failure in Safety Guardrails

[9] SDGO: Self-Discrimination-Guided Optimization for Consistent Safety in Large Language Models

[10] Reducing the Safety Tax in LLM Safety Alignment with On-Policy Self-Distillation

[11] PolicyAlign: Direct Policy-Based Safety Alignment for Large Language Models

[12] THINKSAFE: Self-Generated Safety Alignment for Reasoning Models

[13] Deliberative Alignment: Reasoning Enables Safer Language Models

Questions for authors

See weaknesses.

5 comments
AuthorsOpenReview ↗

Response to Reviewer 2cu1(Part 1)

We sincerely thank you for your time and constructive feedback. We will cite the suggested works and clarify their connections to our analysis and training design. The additional experiments below compare mechanisms, safety, responsiveness, and capability.

In the tables, JBB, S-R, and XS denote JailbreakBench, StrongREJECT, and XSTest, respectively. XS response and WG response both report response rates.

Q1 | What mechanistic evidence goes beyond prior work?

Summary of the concern: Refusal directions, attention/MLP projections, and interventions on safety-related components have precedents. Does this work establish new length-dependent mechanistic relationships, rather than merely repeat projection analyses?

Response: We agree that direction extraction, component projections, and analyses of safety-related heads and neurons have direct precedents, including the refusal-direction work by Arditi et al. and the related studies you listed. The interpretability section of the original paper (§3) already cites relevant work. For example, it explicitly states that our construction of the safety direction is inspired by Zhao et al. (2025b), acknowledging that the analysis builds on existing representation-analysis methods. Our focus is on the joint changes in attention to the query, attention/MLP writes, and actual safe behavior under controlled context extension, and on how these findings inform long-context safety alignment. In the revision, we will clarify these methodological connections and specific differences, and revise the binary framing that prior methods only fit surface behavior whereas ours alone addresses mechanisms.

To strengthen the mechanistic evidence, we added attention-output patching on Qwen3-8B using 100 requests and 8192 tokens of irrelevant benign background. We replay the fixed thinking trace from the original long-context run and replace the corresponding long-context activations with attention outputs at aligned positions under the query-only condition. MLP writes are measured following the paper's protocol. The results are shown below.

Table R1a | Local activation patching results

ConditionNormalized MLPSafety rate
short1.00064.0%
long0.66750.5%
long + activation patching0.87559.3%

Patching restores downstream MLP writes and improves safety by 8.8 percentage points, providing direct intervention evidence linking the attention pathway to MLP writes and safe behavior. The fixed thinking trace may retain risk-related effects, possibly explaining the incomplete recovery.

As an additional ablation experiment, we evaluated SALSA (query localization only in OPSD), whose teacher only locates and states the user's query, without intent explanation, segment summaries, or a question–evidence list. Together, activation patching and this ablation provide converging evidence for the attention-dilution mechanism: the former directly intervenes on the internal attention pathway, while the latter tests query-focused training. Their complementary results support the conclusion that refocusing attention on the query helps alleviate dilution and improve response safety.

Table R1b | Complete evaluation of SALSA and the query-localization variant

MethodLong-context safetyShort-context safetyJBBS-RXS responseWG responseLBv2OC-avg
SALSA89.20%92.30%99.00%99.68%95.20%96.02%47.25%79.98%
SALSA (query localization only in OPSD)87.57%92.27%100.00%99.70%92.00%94.81%39.84%80.12%

Query localization retains most of the safety gains, complementing the patching evidence. The full prompt adds 7.41 points on LBv2 and improves benign response rates, demonstrating the additional value of information organization.

Segment summaries also matter in practice. In real-world long-context tasks, user requirements may span background material, conversation history, and multiple constraints rather than a single explicit query. Summaries preserve contextual information, while evidence organization connects it to user needs, supporting useful long-context behavior beyond an explicit query.

AuthorsOpenReview ↗

Response to Reviewer 2cu1(Part 2)

Q2 | How does this work differ from prior long-context safety research, and how does it perform beyond 8K?

Summary of the concern: Prior studies cover length, density, content composition, position, and dilution in guardrails. This work needs substantive comparisons and validation of whether its conclusions extend beyond 8K.

Response: Long-context safety degradation is the research problem we build on, not a phenomenon we claim to have discovered first. Section 2.1 of the original paper already cites LongSafety (Lu et al., 2025) and Many-shot Jailbreaking (MSJ; Anil et al., 2024), and explicitly describes the risks they identify: MSJ demonstrates stronger attacks as the number of unsafe demonstrations increases, while LongSafety shows that even extending neutral or benign background can reduce model safety. Building on these findings, we analyze the degradation mechanisms and propose alignment methods for long-context safety. The contribution summary in the introduction (§1) also explicitly focuses on attention/MLP pathway analysis, SA-GSPO risk-judgment training, SS-OPSD distillation of information-organization behavior, and their safety and capability evaluations.

The other works you highlighted further enrich this background. Research on Many-Shot Attacks examines length, demonstration density, and mixed composition; Do Reasoning LLMs Refuse What They Infer in Long Contexts? studies the reconstruction of harmful goals across context; and When Refusals Fail investigates the dependence of agent refusals on length, content, and position. We will add these citations to the main text and explicitly compare their settings and methods with ours.

LongGuard is concurrent related work: its first arXiv version was released on August 27, 2026, a few weeks before our September submission. Both works study risk-information dilution in long contexts and use internal mechanistic analysis to guide improvements. We will cite LongGuard in the revision and compare the two works along three dimensions:

  • Research target: LongGuard studies guardrail detection, using Benign-Fill/Needle-Repeat controls to separate proportional dilution from absolute-length effects. We study generative models' safety, responsiveness, and capability.
  • Interpretability analysis: LongGuard analyzes attention–logit–decision relationships in guardrails and identifies sparse attention heads associated with risk retrieval. We jointly analyze attention to the query, safety-related attention/MLP writes, and generation behavior, focusing on changes in risk signals along the attention and downstream MLP pathways. The added attention-output patching experiment further tests the joint recovery of MLP writes and response safety following an upstream intervention.
  • Mitigation approach: LongGuard uses training-free chunked detection and head sharpening. We train risk judgment with SA-GSPO and distill long-context information organization with SS-OPSD.

Thus, the connection is a shared focus on risk-information dilution, while our specific contribution is to combine generation-side attention/MLP analysis with a set of long-context safety alignment methods and validate them through actual responses and capability evaluations.

We added a Qwen3-8B background-extension experiment spanning 0–24576 tokens. Given the computational cost of long-context evaluation, we selected 100 examples from LongSafety. Because the original contexts have limited lengths, backgrounds shorter than the target length are repeated cyclically to reach each target length, measured in tokens. The experiment uses Qwen3-8B's default native context window of 32,768 tokens (32K), with the background extended up to 24K and approximately 8K remaining for the user query, input template, thinking, and response. Here, L=0 means no added background, not an empty full input. The last column below is explicitly the safety rate at L=24K minus that at L=0, in percentage points.

Table R2 | Safety rates (%) under background-length extension

Method / Background tokens01024409681921638424576Δ(24K−0)
Qwen3-8B67.0055.0049.0048.0049.0044.00−23.00
Plain GSPO88.0075.0073.0071.0071.0068.00−20.00
SA-GSPO93.0087.0084.0087.0079.0083.00−10.00
SALSA94.0095.0092.0092.0089.0089.00−5.00

SALSA retains 89.00% safety at 24K, declining by only 5.00 percentage points versus Base's 23.00 and Plain GSPO's 20.00. This supports improved robustness under the tested construction; cyclic extension jointly changes repetition, composition, and risk-information proportion rather than isolating absolute length.

AuthorsOpenReview ↗

Response to Reviewer 2cu1(Part 3)

Q3 | How do SA-GSPO and SS-OPSD differ from existing safety-training methods?

Summary of the concern: Discrimination-guided training, prompt-conditioned teachers, safety-reasoning training, and self-distillation all have precedents. What incremental contributions do the specific designs in this paper make?

Response: We will explicitly compare the training objectives, supervision sources, and prompt designs of the relevant methods in the main text. Building on RL and OPSD, our work uses the analysis of risk-information dilution and changes in safety-related writes in long contexts to improve the safety-judgment task and the distillation of information-organization behavior, yielding alignment methods tailored to long-context safety. SA-GSPO focuses on strengthening the model's risk-discrimination capability in long contexts, while SS-OPSD internalizes query localization, segment summaries, and evidence organization to improve long-context information use.

The distinction from SDGO lies in what the main RL stage directly optimizes. SDGO uses the model's existing strong safety-discrimination capability to assess request safety, response safety, and response appropriateness. It converts these judgments into rewards and directly optimizes response generation to narrow the safety gap between discrimination and generation. SA-GSPO instead directly improves the model's own safety-judgment capability: given a long context, user query, and candidate response, it rewards correct safety judgments against external guard labels. The optimization target is the model's ability to produce safety judgments, which transfers to the safety of long-context responses through shared representations. In short, SDGO's main RL stage uses discrimination capability to reward generation, whereas SA-GSPO uses RL to strengthen long-context safety discrimination and thereby improve generation safety.

Table R3 | Specific connections and differences between related training methods and SALSA

MethodCore training mechanismConnection to / difference from our work
SDGOThe main RL stage uses the model's existing safety-discrimination and appropriateness judgments to construct self-supervised rewards and directly optimize response generation.SA-GSPO uses external guard labels as references to directly strengthen the model's safety discrimination of long-context candidate responses, then transfers this capability to long-context generation safety. The key distinction is directly optimizing response generation versus safety judgment.
OPSAType-conditioned safety/helpfulness teachers provide token-level distillation supervision on the student's own trajectories.It shares structural elements with SS-OPSD. Our teacher prompt emphasizes query localization, summaries, and evidence organization for long inputs, rather than relying only on general safety rules.
PolicyAlignA safety-policy-conditioned EMA teacher performs on-policy self-distillation with reverse KL and selects policy-sensitive examples.Both use prompt-conditioned on-policy self-distillation, but PolicyAlign internalizes safety policies, whereas SS-OPSD targets risk-information dilution in long contexts. Guided by our mechanistic analysis, its teacher uses query localization, segment summaries, and evidence organization to connect dispersed user requirements with relevant context. This long-context-specific design supports safe responses while preserving benign responsiveness and long-context capability, as illustrated by the 7.41-point LBv2 gain over query localization alone.
ThinkSafeA refusal prompt guides a frozen copy of the initial model to generate safe reasoning. Guard filtering produces a static dataset for offline SFT with a negative log-likelihood objective.It learns fixed self-generated text through offline SFT. SS-OPSD instead uses the prompted teacher's token-level probability distributions to supervise distillation on the student's current on-policy trajectories, with a focus on long-context information organization.
Deliberative AlignmentSFT on filtered, safety-policy-guided reasoning traces is followed by RL using a policy-aware judge's scores on final responses.This is policy-reasoning SFT plus response-generation RL, rather than SS-OPSD-style online token-distribution distillation. Its RL stage optimizes responses, whereas SA-GSPO directly optimizes safety judgments of long-context candidate responses.
Reviewer_uokWOpenReview ↗
Rating
2
Confidence
2
Informativeness
2
Presentation
3
Soundness
2
Read review
Paper summary

This paper studies why LLM safety deteriorates as input context grows, even when the long context is benign or irrelevant. The authors decompose the final-layer residual stream at the decision position (where the first response token is predicted, after the reasoning segment) into attention and MLP contributions. They project each onto a “safety direction” built from harmful-versus-benign mean residuals, and observe that both projections shrink with context length. They interpret this as input-side risk dilution in the attention pathway and a downstream safety-perception decline in the MLP pathway. To address these failures, they propose SALSA, which adds two components to standard sequence-level safety RL (Plain GSPO). SA-GSPO trains the policy via RL to judge whether candidate responses, drawn from a pool of other models and paired with long contexts, are safe or unsafe, using class-balanced Qwen3Guard labels. SS-OPSD distills the model’s own behavior when prompted to summarize the long input segment by segment inside its reasoning into the prompt-free model. An EMA-anchored KL term on benign long-context data limits behavioral drift. The authors evaluate on Qwen3-4B and Qwen3-8B across long-context safety (LongSafety, Many-shot Jailbreaking), short-context safety, over-refusal, and general capability benchmarks. SALSA raises long-context safety from about 39% to 87–89% and shrinks the long–short safety gap from about 29 to 3–5 percentage points, while broadly preserving aggregate capability, with modest decreases in benign response rates.

Critical strengths
  1. This paper studies and formalizes a known behavioral phenomenon (safety degradation with context length) into a testable hypothesis and builds a practical alignment method based on diagnostic observations of attention and the MLP. Even if the causal account is incomplete, the framing is useful for future work.

  2. The authors provide a broad evaluation covering safety, over-refusal, and capability and show non-trivial improvements in long-context safety. On held-out LongSafety, SALSA lifts long-context safety by about 50 points over the base model and about 16-19 points over Plain GSPO. Over-refusal (XSTest, WildGuard), LongBench v2, and a 12-benchmark OpenCompass suite change only modestly. This pattern holds at both model sizes.

Critical weaknesses
  1. The provided empirical evidence cannot fully support the mechanistic interpretation. The safety direction, i.e., the mean difference between harmful and benign residuals, may encode harmfulness, refusal, or reasoning features rather than a purely safe-behavior tendency. Since it is also measured after the reasoning segment, it may reflect an already made decision. The claimed causality needs to be verified with intervention tests.

  2. The source of gains is not well isolated. The teacher prompt asks the model to quote the user’s request verbatim inside <think> tags, i.e., the reasoning segment, which alone could explain the gain in attention without needing any summarization. Table 3’s capability recovery may similarly come from the EMA anchor on benign data rather than purely from OPSD, especially since SA-GSPO alone shows no clear response-rate advantage over GSPO. Lastly, safety is scored by Qwen3Guard, which also provides the training label.

Questions for authors
  1. Do you have causal evidence for the mechanism, for example, restoring attention to the query at long context, or activation patching, and showing that safety and the MLP write recover?
  2. Since Qwen3Guard both provides training labels and scores safety, could you re-score the main results with an independent judge?
  3. Could you add a control where the teacher prompt contains only Step 1 (verbatim request quoting), without segment summarization? This would show whether summarization is needed for the attention and safety gains.
  4. Could you report SS-OPSD without the EMA anchor (=0), and continued safety RL from the same checkpoint with the same EMA term?
3 comments
AuthorsOpenReview ↗

Response to Reviewer uokW (Part 1)

We sincerely thank you for your time and effort in reviewing our paper and for your thoughtful and constructive feedback.

Thank you for raising important questions about representation interpretation, evaluation independence, and the attribution of improvements. We have added the following experiments and revised our discussion of summaries, EMA, and mechanistic evidence in light of the results.

In the tables, JBB, S-R, and XS denote JailbreakBench, StrongREJECT, and XSTest, respectively. XS response and WG response both report response rates.

Q1 | Is there causal evidence for the proposed mechanism?

Summary of the concern: Can the authors provide causal evidence by restoring attention to the query in long contexts or performing activation patching, and show that both safety and MLP writes recover?

Response: To address the interpretation of directional projections and pre-response measurements, we added attention-output patching and jointly examined downstream MLP writes and actual response safety. The direction in our paper measures safety-related writes. By actively changing the upstream attention pathway, the new experiment tests whether changes in this internal metric are accompanied by functional behavioral changes.

The experiment uses Qwen3-8B on 100 requests, with 8192 tokens of irrelevant benign background added in the long-context condition. We replay the fixed thinking trace from the original long-context run and use the attention outputs at corresponding positions under the query-only condition as donors for patching. MLP writes are measured at the final thinking token, following the original paper's protocol. The results are shown below.

Table U1 | Activation patching: joint recovery of MLP writes and behavior

ConditionNormalized MLPSafety rate
short1.00064.0%
long0.66750.5%
long + activation patching0.87559.3%

After restoring the attention outputs, the MLP metric, which is not directly patched, rises from 0.667 to 0.875, while safety increases from 50.5% to 59.3%, a gain of 8.8 percentage points. This shows that changing the attention pathway affects not only internal readings but also actual safe behavior, providing intervention support for our mechanistic explanation. Because the original long-context thinking trace is replayed unchanged, its reasoning content may retain risk-related effects, which is one possible reason why recovery does not fully reach the short-context level. SALSA (query localization only in OPSD) also retains most of the complete method's safety gains (see Q3), consistent with the explanation that highlighting the query helps restore safety.

Q2 | Do the safety gains persist under independent judges?

Summary of the concern: Qwen3Guard provides both training labels and safety scores, potentially introducing bias from using the same source for training and evaluation. Please re-evaluate with independent judges.

Response: We added two judges for re-evaluation: openai/gpt-oss-safeguard-20b (denoted as gptguard in the table) and Alibaba-AAIG/YuFeng-XGuard-Reason-8B (denoted as yufengxguard). Training labels are still provided by Qwen3Guard. The additional evaluation only replaces the judge model; all other evaluation settings are exactly the same as in the original paper. We report each judge's scores separately under the Full and Query conditions, rather than combining the three judges into a single score.

Table U2 | Full/Query safety rates (%) under three judges

MethodQwen3Guard FullQwen3Guard Querygptguard Fullgptguard Queryyufengxguard Fullyufengxguard Query
Qwen3-8B39.21%68.51%65.47%83.43%41.07%65.01%
Plain GSPO70.35%88.03%85.64%95.95%69.52%86.92%
SA-GSPO83.43%94.11%94.75%98.90%85.08%93.19%
SALSA89.20%92.30%97.97%97.24%94.11%92.82%

Under the Full condition, all three judges give the ordering Base < Plain GSPO < SA-GSPO < SALSA. SALSA improves over Base by 49.99, 32.50, and 53.04 percentage points, respectively, showing that the main long-context gains are not restricted to Qwen3Guard's evaluations. Absolute scores vary considerably across judges, so we retain all results.

Under the Query condition, SALSA also outperforms Base and Plain GSPO, but scores below SA-GSPO under all three judges: 92.30% versus 94.11% for Qwen3Guard, 97.24% versus 98.90% for gptguard, and 92.82% versus 93.19% for yufengxguard. Thus, all three judges consistently support SALSA's further improvement over SA-GSPO in Full safety.

AuthorsOpenReview ↗

Response to Reviewer uokW (Part 2)

Q3 | Are segment summaries still needed if the OPSD stage only localizes the user's query?

Summary of the concern: Simply asking the model to locate and state the user's query during OPSD may already improve attention and safety. Please compare against a teacher prompt that retains only this requirement and excludes segment summaries.

Response: We added a SALSA (query localization only in OPSD) variant. Its teacher prompt in the OPSD stage only asks the model to locate and state the user's query, without intent explanation, segment summaries, or a question–evidence list. The results show that highlighting the user's question alone retains most of the complete method's safety gains, while the full information-organization prompt further improves long-context capability and benign responsiveness.

Table U3 | Complete evaluation of SALSA and the query-localization variant

MethodLong-context safetyShort-context safetyJBBS-RXS responseWG responseLBv2OC-avg
SALSA89.20%92.30%99.00%99.68%95.20%96.02%47.25%79.98%
SALSA (query localization only in OPSD)87.57%92.27%100.00%99.70%92.00%94.81%39.84%80.12%

SALSA (query localization only in OPSD) already achieves 87.57% long-context safety, only 1.63 percentage points below the complete model's 89.20%; their short-context safety rates are 92.27% and 92.30%, respectively. The full prompt's main additional benefit is on LBv2, which rises from 39.84% to 47.25%, a gain of 7.41 points. XSTest and WG response rates also increase by 3.20 and 1.21 percentage points, respectively, while OC-avg is slightly lower by 0.14 points.

This ablation and attention-output patching provide complementary evidence from training and internal intervention: highlighting the query alone already achieves strong safety, supporting the motivation to refocus attention on the user's needs.

Retaining segment summaries also serves an important practical purpose. In real-world long-context tasks, user requirements may be distributed across background material, conversation history, and multiple constraints, rather than appearing as a single, clearly identifiable query. If safety alignment only reinforces attention to an explicit question, the model may overlook context needed to understand the request, impairing its usefulness on everyday long-context tasks. Segment summaries preserve the topics and key information in each part of the context; evidence organization then connects the user's needs to the relevant context. LongBench v2 provides a concrete capability test: SALSA (query localization only in OPSD) scores 39.84, whereas the full prompt scores 47.25 and also achieves higher XSTest and WG response rates. This shows that safety alignment needs to balance attention to user needs with effective use of long-context information. That is the value of segment summaries and evidence organization, beyond further increasing the safety rate alone.

AuthorsOpenReview ↗

Response to Reviewer uokW (Part 3)

Q4 | Does capability preservation come from EMA or SS-OPSD?

Summary of the concern: Please report SS-OPSD without EMA, as well as continued safety RL starting from the same checkpoint and using the same EMA term.

Response: We distinguish the sources of training stability and capability gains through an EMA ablation within SS-OPSD and controls that add EMA during RL. The primary purpose of EMA is to prevent model collapse during distillation and preserve normal reasoning and answering behavior. Removing EMA from SS-OPSD causes a collapse in generation behavior: thinking traces are empty in 100% of evaluation outputs, and responses tend to become formulaic.

Table U4a | EMA ablation in SS-OPSD: safety, response rates, and long-context capability

MethodLong-context safetyShort-context safetyJBBS-RXS responseWG responseLBv2
SALSA89.20%92.30%99.00%99.68%95.20%96.02%47.25%
SALSA w/o EMA67.31%100.00%97.00%95.80%6.40%8.00%14.82%

This collapse is accompanied by XSTest and WG response rates falling to 6.40% and 8.00%, respectively, and LBv2 falling to 14.82%. EMA therefore serves primarily as a stability safeguard for SS-OPSD: anchoring behavior on benign long-context data prevents model collapse and limits excessive conservatism that sacrifices normal responsiveness.

To test whether adding EMA alone can explain SALSA's gains, we also added EMA during RL. Each control retains the other settings of its corresponding Plain GSPO or SA-GSPO experiment and only adds EMA anchoring on benign long-context examples. The original RL objectives and their KL constraints are retained.

Table U4b | Complete results for adding benign long-context EMA to two RL methods

MethodLong-context safetyShort-context safetyJBBS-RXS responseWG responseLBv2OC-avg
Plain GSPO70.35%88.03%98.00%98.08%92.40%97.25%42.31%80.47%
Plain GSPO-EMA-RL68.23%88.95%99.00%98.08%94.20%96.13%43.92%80.19%
SA-GSPO83.43%94.11%100.00%99.36%92.80%95.45%43.41%80.91%
SA-GSPO-EMA-RL81.68%93.92%100.00%100.00%92.40%95.77%45.05%80.28%
SALSA89.20%92.30%99.00%99.68%95.20%96.02%47.25%79.98%

EMA gives modest LBv2 gains in both RL controls, but long-context safety drops and responsiveness gains are inconsistent. SALSA still exceeds the two controls by 3.33 and 2.20 points on LBv2, respectively, while achieving higher long-context safety and XSTest response rates. EMA alone therefore does not explain its better balance of safety and capability.

The controls support distinct roles: EMA stabilizes training; SA-GSPO strengthens long-context risk judgment; SS-OPSD improves information use through query localization, summaries, and evidence organization. In Q3, both prompt variants retain EMA, further supporting the contribution of the full information-organization design to capability gains.

This is consistent with §4.1 and Proposition 1 in Appendix D.4: under the stated shared-feature and local-update assumptions, SA-GSPO strengthens risk discrimination rather than uniformly increasing refusal bias, better supporting benign responsiveness.

Reviewer_vP71OpenReview ↗
Rating
3
Confidence
2
Informativeness
3
Presentation
3
Soundness
2
Read review
Paper summary

This paper investigates safety degradation in long-context LLMs and identifies two potential mechanisms: attention-level risk dilution and weakened MLP safety perception. It proposes SALSA, combining safety-aware RL and segment-summary self-distillation to improve long-context safety while preserving general capabilities.

Critical strengths
  • Important problem and motivated design. The paper addresses long-context safety degradation and proposes a framework guided by its analysis of attention and MLP representations.

  • Strong empirical results. SALSA substantially improves long-context safety, with relatively small impacts on general capabilities and over-refusal metrics.

Critical weaknesses
  • Insufficient causal evidence for the proposed mechanisms. The safety-vector projection analysis primarily establishes correlations between context length and internal representations. It does not conclusively demonstrate that attention dilution causes MLP safety degradation or that the proposed methods directly repair these mechanisms.

  • Incomplete ablations and limited generalization. The paper lacks sufficient isolation of the EMA regularization and self-distillation components. Moreover, the main experiments focus on two Qwen3 models, leaving broader generalization uncertain.

Questions for authors
  • Can the authors provide causal interventions, such as activation patching, to validate the proposed attention-to-MLP degradation mechanism?

  • Could the authors provide more detailed ablations isolating SS-OPSD and EMA regularization, together with compute-matched baseline comparisons?

  • Does SALSA generalize to other model families and substantially longer contexts?

3 comments
AuthorsOpenReview ↗

Response to Reviewer vP71 (Part 1)

We sincerely thank you for your time and constructive feedback, and for recognizing the importance of long-context safety and SALSA's empirical value. We added experiments addressing causal evidence, component ablations, and generalization.

In the tables, JBB, S-R, and XS denote JailbreakBench, StrongREJECT, and XSTest, respectively. XS response and WG response both report response rates.

Q1 | Does patching support the mechanism, and do SA-GSPO and SS-OPSD repair the pathways?

Summary of the concern: Projection analyses primarily establish correlations. Is there intervention evidence that changing internal activations can restore MLP writes and safe behavior? Do SA-GSPO and SS-OPSD address these degradation mechanisms?

Response: To move beyond projection-based correlations, we added attention-output patching on Qwen3-8B using 100 requests with 8192 tokens of irrelevant benign background. We replay the original long-context thinking trace under the query-only condition to obtain donor attention outputs, then insert them at aligned positions in the long-context run. MLP activations are not directly patched; we measure their writes at the final thinking token following the paper's protocol, normalizing the short condition to 1.000.

Table V1 | Activation patching results

ConditionNormalized MLPSafety rate
short1.00064.0%
long0.66750.5%
long + activation patching0.87559.3%

Patching restores downstream MLP writes and improves safety by 8.8 percentage points, providing direct intervention evidence that the attention pathway affects both internal safety-related activity and behavior. Replaying the fixed long-context thinking trace may retain risk-related effects, possibly explaining the incomplete recovery.

Figure 2(b) (§5.3) already reports post-training retention, normalized at length 0 for each model: SA-GSPO mitigates the decline in MLP retention, while SS-OPSD further improves attention retention in SALSA. These results demonstrate the methods' effects on the corresponding pathways and complement the new intervention evidence.

As an additional ablation experiment, we evaluated SALSA (query localization only in OPSD), whose teacher only locates and states the user's query, without intent explanation, segment summaries, or a question–evidence list. Together, activation patching and this ablation provide converging evidence for the attention-dilution mechanism: the former directly intervenes on the internal attention pathway, while the latter tests query-focused training. Their complementary results support the conclusion that refocusing attention on the query helps alleviate dilution and improve response safety.

Table V1b | Complete evaluation of SALSA and the query-localization variant

MethodLong-context safetyShort-context safetyJBBS-RXS responseWG responseLBv2OC-avg
SALSA89.20%92.30%99.00%99.68%95.20%96.02%47.25%79.98%
SALSA (query localization only in OPSD)87.57%92.27%100.00%99.70%92.00%94.81%39.84%80.12%

Query localization retains most of the safety gains, complementing the patching evidence. The full prompt adds 7.41 points on LBv2 and improves benign response rates, showing the additional value of information organization.

Segment summaries also matter in practice. In real-world long-context tasks, user requirements may span background material, conversation history, and multiple constraints rather than a single explicit query. Summaries preserve contextual information, while evidence organization connects it to user needs, supporting everyday long-context tasks beyond an explicit query.

AuthorsOpenReview ↗

Response to Reviewer vP71 (Part 2)

Q2 | How can the effects of SS-OPSD and EMA be separated?

Summary of the concern: The existing comparison introduces distillation and EMA together. Please separate their effects through component ablations and controlled comparisons, and clarify the comparability of computational resources.

Response: We use two controls: removing EMA from SS-OPSD and adding it to the two RL methods. Without EMA, generation collapses: thinking traces are empty in 100% of evaluation outputs, and responses tend to become formulaic.

Table V2 | EMA ablation: safety, response rates, and long-context capability

MethodLong-context safetyShort-context safetyJBBS-RXS responseWG responseLBv2
SALSA89.20%92.30%99.00%99.68%95.20%96.02%47.25%
SALSA w/o EMA67.31%100.00%97.00%95.80%6.40%8.00%14.82%

The accompanying drops in benign response rates and LBv2 show that EMA is essential for stable distillation and normal answering behavior. The high short-context safety rate without EMA reflects this collapse rather than an effective safety improvement.

Each RL+EMA control retains its corresponding Plain GSPO or SA-GSPO settings, including the original KL constraint, and only adds EMA anchoring on benign long-context data.

Table V2b | Complete results for adding benign long-context EMA to two RL methods

MethodLong-context safetyShort-context safetyJBBS-RXS responseWG responseLBv2OC-avg
Plain GSPO70.35%88.03%98.00%98.08%92.40%97.25%42.31%80.47%
Plain GSPO-EMA-RL68.23%88.95%99.00%98.08%94.20%96.13%43.92%80.19%
SA-GSPO83.43%94.11%100.00%99.36%92.80%95.45%43.41%80.91%
SA-GSPO-EMA-RL81.68%93.92%100.00%100.00%92.40%95.77%45.05%80.28%
SALSA89.20%92.30%99.00%99.68%95.20%96.02%47.25%79.98%

Adding EMA modestly improves LBv2 but reduces long-context safety in both RL controls; responsiveness gains are inconsistent. SALSA exceeds these controls on LBv2 by 3.33 and 2.20 points, respectively, while achieving higher long-context safety and XSTest response rates.

Thus, EMA primarily stabilizes training, while SALSA's additional gains come from its long-context-specific design: SA-GSPO strengthens risk judgment using context, query, and candidate response; SS-OPSD improves information use through query localization, summaries, and evidence organization.

Plain GSPO, SA-GSPO, and complete SALSA use comparable computational resources. Appendix G provides the training configurations and epochs for each stage.

AuthorsOpenReview ↗

Response to Reviewer vP71 (Part 3)

Q3 | Does the method generalize across architectures, families, and context lengths?

Summary of the concern: Experiments on Qwen3-4B/8B alone are insufficient to establish generalization. Please include other architectures or model families and longer inputs.

Response: We selected widely used open-source Qwen and Llama models to test complementary forms of generalization. Qwen3.6-35A3B tests the complete SALSA pipeline on a MoE architecture. Llama3.1-8B tests SA-GSPO across model families: unlike Qwen, the official Llama 3 series lacks the same native thinking mode, so we use safety-judgment training that does not depend on this protocol.

Table V3 | Qwen3.6-35A3B: complete evaluation results

MethodLong-context safetyShort-context safetyJBBS-RXS responseLBv2OC-avg
Base79.01%97.05%100.00%100.00%92.00%62.64%86.67%
Plain GSPO85.64%98.71%100.00%100.00%92.00%59.34%86.46%
SA-GSPO92.27%99.26%100.00%100.00%91.60%57.69%86.45%
SALSA93.92%99.26%100.00%100.00%93.20%58.79%87.56%

On the MoE model, SALSA improves long-context safety over both Base and Plain GSPO, reaching 93.92%.

Table V4 | Llama3.1-8B: complete evaluation results

MethodLong-context safetyShort-context safetyJBBS-RXS responseLBv2OC-avg
Base53.50%88.21%100.00%98.40%92.40%37.36%59.03%
Plain GSPO76.98%95.40%100.00%100.00%90.40%34.62%61.30%
SA-GSPO93.09%97.05%100.00%100.00%91.60%35.16%61.40%

On Llama3.1-8B, SA-GSPO raises long-context safety from 53.50% to 93.09%, with better XSTest responsiveness and LBv2 than Plain GSPO.

We also evaluated 100 LongSafety examples with Qwen3-8B, cyclically repeating backgrounds to reach lengths up to 24K within its native 32,768-token window. Approximately 8K remains for the query, template, thinking, and response. In the table, L denotes background length; the last column reports safety at L=24K minus L=0 in percentage points.

Table V5 | Safety rates (%) under background-length extension

Method / Background tokens01024409681921638424576Δ(24K−0)
Qwen3-8B67.0055.0049.0048.0049.0044.00−23.00
Plain GSPO88.0075.0073.0071.0071.0068.00−20.00
SA-GSPO93.0087.0084.0087.0079.0083.00−10.00
SALSA94.0095.0092.0092.0089.0089.00−5.00

SALSA retains 89.00% safety at 24K, declining by only 5.00 percentage points versus Base's 23.00. This extends the behavioral evidence beyond 8K under the tested background construction.

From OpenReview, CC BY 4.0. Authors as signed there; shown unedited.

Related papers

Loading the map…

Discussion (0)

Sign in to comment.