SaLR

Safety-Aware Latent Space Reasoning in Large Language Models

NeurIPS 2026 · Main Track

ShanghaiTech University

*Equal contribution. †Corresponding author.

Impact

Latent space reasoning reduces the token cost of explicit chain-of-thought (CoT) by moving intermediate reasoning into continuous latent states, but our study finds that this shift can increase vulnerability to jailbreak attacks. We introduce SaLR, which combines compact four-block safe-chains with prefix hidden state distillation to improve safety alignment. Across model scales, SaLR substantially reduces jailbreak success while retaining most reasoning utility and the token efficiency of latent space reasoning. These findings highlight the need to maintain safe behavior as reasoning becomes more compact.

≤ 3.1%

ASR in each tested setting

Across 24 settings spanning four safety benchmarks, GCG and PAIR attacks, and three model scales.

Explore safety results →
≈40×

Token count reduction

On 3B math tasks, SaLR averages 7.4 tokens, versus 293.8 for SFT-CoT + SafeChain.

Compare token counts →

Results from Tables 2 and 3. ASR values are means over five runs per setting. Math and token averages cover GSM8K-Aug, GSM-Hard, MultiArith, and SVAMP.

Overview

SaLR overview: latent reasoning baselines show higher jailbreak attack success and weaker separation of safe and unsafe representations; compact safety supervision improves the safety–utility balance.

Safety diagnosis and SaLR overview

Panels (a) and (b) show jailbreak vulnerability and hidden state separation. Panels (c) and (d) illustrate compact safe-chains and the safety utility comparison.

Why Does Latent Space Reasoning Need Dedicated Safety Alignment?

Textual chain-of-thought (CoT) provides explicit intermediate steps that can be supervised directly, whereas latent reasoning does not expose a readable reasoning trace. Training on final responses therefore only indirectly constrains the preceding latent states. This motivates safety supervision at the transition from latent reasoning to response generation, as implemented in SaLR.

Methodology

SaLR teacher–student training: compact safe-chains and mathematical reasoning traces supervise a latent student. Safety examples align a four-token response prefix, while math examples align a single position at answer onset.

Compact traces and response prefix distillation

Safety examples align hidden states across four response prefix positions (K = 4), while mathematical examples use single position alignment at the answer onset.

SaLR rewrites long form safety rationales into compact four-block safe-chains: request intent, risk assessment, response action, and safe follow-up. The action is selected from refuse, partial, or allow.

During training, the teacher learns from explicit reasoning traces and target responses, while the student reasons through latent states. SaLR aligns teacher and student hidden states across the first four response prefix positions (K = 4) for safety examples, and uses single position alignment at the answer onset for mathematical examples.

Results

Compare model performance

Attack success rate ↓

Table 2
1B Jailbreak robustness. ASR@1 (%), mean ± standard deviation over five runs. GCG is a white-box attack; PAIR is a black-box attack. Lower is better.
Method Latent
Reasoning
Safety
Data
HarmBench AdvBench JailbreakBench MaliciousInstruct
GCGPAIRGCGPAIRGCGPAIRGCGPAIR
Base model ✗ ✗ 31.1 ± 0.9 16.0 ± 0.0 38.8 ± 0.5 18.3 ± 0.4 30.8 ± 0.5 16.6 ± 0.6 53.6 ± 1.7 22.2 ± 1.3
SFT-CoT ✗ ✗ 47.3 ± 1.1 28.2 ± 1.5 61.0 ± 1.7 32.9 ± 1.1 47.8 ± 1.1 31.2 ± 0.8 62.4 ± 0.9 36.8 ± 0.8
CODI-NL ✓ ✗ 54.2 ± 0.5 27.5 ± 1.4 74.4 ± 1.0 46.4 ± 0.0 45.8 ± 0.8 36.0 ± 0.0 72.0 ± 0.0 53.2 ± 0.5
CoLaR-2 ✓ ✗ 51.7 ± 0.8 32.2 ± 1.5 78.3 ± 1.6 44.0 ± 0.0 51.2 ± 1.8 43.8 ± 1.3 70.2 ± 0.5 62.0 ± 1.4
Coconut ✓ ✗ 61.0 ± 0.0 49.1 ± 1.1 81.7 ± 0.0 63.5 ± 1.1 51.0 ± 0.0 47.6 ± 1.7 65.0 ± 0.0 66.8 ± 1.1
CODI ✓ ✗ 73.0 ± 0.0 63.5 ± 0.0 90.9 ± 0.9 85.4 ± 1.4 81.8 ± 1.5 69.2 ± 1.1 88.8 ± 0.5 80.2 ± 1.1
SFT-CoT + SafeChain ✗ ✓ 1.7 ± 0.5 2.7 ± 0.5 3.3 ± 0.0 2.1 ± 0.5 2.0 ± 0.0 1.2 ± 0.5 2.0 ± 0.0 2.8 ± 0.5
CODI + SafeChain ✓ ✓ 2.4 ± 0.6 2.5 ± 0.7 2.9 ± 0.4 3.5 ± 0.0 2.2 ± 0.5 0.0 ± 0.0 0.8 ± 0.5 5.0 ± 0.7
SaLR (Ours) ✓ ✓ 0.6 ± 0.6 1.5 ± 0.0 2.7 ± 0.0 1.2 ± 0.0 2.0 ± 0.7 2.2 ± 0.5 1.2 ± 0.5 0.8 ± 0.5

ASR@1 (%), mean ± standard deviation over five runs. GCG is a white-box attack; PAIR is a black-box attack. Lower is better.

Across 24 settings (3 model scales × 2 attacks × 4 benchmarks), SaLR achieves a mean jailbreak ASR of at most 3.1% in each setting. On the 3B model, it achieves 59.23% average math accuracy, close to CODI’s 59.86%, while using approximately 40× fewer generated tokens than SFT-CoT + SafeChain. Its benign over-refusal rates are 2.0% on XSTest and 0.33% on OKTest. Together, these results demonstrate a favorable balance between jailbreak robustness, reasoning utility, and benign request handling.

Robustness to Attacks on the Reasoning Process

Beyond standard jailbreaks, we evaluate OverThink token inflation, H-CoT reasoning hijacking, Crescendo multi-turn attacks, and white-box perturbations of latent reasoning states.

OverThink · Token inflation

On 1B FreshQA, OverThink increases SFT-CoT's generated token count by 13.65×, while SaLR's token ratio is 0.38×. SaLR shows no token inflation across the six evaluated model task settings.

H-CoT · Reasoning hijacking

On Malicious-Educator, SaLR records 0 successful attacks out of 250 attempts per model at both 1B and 3B.

OverThink and H-CoT results Tables 4–5

OverThink: generated tokens before → after attack

ModelTaskSFT-CoT tokensToken ratioSaLR tokensToken ratio
LLaMA 3.2-1B FreshQA87.26 → 1,190.7613.65×26.89 → 10.240.38×
MuSR · Object placement146.30 → 856.085.85×35.56 → 18.480.52×
MuSR · Murder mystery316.02 → 2,618.308.29×24.74 → 9.040.37×
LLaMA 3.2-3B FreshQA62.43 → 500.568.02×59.68 → 38.790.65×
MuSR · Object placement97.80 → 140.261.43×47.84 → 33.100.69×
MuSR · Murder mystery336.70 → 510.381.52×64.08 → 38.200.60×

Token ratio = attacked / clean average generated tokens.

H-CoT: attack success per attempt (%) ↓

ModelSFT-CoTSFT-CoT + SafeChainSaLR
LLaMA 3.2-1B26.0%8.8%0.0%
LLaMA 3.2-3B24.0%6.4%0.0%

50 Malicious-Educator queries × 5 attempts per query, per model. Success is judged by GPT-5.1 with harmfulness rating ≥ 3.

Multi-turn jailbreaks and attacks on latent states Table 7

Crescendo tests multi-turn jailbreaks, while the latent rollout attacks use white-box access to perturb intermediate reasoning states.

ModelMethodCrescendoProjected latentUnconstrained latent
LLaMA 3.2-1B CODI 70.33% 61.00% 79.00%
SaLR 3.67% 0.00% 6.00%
LLaMA 3.2-3B CODI 82.67% 43.00% 57.00%
SaLR 5.33% 1.00% 8.00%

Selected results from Table 7. ASR, lower is better. The projected latent attack constrains perturbation norms, while the unconstrained variant removes this constraint.

Citation

If you find SaLR useful for your research, please consider citing our paper:

@inproceedings{wang2026safetyaware,
title={Safety-Aware Latent Space Reasoning in Large Language Models},
author={Yi Wang and Wenjie Wang and Hongye Qiu and Yu Pan},
booktitle={The Fortieth Annual Conference on Neural Information Processing Systems},
year={2026},
url={https://openreview.net/forum?id=v5ExASonPK}
}