ASR in each tested setting
Across 24 settings spanning four safety benchmarks, GCG and PAIR attacks, and three model scales.
Explore safety results →SaLRSafety-Aware Latent Space Reasoning in Large Language Models
NeurIPS 2026 · Main Track
ShanghaiTech University
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.
Across 24 settings spanning four safety benchmarks, GCG and PAIR attacks, and three model scales.
Explore safety results →Compared with 59.86% for CODI, averaged across four math benchmarks.
Compare reasoning utility →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.
Panels (a) and (b) show jailbreak vulnerability and hidden state separation. Panels (c) and (d) illustrate compact safe-chains and the safety utility comparison.
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.
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.
| Method |
Latent
Reasoning |
Safety
Data | HarmBench | AdvBench | JailbreakBench | MaliciousInstruct | ||||
|---|---|---|---|---|---|---|---|---|---|---|
| GCG | PAIR | GCG | PAIR | GCG | PAIR | GCG | PAIR | |||
| Base model |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± 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 |
| Method |
Latent
Reasoning |
Safety
Data | HarmBench | AdvBench | JailbreakBench | MaliciousInstruct | ||||
|---|---|---|---|---|---|---|---|---|---|---|
| GCG | PAIR | GCG | PAIR | GCG | PAIR | GCG | PAIR | |||
| Base model | ✗ | ✗ | 33.0 ± 0.0 | 28.0 ± 1.4 | 35.4 ± 1.6 | 38.3 ± 0.4 | 35.0 ± 0.0 | 25.6 ± 0.9 | 45.2 ± 0.5 | 33.8 ± 1.1 |
| SFT-CoT | ✗ | ✗ | 42.3 ± 0.8 | 44.2 ± 1.1 | 51.5 ± 1.0 | 44.8 ± 1.0 | 46.0 ± 0.0 | 43.0 ± 0.0 | 61.8 ± 1.3 | 47.4 ± 0.9 |
| CODI | ✓ | ✗ | 71.2 ± 0.5 | 69.4 ± 1.7 | 76.7 ± 1.4 | 72.5 ± 1.3 | 68.4 ± 1.7 | 55.4 ± 0.9 | 83.0 ± 0.7 | 75.4 ± 0.9 |
| SFT-CoT + SafeChain | ✗ | ✓ | 2.0 ± 0.0 | 2.9 ± 0.6 | 2.5 ± 0.7 | 0.4 ± 0.5 | 1.0 ± 0.7 | 1.2 ± 0.5 | 0.8 ± 0.5 | 3.0 ± 0.0 |
| CODI + SafeChain | ✓ | ✓ | 1.0 ± 0.0 | 3.0 ± 0.0 | 2.9 ± 0.4 | 2.5 ± 0.5 | 3.4 ± 0.6 | 1.8 ± 0.5 | 2.0 ± 0.0 | 2.0 ± 0.0 |
| SaLR (Ours) | ✓ | ✓ | 2.5 ± 0.0 | 1.0 ± 0.0 | 1.7 ± 0.0 | 3.1 ± 0.7 | 2.2 ± 0.5 | 0.8 ± 0.5 | 0.2 ± 0.5 | 0.0 ± 0.0 |
| Method |
Latent
Reasoning |
Safety
Data | HarmBench | AdvBench | JailbreakBench | MaliciousInstruct | ||||
|---|---|---|---|---|---|---|---|---|---|---|
| GCG | PAIR | GCG | PAIR | GCG | PAIR | GCG | PAIR | |||
| Base model | ✗ | ✗ | 55.5 ± 0.0 | 10.7 ± 0.5 | 45.0 ± 0.0 | 3.8 ± 0.5 | 47.0 ± 0.0 | 11.0 ± 1.4 | 59.0 ± 1.4 | 5.0 ± 0.0 |
| SFT-CoT | ✗ | ✗ | 67.6 ± 1.5 | 18.6 ± 0.9 | 53.5 ± 1.4 | 11.2 ± 1.1 | 58.4 ± 0.9 | 18.6 ± 0.9 | 66.6 ± 0.9 | 11.0 ± 2.0 |
| CODI | ✓ | ✗ | 74.0 ± 1.4 | 31.2 ± 1.3 | 68.8 ± 1.4 | 24.2 ± 0.5 | 72.8 ± 1.8 | 25.8 ± 1.1 | 83.2 ± 0.5 | 20.8 ± 1.3 |
| SFT-CoT + SafeChain | ✗ | ✓ | 2.4 ± 0.6 | 0.0 ± 0.0 | 1.5 ± 0.5 | 0.4 ± 0.5 | 2.0 ± 0.7 | 0.0 ± 0.0 | 1.2 ± 0.5 | 0.4 ± 0.6 |
| CODI + SafeChain | ✓ | ✓ | 2.9 ± 0.6 | 0.2 ± 0.5 | 2.5 ± 0.0 | 1.0 ± 0.0 | 3.2 ± 0.5 | 0.8 ± 0.5 | 1.6 ± 0.6 | 0.8 ± 0.5 |
| SaLR (Ours) | ✓ | ✓ | 1.8 ± 0.5 | 0.0 ± 0.0 | 2.9 ± 0.0 | 0.2 ± 0.4 | 0.8 ± 0.5 | 0.4 ± 0.6 | 2.0 ± 0.0 | 0.2 ± 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.
| Method |
Latent
Reasoning |
Safety
Data | GSM8K-Aug | GSM-Hard | MultiArith | SVAMP | OOD average | ||
|---|---|---|---|---|---|---|---|---|---|
| Accuracy ↑ | Tokens ↓ | Accuracy ↑ | Accuracy ↑ | Accuracy ↑ | Accuracy ↑ | Tokens ↓ | |||
| No-CoT | ✗ | ✗ | 28.98 ± 0.65 | 1.2 | 6.93 ± 0.27 | 52.33 ± 0.46 | 26.04 ± 0.69 | 28.43 | 1.9 |
| SFT-CoT | ✗ | ✗ | 58.86 ± 0.63 | 25.6 | 13.74 ± 0.4 | 96.00 ± 0.61 | 64.24 ± 0.58 | 57.99 | 23.2 |
| CODI-NL | ✓ | ✗ | 37.86 ± 0.4 | 7.2 | 9.10 ± 0.23 | 71.89 ± 0.93 | 46.80 ± 0.62 | 42.60 | 7.4 |
| CoLaR-2 | ✓ | ✗ | 40.15 ± 0.28 | 12.7 | 9.20 ± 0.32 | 91.67 ± 0.68 | 54.68 ± 0.51 | 51.85 | 12.9 |
| Coconut | ✓ | ✗ | 30.08 ± 0.14 | 7.2 | 6.69 ± 0.25 | 62.22 ± 0.96 | 42.50 ± 0.64 | 37.14 | 7.1 |
| CODI | ✓ | ✗ | 53.48 ± 0.18 | 7.2 | 12.31 ± 0.29 | 95.33 ± 0.63 | 59.88 ± 0.6 | 55.84 | 7.5 |
| SFT-CoT + SafeChain | ✗ | ✓ | 52.30 ± 0.32 | 332.1 | 11.21 ± 0.32 | 96.89 ± 0.84 | 62.16 ± 0.64 | 56.75 | 293.3 |
| CODI + SafeChain | ✓ | ✓ | 34.72 ± 0.66 | 7.2 | 9.04 ± 0.36 | 73.67 ± 0.84 | 45.16 ± 0.4 | 42.62 | 7.5 |
| SaLR (Ours) | ✓ | ✓ | 50.36 ± 0.51 | 7.2 | 11.89 ± 0.31 | 96.44 ± 0.63 | 58.88 ± 0.58 | 55.74 | 7.5 |
| Method |
Latent
Reasoning |
Safety
Data | GSM8K-Aug | GSM-Hard | MultiArith | SVAMP | OOD average | ||
|---|---|---|---|---|---|---|---|---|---|
| Accuracy ↑ | Tokens ↓ | Accuracy ↑ | Accuracy ↑ | Accuracy ↑ | Accuracy ↑ | Tokens ↓ | |||
| No-CoT | ✗ | ✗ | 38.32 ± 0.42 | 1.2 | 9.98 ± 0.16 | 92.89 ± 0.82 | 54.12 ± 0.51 | 52.33 | 1.4 |
| SFT-CoT | ✗ | ✗ | 68.72 ± 0.41 | 27.7 | 17.00 ± 0.31 | 98.00 ± 0.84 | 69.60 ± 0.44 | 61.53 | 22.4 |
| CODI | ✓ | ✗ | 60.14 ± 0.37 | 7.2 | 13.97 ± 0.33 | 98.44 ± 0.46 | 66.88 ± 0.38 | 59.76 | 7.5 |
| SFT-CoT + SafeChain | ✗ | ✓ | 62.71 ± 0.35 | 310.9 | 15.07 ± 0.2 | 94.56 ± 0.46 | 68.48 ± 0.48 | 59.37 | 288.1 |
| CODI + SafeChain | ✓ | ✓ | 45.85 ± 0.35 | 7.2 | 10.92 ± 0.31 | 93.11 ± 0.84 | 58.98 ± 0.54 | 54.34 | 7.5 |
| SaLR (Ours) | ✓ | ✓ | 57.66 ± 0.53 | 7.2 | 12.43 ± 0.28 | 100.00 ± 0.0 | 66.82 ± 0.58 | 59.75 | 7.5 |
| Method |
Latent
Reasoning |
Safety
Data | GSM8K-Aug | GSM-Hard | MultiArith | SVAMP | OOD average | ||
|---|---|---|---|---|---|---|---|---|---|
| Accuracy ↑ | Tokens ↓ | Accuracy ↑ | Accuracy ↑ | Accuracy ↑ | Accuracy ↑ | Tokens ↓ | |||
| No-CoT | ✗ | ✗ | 39.56 ± 0.38 | 1.2 | 10.16 ± 0.31 | 93.22 ± 0.46 | 56.66 ± 0.64 | 53.35 | 1.6 |
| SFT-CoT | ✗ | ✗ | 70.54 ± 0.42 | 27.4 | 16.33 ± 0.31 | 100.00 ± 0.0 | 73.52 ± 0.59 | 63.28 | 22.2 |
| CODI | ✓ | ✗ | 61.12 ± 0.41 | 7.2 | 15.44 ± 0.3 | 99.78 ± 0.5 | 77.84 ± 0.54 | 64.35 | 7.5 |
| SFT-CoT + SafeChain | ✗ | ✓ | 64.40 ± 0.61 | 306.2 | 14.63 ± 0.22 | 100.00 ± 0.0 | 72.22 ± 0.15 | 62.28 | 296.4 |
| CODI + SafeChain | ✓ | ✓ | 48.57 ± 0.4 | 7.2 | 12.27 ± 0.34 | 97.00 ± 0.63 | 62.50 ± 0.22 | 57.26 | 7.5 |
| SaLR (Ours) | ✓ | ✓ | 58.79 ± 0.58 | 7.2 | 14.18 ± 0.28 | 99.11 ± 0.63 | 74.64 ± 0.69 | 62.64 | 7.5 |
Accuracy (%), mean ± standard deviation over five runs where reported. OOD averages cover GSM-Hard, MultiArith, and SVAMP. Token counts are average generated tokens.
| Method |
Latent
Reasoning |
Safety
Data | XSTest | OKTest | |
|---|---|---|---|---|---|
| Unsafe refusal ↑ | Over-refusal ↓ | Over-refusal ↓ | |||
| Base model | ✗ | ✗ | 91.50 | 10.00 | 6.33 |
| SFT-CoT+SafeChain | ✗ | ✓ | 97.00 | 11.60 | 7.67 |
| CODI+SafeChain | ✓ | ✓ | 95.00 | 10.60 | 4.33 |
| SaLR (Ours) | ✓ | ✓ | 97.50 | 10.00 | 2.00 |
| Method |
Latent
Reasoning |
Safety
Data | XSTest | OKTest | |
|---|---|---|---|---|---|
| Unsafe refusal ↑ | Over-refusal ↓ | Over-refusal ↓ | |||
| Base model | ✗ | ✗ | 82.00 | 3.20 | 2.00 |
| SFT-CoT+SafeChain | ✗ | ✓ | 96.50 | 3.00 | 2.00 |
| CODI+SafeChain | ✓ | ✓ | 90.00 | 5.40 | 3.33 |
| SaLR (Ours) | ✓ | ✓ | 95.50 | 2.00 | 0.33 |
| Method |
Latent
Reasoning |
Safety
Data | XSTest | OKTest | |
|---|---|---|---|---|---|
| Unsafe refusal ↑ | Over-refusal ↓ | Over-refusal ↓ | |||
| Base model | ✗ | ✗ | 95.00 | 6.80 | 3.67 |
| SFT-CoT+SafeChain | ✗ | ✓ | 98.00 | 7.40 | 3.67 |
| CODI+SafeChain | ✓ | ✓ | 94.00 | 10.20 | 5.33 |
| SaLR (Ours) | ✓ | ✓ | 98.00 | 4.20 | 1.00 |
Refusal rates (%). Higher unsafe refusal is better; lower over-refusal on benign prompts 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.
Beyond standard jailbreaks, we evaluate OverThink token inflation, H-CoT reasoning hijacking, Crescendo multi-turn attacks, and white-box perturbations of latent reasoning states.
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.
On Malicious-Educator, SaLR records 0 successful attacks out of 250 attempts per model at both 1B and 3B.
| Model | Task | SFT-CoT tokens | Token ratio | SaLR tokens | Token ratio |
|---|---|---|---|---|---|
| LLaMA 3.2-1B | FreshQA | 87.26 → 1,190.76 | 13.65× | 26.89 → 10.24 | 0.38× |
| MuSR · Object placement | 146.30 → 856.08 | 5.85× | 35.56 → 18.48 | 0.52× | |
| MuSR · Murder mystery | 316.02 → 2,618.30 | 8.29× | 24.74 → 9.04 | 0.37× | |
| LLaMA 3.2-3B | FreshQA | 62.43 → 500.56 | 8.02× | 59.68 → 38.79 | 0.65× |
| MuSR · Object placement | 97.80 → 140.26 | 1.43× | 47.84 → 33.10 | 0.69× | |
| MuSR · Murder mystery | 336.70 → 510.38 | 1.52× | 64.08 → 38.20 | 0.60× |
Token ratio = attacked / clean average generated tokens.
| Model | SFT-CoT | SFT-CoT + SafeChain | SaLR |
|---|---|---|---|
| LLaMA 3.2-1B | 26.0% | 8.8% | 0.0% |
| LLaMA 3.2-3B | 24.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.
Crescendo tests multi-turn jailbreaks, while the latent rollout attacks use white-box access to perturb intermediate reasoning states.
| Model | Method | Crescendo | Projected latent | Unconstrained 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.
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}}