LR-Guard: Efficient safety guardrail based on latent dual-hypothesis reasoning and on-demand trajectory reconstructionEfficient Safety Guardrails through Latent Dual-Hypothesis Reasoning with On-Demand Trace Reconstruction
LR-GUARD uses latent-space dual hypotheses as a prompt guardrail; in most settings, the unsafe-class F1 is higher than the teacher ARBITER, with a 19.44x speedup at bs1.
External guardrails do not modify the underlying LLM and judge whether user prompts are safe. The paper says hard examples include implicit intent, indirect harmful requests, and risks that depend on subtle context. The output is a label plus evidence phrases; explicit reasoning is only reconstructed on request and is not fed back into the decision. It also evaluates jailbreak detection and over-refusal on WildJailbreak and XSTest.
- Reasoning-based guardrails generate intermediate text before judging prompt safety, which the authors say is costly. Existing latent-space guardrails mostly compute latent states step by step, and cannot restore the staged teacher trajectory during inference. Hard examples include implicit intent and indirect harmful requests.
- Freeze Llama-3.1-8B-Instruct, two LoRAs share the backbone. The Guard Adapter uses 32 stage latent tokens in one forward pass to decode labels and evidence phrases. The reconstruction adapter only uses prefix KV to recover teacher text on request, and does not feed back into the decision.
- The authors say that across three prompt safety sets, the unsafe-class F1 for classification and explanation is higher than the teacher most of the time, with some cells below the teacher. On H100 at batch size 1, Winner plus JSON is 19.44× faster than the teacher. Reconstruction semantic similarity is 0.83 to 0.89.
- The authors write that efficiency experiments were run on NVIDIA H100 80GB, and that latency may differ with other hardware and deployment, and they believe absolute latency comparisons under the same hardware, batch, and evaluation settings are needed. The experiments use three prompt sets and an 8B backbone; jailbreak and over-refusal are reported only for the wildguardmix variant.
- Evaluated models
- LR-GUARD-aegis2.0LR-GUARD-wildguardmixLR-GUARD-toxicchat0124
- Benchmarks
- AEGIS2.0WildGuardMixToxicChat0124LEG-1.0WildJailbreakXSTest
- Metrics
- unsafe-class F1PrecisionRecallFPRFNRBLEUROUGEsemantic similaritylatencythroughput
LR-Guard (Latent Reasoning Guardrail) jointly learns structured latent reasoning and on-demand reasoning trajectory reconstruction, distilling the analysis of a frozen teacher model's interpretations of safe and unsafe prompts into compact latent representations to build an efficient and interpretable safety guardrail. In most in-domain and out-of-domain settings, its safety classification and explanation extraction outperform an explicit-reasoning teacher model, with 19.4x inference speedup at batch size 1, and reconstructed trajectories have high semantic similarity to the teacher's explicit reasoning.
Related events and news
1 events · 1 news mentions
News that mentions this paper
RL/RLHF 训练条件可诱发模型智能体提权逃逸
- 公众号 大模型安全研究cites the paper's id or link大模型安全周报:RL/RLHF 训练条件本身即可诱发前沿模型智能体提权逃逸(CVE-2026-65616)
Efficient Safety Guardrails through Latent Dual-Hypothesis Reasoning with On-Demand Trace Reconstruction(https://arxiv.org/abs/2610.18304)
Paper analysis
What problem does this paper attempt to solve?
Explicit reasoning guardrails are costly; LR-GUARD puts both hypotheses into latent space and supports on-demand reconstruction.
Explicit reasoning can improve prompt safety classification, but autoregressively generating intermediate reasoning is costly; existing latent-space guardrails still mostly compute step by step, and it is difficult to restore the staged teacher trajectory during inference.
- Scenario: external guardrails identify harmful user requests without modifying the underlying model. The authors say classification remains difficult when intent is implicit, requests are indirect, or risk depends on subtle context.
- Existing shortcomings: GuardReasoner, ThinkGuard, ARBITER generate explicit reasoning before deciding, which the authors say incurs reasoning overhead. CoLaGuard, LatentGuard compress long reasoning into a few latent states, but the authors say these states are usually computed autoregressively, with each step depending on the previous hidden state. The authors also say most latent-space guardrails cannot restore the detailed, staged teacher trajectory used in training during inference; LatentGuard only provides a compact audit summary.
- Approach: propose LR-GUARD. A frozen teacher distills the safe hypothesis, unsafe hypothesis, and deliberation into stage-specific latent representations; joint training simultaneously optimizes safety prediction and on-demand reconstruction, and standard inference does not generate intermediate text.
- Threat model:
- The victim system is an external safety guardrail that evaluates whether user prompts are safe, without modifying the underlying LLM.
- The goal is to give a safe or unsafe label; when unsafe, list evidence phrases in a JSON.
- The hard examples written in the paper are implicit intent, indirect harmful requests, and risks that depend on subtle context. The paper does not write the attacker's parameter knowledge, nor does it use terms like white-box or black-box.
- It also evaluates jailbreak detection on WildJailbreak and over-refusal of benign prompts containing sensitive words on XSTest.
What related research exists?
Related work covers external guardrails, explicit reasoning, and recurrent latent states; the authors instead use single-forward pass stage latent tokens.
External safety guardrails
- Llama Guard (Inan et al., 2023), WildGuard (Han et al., 2024), LEG (Islam and Surdeanu, 2026) perform safety classification without modifying the underlying model; LEG also marks unsafe evidence segments.
- GuardReasoner (Liu et al., 2025), ThinkGuard (Wen et al., 2025) use explicit reasoning to support safety decisions.
- ARBITER (Islam et al., 2026) compares a safe hypothesis with an unsafe hypothesis before deliberating. The authors say it has strong guardrail performance relative to other reasoning methods, while citing Sreedhar et al. (2025) that explicit intermediate trajectories incur additional inference overhead.
Latent-space reasoning for safety scenarios
- Hao et al. (2026), CODI (Shen et al., 2025), SoftCoT (Xu et al., 2025) reason in continuous latent representations rather than generating intermediate text.
- CoLaGuard (Sai et al., 2026) and LatentGuard (Liu et al., 2026) compress explicit reasoning into looping latent states, with the latter additionally supporting on-demand audit. LPG (Li et al., 2026) uses separate latent stages for intent and strategy reasoning; DRAFT (Wang et al., 2026) explores task-decoupled latent reasoning in agent safety.
- The difference the paper explicitly states is that LR-GUARD uses learned latent tokens to represent different stages in one forward pass, rather than sequentially generating latent states.
Interpretability and reasoning reconstruction
- The paper cites Turpin et al. (2023): explicit trajectories provide readable reasons but do not necessarily reflect the actual decision process.
- The authors say LatentGuard does compact auditing and LPG reconstructs reasoning during training; LR-GUARD instead jointly optimizes prediction and reconstruction so that the teacher's staged trajectory can be restored on demand, and marks unsafe evidence phrases in the final output.
Baseline methods and benchmarks
- Baseline methods: Table 1 includes OpenAI Moderation API, LlamaGuard2/3, Llama Prompt Guard 2, GuardReasoner, CoLaGuard, LatentGuard, AEGISGuard, LEG, ARBITER, WildGuard, Gemma-3-4B and Llama-3.1 reasoning variants, ToxicChat-T5-Large. The authors state this comparison is adapted from Islam et al. (2026), with latent-space baselines and LR-GUARD added. AprielGuard in Appendix C and XSTest baseline numbers in Appendix D are taken from the respective papers or Islam et al. (2026).
- Benchmarks/datasets: AEGIS2.0, WildGuardMix, ToxicChat0124 and their LEG-1.0 explanation annotations; jailbreak uses WildJailbreak, over-refusal uses XSTest.
The authors position LR-GUARD as preserving the dual-hypothesis staged structure, but processing all latent tokens in one causal forward pass, and using reconstruction supervision to shape the latent representations used for decisions.
How does the paper address this problem?
Freeze ARBITER as teacher, 32 stage latent tokens in one forward pass produce the decision, another LoRA reconstructs on demand.
LR-GUARD trains two LoRAs on a frozen LLM: the Guard Adapter performs latent-space reasoning and outputs the safety decision, and the Reconstruction Adapter restores a readable trajectory only on request. The teacher is a frozen ARBITER on the same training set; standard inference does not generate three explicit text segments.
Dual hypotheses and latent tokens
- The three stages come from ARBITER: the safe hypothesis gives the strongest benign interpretation, the unsafe hypothesis gives the strongest harmful interpretation, and deliberation judges which side is more supported by the prompt. The authors say looking at both interpretations simultaneously is to avoid premature commitment, especially for ambiguous prompts.
- The vocabulary is extended with 32 trainable special tokens: 8 each for safe and unsafe (LATENT_SAFE_0 to 7, with the same structure for unsafe), and 16 for deliberation (LATENT_DELIB_0 to 15). The counts are fixed across all experiments. The authors say they do not tune the number of tokens to avoid extra computational cost; more deliberation slots are given to compare the two hypotheses.
- The tokens are appended after the instruction and prompt in the order safe, unsafe, deliberation; they are input slots, not autoregressively generated outputs. The Guard Adapter performs one causal forward pass, and later stages can see earlier stages through causal attention.
Joint training
The joint objective is Ljoint = LKD + Lguard + Lreconstruction, i.e., the sum of distillation, safety decision supervision, and reasoning reconstruction. The backbone is frozen; the two adapters, latent token embeddings, and the student-side attention pooling are trainable. The teacher and its pooling are frozen.
- Distillation: The teacher pooling condenses the explicit reasoning hidden states into hs, hu, hd, and the student pooling condenses the corresponding latent states into zs, zu, zd. The alignment term is Lalign = ∑i ∈ {s,u,d}[1−cos(hi,zi)]. L_KD also includes a KL at the label position, distilling the teacher's distribution over the final label.
- When teacher and gold label disagree: the label KL and deliberation alignment are removed, and the safe and unsafe alignment weights are reduced from 1.0 to 0.25. When they agree, full distillation is performed.
- Decision supervision: an intermediate Winner (safe or unsafe) is generated first, then a JSON containing the final label and evidence phrases; both are supervised with the gold label. The JSON cross-entropy is averaged separately over labels, explanation segments, and syntax tokens following MC-SFT, then weighted, to avoid short labels being diluted by longer tokens. The paper does not give the weight values.
- Reconstruction: for each stage, the prefix KV up to that stage is retained, paired with the control token recover_safe, recover_unsafe, or recover_delib, and the target is the teacher's explicit text. The cross-entropy over the three stages' target tokens is averaged. The prefix KV remains in the computation graph, and reconstruction gradients update the Guard Adapter and latent token embeddings.
Training setup: both LoRAs have rank 16, alpha 32, dropout 0.05, applied to all linear layers. AdamW, learning rate 2×10^-4, batch size 4 per device, gradient accumulation 64 steps, 3 epochs. Seeds are 32, 42, 52.
Inference and output
- Standard inference uses only the Guard Adapter. The instruction, prompt, and all latent tokens are prefilled once, then the Winner and final JSON are autoregressively decoded. The authors say this avoids looping to generate latent states.
- When inspection is needed, the prefix KV of the selected stage is reused, and the Reconstruction Adapter and corresponding control token are enabled. Reconstruction happens after the decision; the output is not fed back into the decision, and classification does not count reconstruction cost.
- Training and evaluation use the same instruction: compare interpretations within the latent slots, then output only a Winner and final JSON, without explicit hypotheses or deliberation. The safe explanation field is a fixed safety marker; for unsafe, it extracts original words or phrases from the prompt. Appendix H gives the full instruction. Explanation supervision comes from LEG-1.0's unsafe word or phrase annotations.
What experiments did the paper conduct?
Unsafe-class F1 is higher than the teacher in most settings; Winner plus JSON is 19.44× faster at batch size 1.
Experimental Setup
- Models: Frozen backbone is Llama-3.1-8B-Instruct. For each training set, ARBITER trained by Islam et al. (2026) on the same data is used as a frozen teacher. The authors train three LR-GUARD variants.
- Data: AEGIS2.0, WildGuardMix, ToxicChat0124. Explanation supervision uses the corresponding LEG-1.0 extensions. The paper does not report sample sizes.
- Baselines: Table 1 is adapted from Islam et al. (2026), with latent-space baselines added. GuardReasoner, CoLaGuard, and LatentGuard marked with † are treated by the authors as multi-source trained, and their results on all three test sets are considered in-domain.
- Metrics: Both classification and explanation report unsafe-class F1. Reconstruction uses BLEU, ROUGE (0–100), and cosine similarity ([-1, 1]). The appendix additionally reports Precision, Recall, FPR, FNR. Efficiency uses per-input latency and throughput.
- Repeats: Section 4 states all experiments use seeds 32, 42, 52. LR-GUARD in Table 1 and Table 3 is averaged over the three seeds, with standard deviations in Table 10. Table 9 and Table 11 are marked as using only seed 32. The paper does not state the LLM reviewer model.
- Efficiency hardware: NVIDIA H100 80GB; models are trained on WildGuardMix and tested on the same WildGuardMix test set; batch sizes are 1 and 50 (Appendix A).
Main Results
Unsafe-class F1 (%), according to Table 1. In-domain is the column for each variant on its training dataset. LR-GUARD is averaged over three seeds; ARBITER is listed as in the original table, and the paper does not state whether it is averaged over multiple seeds.
Swipe horizontally to read the table
Model AEGIS2.0 WildGuardMix ToxicChat0124 Llama Prompt Guard 2-22M 7.69 32.91 32.13 LR-GUARD-aegis2.0 88.00 82.91 70.38 ARBITER-aegis2.0 87.23 84.23 71.81 LR-GUARD-wildguardmix 82.28 88.87 69.25 ARBITER-wildguardmix 81.85 89.10 67.98 LR-GUARD-toxicchat0124 79.36 73.80 83.69 ARBITER-toxicchat0124 78.86 73.39 82.30 Other baselines in Table 1 are omitted, including OpenAI Moderation API, LlamaGuard series, GuardReasoner, CoLaGuard, LatentGuard, LEG, and WildGuard. OpenAI Moderation API is 12.1 on WildGuardMix.
- The authors state that relative to the teacher, in-domain results are higher in two of three places, and out-of-domain results are higher in four of six places. The cases below the teacher are the two out-of-domain cells for the aegis variant and the in-domain cell for the wildguardmix variant.
- Compared with multi-source latent-space guardrails, the authors use only the corresponding in-domain results. On WildGuardMix, they state it is higher than all LatentGuard variants and CoLaGuard-3B (88.15); CoLaGuard-8B is 89.44, higher than the corresponding in-domain cell in the table. On ToxicChat0124, they state 83.69 is higher than all reported variants of both methods; LatentGuard-8B is 81.18.
- The authors state it outperforms most comparable baselines. Counterexamples in the table include GuardReasoner-8B's 89.02 on WildGuardMix, higher than the wildguardmix variant's in-domain cell.
Inference Efficiency
Latency is in ms/input, according to Table 4. Both training and testing use WildGuardMix, GPU is H100 80GB.
Inference mode bs1 bs50 ARBITER, Winner+JSON 9820.91 664.26 LR-GUARD, Winner+JSON, no reconstruction 505.12 61.16 LR-GUARD, with trajectory reconstruction 2799.64 145.39 LR-GUARD, Winner only 70.33 24.67 - The authors report that Winner plus JSON without reconstruction is 19.44x and 10.86x faster than ARBITER at batch sizes 1 and 50. The abstract states 19.4x for batch size 1.
- With Winner only, they report 133.09x and 22.60x. With reconstruction added, it is still 3.51x and 4.57x faster than ARBITER's full inference.
- In Table 5, CoLaGuard, LatentGuard, and LPG have speedups of 8.90x to 12.90x relative to their respective explicit inference baselines. The authors state that hardware, batch, and evaluation settings differ, so absolute latencies should not be directly compared.
Explanation Extraction and Trajectory Reconstruction
- On Table 3, the authors state that relative to ARBITER, in-domain is again 2/3 higher and out-of-domain 4/6 higher. The cases below the teacher are the toxicchat variant's in-domain 65.69 vs. 66.71, and its out-of-domain 63.68 vs. 65.00 and 62.18 vs. 62.71. LEG-1.0-aegis2.0-large's in-domain explanation F1 is 79.60, higher than LR-GUARD-aegis2.0's 77.65.
- Table 2: The authors state semantic similarity ranges from 0.83 to 0.89. The wildguardmix variant on WildGuardMix has BLEU-1 of 71.72, ROUGE-L of 65.21, and similarity of 0.89. The lowest similarity in the table is 0.83, corresponding to the toxicchat variant on AEGIS2.0.
- Appendix B evaluates 100 examples from the WildGuardMix test set (50 safe, 50 unsafe) with 1 annotator. The retention rates for safe assumptions, unsafe assumptions, and deliberation are 89.0%, 95.0%, and 84.0%; all three segments are retained together 72.0% of the time, and deliberation agrees with the final predicted label 85.0% of the time (Table 6). The authors state the unsafe assumption retention rate is the highest. The paper does not state the seed used.
Jailbreak Detection and Over-Refusal
- Appendix C evaluates LR-GUARD-wildguardmix on WildJailbreak, which the authors state is out-of-domain relative to WildGuardMix training. Table 7: F1 97.85%, Recall 96.70%, FNR 3.30%, Precision 99.03%, FPR 9.05%. ARBITER is 97.64%, 96.15%, 3.85%, 99.17%, 7.62%. The authors state F1 and Recall are slightly higher and FNR lower; in the table, FPR is higher than ARBITER. AprielGuard's F1 is 96.00%.
- Appendix D evaluates the same variant on XSTest, which the authors state is also out-of-domain. Table 8: F1 95.26%, FPR 4.0%, Recall 95.5%, FNR 4.50%. ARBITER is 95.57%, 4.80%, 97.00%, 3.00%. The authors state FPR is lower and F1 is comparable, and F1 is higher than the remaining baselines in the table; relative to ARBITER, Recall is lower and FNR is higher.
Other Ablations and Analyses
- Figure 3: Same-label replacement generally increases gold-label confidence, while opposite-label replacement generally decreases it. The authors state this provides evidence that the latent representation contains information relevant to the final safety prediction and influences the prediction. The paper does not give percentage points for each point.
- Table 9 (seed 32, all trained on WildGuardMix): The authors state 9 classes are the same as ARBITER, 3 are higher, and 2 are slightly lower. The lower ones are Defamation Encouraging Unethical or Unsafe Actions (98.90 vs. 100.00) and Social Stereotypes and Unfair Discrimination (84.85 vs. 86.57).
- Table 10's sample standard deviations range from 0.15 to 2.72 (0–100). The maximum is 2.72, which is the wildguardmix variant's explanation F1 on ToxicChat0124. The authors state they are generally low and consistent across seeds.
- Table 11 uses only seed 32. The authors state in-domain Precision and Recall are relatively balanced, and FPR and FNR are relatively low. Out-of-domain shows higher false positives or false negatives, e.g., the wildguardmix variant on AEGIS2.0 has FPR 40.11, and the toxicchat variant on WildGuardMix has FNR 37.40.
- The latent token count is fixed at 8, 8, 16, and the paper does not report results from varying this number.
What are some points that can be further explored?
The authors note that efficiency measurements were on H100, and believe absolute latency comparisons under the same hardware and batch are still needed.
Limitations and future directions noted by the authors
- Efficiency experiments were run on NVIDIA H100 80GB GPUs; the authors write that actual latency and throughput may vary with hardware platform and deployment settings (Limitations).
- The authors write that the inference efficiency of other latent-space guardrails has been reported, but to better compare the efficiency of these models, direct comparison of absolute inference time under the same hardware, batch size, and evaluation settings is needed (Limitations).
Experimental coverage
- Classification and explanation use AEGIS2.0, WildGuardMix, ToxicChat0124, with one variant trained on each, and in-domain and out-of-domain F1 reported on three test sets (Table 1, Table 3). The paper does not report sample sizes for each set.
- The backbone is frozen Llama-3.1-8B-Instruct, and the teacher is frozen ARBITER on the same dataset; LoRA rank 16, alpha 32, dropout 0.05, trained for 3 epochs. Section 4 says seeds 32, 42, 52 are used; Table 9 and Table 11 indicate seed 32.
- Efficiency measurements are on NVIDIA H100 80GB, comparing LR-GUARD trained on WildGuardMix with ARBITER, on the WildGuardMix test set, at batch sizes 1 and 50 (Appendix A).
- Jailbreak results come from LR-GUARD-wildguardmix on WildJailbreak (Appendix C); over-refusal results come from the same variant on XSTest (Appendix D). The human reconstruction evaluation is 1 annotator, 100 cases from the WildGuardMix test set, 50 safe and 50 unsafe (Appendix B). The paper does not state the random seed for this evaluation or report inter-annotator agreement.
- The number of latent tokens is fixed at 8 safe, 8 unsafe, 16 deliberation, and the paper states this count was not tuned. Semantic similarity uses cosine similarity; the paper does not state the embedding model.
Summarize the main content of the paper
LR-GUARD uses staged latent tokens for guardrails; F1 is higher than the teacher in most settings, with a 19.44× speedup at bs1.
LR-GUARD is an external prompt guardrail: it replaces autoregressive intermediate text with dual hypotheses in latent space, and reconstructs the teacher trajectory when needed.
- Problem: explicit reasoning is used to handle implicit intent and indirect harmful requests, but generating intermediate text increases latency. Existing latent-space guardrails mostly compute latent states in a loop and cannot restore staged teacher reasoning on demand.
- Method: freeze Llama-3.1-8B-Instruct, with ARBITER on the same data as teacher. 32 latent tokens complete three-stage reasoning in one causal forward pass, then output a Winner and a JSON with evidence phrases. The joint objective includes representation alignment, label distillation, gold-label supervision, and three-stage reconstruction. Reconstruction is off by default and is not fed back into classification.
- Classification and explanation: the authors report that relative to the teacher, unsafe-class F1 is higher in two of three in-domain settings and four of six out-of-domain settings (Table 1, Table 3). The one classification setting below the teacher is the wildguardmix variant in-domain, 88.87 vs. 89.10. The main explanation exception is the toxicchat variant.
- Reconstruction and speed: semantic similarity is 0.83 to 0.89 (Table 2). In a 100-case human evaluation, all three segments are preserved in 72.0% (Table 6). The abstract writes a 19.4× speedup at batch size 1; Appendix A writes Winner plus JSON is 19.44× and 10.86× at batch sizes 1 and 50.
- Authors' conclusion: the authors say LR-GUARD outperforms the explicit-reasoning teacher on most in-domain and out-of-domain settings while reducing classification latency; the latent-state substitution is used by the authors to support that latent representations contain information relevant to the final safety prediction.
Related papers
Show 3 more papers
- Guard Models Are Overconfident Where Base Models Are UncertainAnalysis / interpretabilityarXiv