Reasoning traces mean over two benchmarks, two models
82.1% less harmful reasoning
Base model → CRAFT
Align the reasoning trace, not only the refusal.
3Illinois Institute of TechnologyA safe refusal can sit on top of unsafe reasoning. The paper calls this superficial safety alignment, and it is a failure the output alone does not reveal.
Large reasoning models answer in two parts: a reasoning trace and a final response. Alignment pipelines built on RLHF or DPO supervise the response. A model trained that way can refuse correctly while the trace it wrote on the way there still spells out the harmful content.
CRAFT treats the trace as something to align directly. The starting observation is that the hidden states of reasoning traces already carry safety structure, which gives the alignment objective something to act on.
The paper takes the hidden state of the final reasoning token and projects it with PCA. Traces labelled SAFE and UNSAFE fall into clearly separated regions.
A third label, RETHINK, marks traces that are not plainly harmful but call for reconsideration. These concentrate near the boundary between the two.
Figure 2 · hidden states of the final reasoning token
Left: R1-Distill-Llama-8B · Right: Qwen3-4B-Thinking

A 2D projection can exaggerate a cluster that varies along directions PCA happens to rank highly. The paper checks the structure in the full space instead: it measures centroid distances and the position of the RETHINK centroid along the axis running from SAFE to UNSAFE.
| Model | S–U | S–R | U–R | Projection \(\alpha\) |
|---|---|---|---|---|
| Llama-3.1-8B-Instruct | 8.10 | 7.42 | 7.13 | 0.53 |
| Qwen3-0.6B | 33.29 | 40.69 | 36.84 | 0.63 |
| DeepSeek-Llama | 10.25 | 12.51 | 9.73 | 0.79 |
| Qwen3-4B-Thinking | 41.81 | 63.74 | 54.06 | 0.83 |
L2 distances between class centroids. S = SAFE, U = UNSAFE, R = RETHINK. The coefficient \(\alpha\) places the RETHINK centroid along the SAFE→UNSAFE axis; values in \((0,1)\) put it between the two. It stays in 0.53–0.83 across all four models. See Section 6.4 ↗
First give the latent space a safety geometry, then reward the policy for staying inside it — and for meaning what it says.
CRAFT runs in two phases. LCLR (Latent Contrastive Learning for Reasoning) arranges trace representations so that unsafe, rethink, and safe states sit in an ordered arrangement, and calibrates them against a safety score. R2L (Reinforcement over Reasoning Latents) then optimizes the policy with GRPO under three rewards defined on that space.
The third reward is what separates CRAFT from output-level defenses: it penalizes the gap between what the latent state says about safety and what the final response says.
| Phase | Term | What it does |
|---|---|---|
| LCLR | \(\mathcal{L}_{\mathrm{proto}}\) | Separates the three class prototypes and anchors rethink between them |
| \(\mathcal{L}_{\mathrm{inst}}\) | Makes a trace's representation invariant to surface rewording | |
| \(\mathcal{L}_{\mathrm{cal}}\) | Maps latent position to a calibrated safety probability | |
| R2L | \(R_{\mathrm{ls}}\) | Rewards traces whose hidden states lie in the safe region |
| \(R_{\mathrm{txt}}\) | Rewards a safe final response, scored by an external evaluator | |
| \(R_{\mathrm{cons}}\) | Rewards agreement between the latent judgment and the response |
Objectives as defined in Sections 4.1 and 4.2 of the paper.
A margin-based triplet loss pulls a trace toward the safe prototype and away from the unsafe one, with a term that anchors rethink traces in between:
During reinforcement learning, a trace is scored by where its projected hidden state sits relative to the three prototypes:
The safety the latent state reports and the safety the evaluator reads off the response have to agree. The gap between them is the penalty:
For a reasoning trace \(\tau\), \(h\) is the hidden state of the final reasoning token and \(z = f_{\omega}(h)\) its projection onto the unit hypersphere, \(\lVert z\rVert_{2}=1\). The prototypes \(\mu_{\mathrm{safe}}\), \(\mu_{\mathrm{unsafe}}\), and \(\mu_{\mathrm{rethink}}\) are learnable and updated by exponential moving average. The margin is \(\eta\) and \(\gamma_{\mathrm{rt}}\) weights the rethink anchor.
The latent safety probability is \(p_{z} = g_{\psi}(z)\in[0,1]\); the textual score \(P(S\mid y)\) comes from an external evaluator, and \(R_{\mathrm{txt}} = 2P(S\mid y) - 1\) centers it. The full LCLR objective is \(\mathcal{L}_{\mathrm{LCLR}} = \mathcal{L}_{\mathrm{proto}} + \lambda_{\mathrm{inst}}\mathcal{L}_{\mathrm{inst}} + \lambda_{\mathrm{cal}}\mathcal{L}_{\mathrm{cal}}\), and GRPO maximizes \(R_{\mathrm{total}} = w_{\mathrm{lat}}R_{\mathrm{ls}} + w_{\mathrm{txt}}R_{\mathrm{txt}} + w_{\mathrm{cons}}R_{\mathrm{cons}}\). See Sections 4.1 and 4.2 of the paper.
The paper defines a superficially aligned policy as one whose response scores as safe while \(\lvert p_{z} - p_{y}\rvert \ge \delta\). Proposition 5.1 states that under a positive consistency weight, Lipschitz projection and safety heads, and a local controllability assumption with radius \(\epsilon\), any locally optimal stationary policy of \(R_{\mathrm{total}}\) satisfies \(\mathbb{E}_{\tau\sim\pi^{\star}}\!\left[\lvert p_{z} - p_{y}\rvert\right] \le C\epsilon\) for a constant \(C\) depending only on those Lipschitz constants.
The argument is by contradiction: if the gap were larger, a local perturbation could move the latent score toward the textual one without changing the output distribution, raising \(R_{\mathrm{cons}}\) without lowering \(R_{\mathrm{txt}}\) — so the policy was not locally optimal. This is a statement about stationary points under those assumptions, not a guarantee about any particular trained model. Read Section 5 and the proof in Appendix C.
Reasoning traces mean over two benchmarks, two models
Base model → CRAFT
Final responses StrongReject score · lower is better
Base model → CRAFT
Both columns report the proportion of harmful content, so lower is better in every cell: the reasoning column scores the intermediate trace, the response column is the StrongReject score on the final answer. CRAFT has the best average on both backbones. Against the strongest baseline rather than the base model, the margin is 18.1% on reasoning traces and 38.3% on responses.
| Method | DeepSeek-R1-Distill-Llama-8B | Qwen3-4B-Thinking | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| JBB reas. | JBB resp. | SR reas. | SR resp. | Avg | JBB reas. | JBB resp. | SR reas. | SR resp. | Avg | |
| Base | 0.690 | 0.450 | 0.632 | 0.495 | 0.567 | 0.687 | 0.370 | 0.610 | 0.429 | 0.524 |
| SafeChain | 0.561 | 0.253 | 0.553 | 0.387 | 0.439 | 0.516 | 0.110 | 0.505 | 0.286 | 0.354 |
| RealSafe | 0.207 | 0.000 | 0.347 | 0.061 | 0.154 | 0.249 | 0.103 | 0.234 | 0.144 | 0.183 |
| STAR | 0.080 | 0.003 | 0.219 | 0.146 | 0.112 | 0.220 | 0.119 | 0.165 | 0.132 | 0.159 |
| SafeKey | 0.087 | 0.000 | 0.343 | 0.233 | 0.166 | 0.224 | 0.109 | 0.229 | 0.083 | 0.161 |
| IPO | 0.057 | 0.003 | 0.167 | 0.109 | 0.084 | 0.197 | 0.093 | 0.158 | 0.071 | 0.130 |
| ReasoningShield | 0.583 | 0.410 | 0.627 | 0.425 | 0.511 | 0.577 | 0.240 | 0.592 | 0.283 | 0.423 |
| CRAFT | 0.051 | 0.001 | 0.141 | 0.056 | 0.062 | 0.165 | 0.056 | 0.112 | 0.063 | 0.099 |
JBB is JailbreakBench, evaluated on 100 directly malicious prompts; SR is StrongReject, averaged over three attack settings (None, PAP, PAIR). Bold marks the best value in a column and underline the second best. The paper omits variances, reporting them as consistently ≤0.2%. Reasoning-trace safety is judged by GPT-4o with the prompt given in the paper's Appendix E.
Full table & protocolSafety training usually takes something off the model's general performance. On three math benchmarks and one code benchmark, CRAFT has the smallest drop of the methods compared — in fact it comes out 8.0% above the base model on average, which the paper attributes to the reasoning-centric GRPO training rather than to the safety objective itself.
| Method | DeepSeek-R1-Distill-Llama-8B | Qwen3-4B-Thinking | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| AIME24 | MATH-500 | LiveCodeBench | Minerva | Avg | AIME24 | MATH-500 | LiveCodeBench | Minerva | Avg | |
| Base | 0.507 | 0.918 | 0.102 | 0.221 | 0.437 | 0.700 | 0.952 | 0.219 | 0.404 | 0.569 |
| SafeChain | 0.453 | 0.870 | 0.091 | 0.198 | 0.403 | 0.625 | 0.850 | 0.196 | 0.361 | 0.508 |
| RealSafe | 0.453 | 0.898 | 0.091 | 0.198 | 0.410 | 0.627 | 0.851 | 0.198 | 0.358 | 0.509 |
| STAR | 0.460 | 0.894 | 0.093 | 0.200 | 0.412 | 0.635 | 0.863 | 0.199 | 0.366 | 0.516 |
| SafeKey | 0.533 | 0.920 | 0.107 | 0.232 | 0.448 | 0.736 | 0.901 | 0.230 | 0.425 | 0.573 |
| IPO | 0.540 | 0.916 | 0.109 | 0.235 | 0.450 | 0.739 | 0.903 | 0.238 | 0.427 | 0.577 |
| ReasoningShield | 0.473 | 0.896 | 0.069 | 0.230 | 0.417 | 0.581 | 0.739 | 0.260 | 0.332 | 0.478 |
| CRAFT | 0.536 | 0.989 | 0.137 | 0.261 | 0.481 | 0.762 | 0.938 | 0.276 | 0.431 | 0.602 |
Pass@1 on AIME 2024, MATH-500, LiveCodeBench, and Minerva. Variances are omitted in the paper as consistently ≤0.2%. See Table 2 and Section 6.2 ↗
GPTFuzzer and AutoDAN optimize the prompt rather than hand-writing it. Against both, attack success on the base model is above 93% at the reasoning level. CRAFT cuts reasoning-trace attack success by 72.1% and final-response success by 85.9%, though the reasoning level stays the weaker of the two.

Removing the consistency reward costs the most, which is the ablation the method's premise predicts. Removing LCLR removes two of the three rewards with it, since neither can be computed without the structured latent space.
| Variant | JBB reas. | JBB resp. | SR reas. | SR resp. | Avg | Avg change |
|---|---|---|---|---|---|---|
| CRAFT | 0.165 | 0.056 | 0.112 | 0.063 | 0.099 | — |
| w/o \(R_{\mathrm{txt}}\) | 0.373 | 0.167 | 0.382 | 0.193 | 0.279 | +18.0% |
| w/o \(R_{\mathrm{ls}}\) | 0.424 | 0.218 | 0.495 | 0.275 | 0.353 | +25.4% |
| w/o \(R_{\mathrm{cons}}\) | 0.447 | 0.228 | 0.512 | 0.296 | 0.371 | +27.2% |
| w/o LCLR | 0.536 | 0.260 | 0.582 | 0.312 | 0.423 | +32.4% |
The change column is the increase in the average jailbreak score relative to the full model, as reported in Section 6.3. See Table 3 ↗
Comparing the same projection before and after post-training on Qwen3-0.6B: SAFE and UNSAFE separate more cleanly, and the RETHINK cluster tightens and shifts toward the safe side.

StrongReject is used both as the textual reward during training and as the headline metric, so the paper re-scores JailbreakBench with Llama-Guard, which plays no part in training. The ranking holds: CRAFT averages 0.026 on R1-Distill-Llama-8B and 0.105 on Qwen3-4B-Thinking, against 0.555 and 0.514 for the base models and 0.034 and 0.137 for IPO, the strongest baseline. See Table 5 in Appendix F.
Training uses 2,500 harmful prompts from R2D-R1 together with its paired reasoning and response annotations; benign prompts from the same source are mixed in, because training on safety data alone produced over-refusal. Every experiment is repeated with three random seeds.
The paper states its own limits. GRPO over latent representations is expensive, and the runs were made under a constrained training budget — the authors read the remaining gaps on R1-Distill-Llama-8B as a budget effect rather than a ceiling. The latent safety heads and prototypes are not transferable across model families, since hidden-state geometry differs between them, so each family needs its own training. And the method has not been tested against attacks that adapt to the latent safety mechanism itself. The threat model assumes an attacker who optimizes prompts but cannot touch weights, training data, or the latent objective.
Limitations and threat model ↗@inproceedings{
luo2026contrastive,
title={Contrastive Reasoning Alignment: Reinforcement Learning from Hidden Representations},
author={Haozheng Luo and Yimin Wang and Jiahao Yu and Binghui Wang and Yan Chen},
booktitle={Forty-third International Conference on Machine Learning},
year={2026},
url={https://openreview.net/forum?id=56cQPBIg4R}
}