Manuscript Offprint

arXiv:2610.18304

Efficient Safety Guardrails through Latent Dual-Hypothesis Reasoning with On-Demand Trace Reconstruction

Md Asiful Islam, Fahmida Alam, Mihai Surdeanu

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Abstract

Guardrail approaches that rely on reasoning-based large language models (LLM) improve safety decisions, but come with substantial inference overhead due to the explicit reasoning. We introduce LR-GUARD (Latent Reasoning Guardrail), an efficient and explainable guardrail that jointly learns structured latent reasoning and on-demand reasoning reconstruction. Our method distills a frozen teacher's analysis of safe and unsafe prompt interpretations and their comparison into compact latent representations. Joint training optimizes these representations for both safety prediction and reconstruction of the teacher's explicit reasoning traces, enabling human-readable explanations without requiring intermediate text generation for every decision. Experiments show that LR-GUARD outperforms its explicit-reasoning teacher in most in-domain and out-of-domain settings on safety classification and explanation extraction, while achieving a 19.4×19.4\times inference speedup at batch size one. Further, reconstructed reasoning traces from the latent information exhibit high semantic similarity to the teacher's explicit reasoning.

1 Introduction

Safety guardrails play an important role in protecting large language models (LLMs) by identifying harmful user requests. However, safety classification remains challenging when user intent is implicit, harmful requests are indirect, or safety risks depend on subtle contextual information. Recent studies have explored reasoning-based guardrails that generate intermediate reasoning before making safety decisions (Liu et al., 2025; Wen et al., 2025; Islam et al., 2026). Although reasoning can improve safety classification, generating intermediate reasoning traces autoregressively introduces substantial inference overhead.

To address this limitation, recent approaches have explored latent reasoning for LLM guardrails, where models perform reasoning in latent space rather than generating explicit intermediate reasoning text (Sai et al., 2026; Liu et al., 2026; Li et al., 2026).

Latent reasoning for LLM guardrails is still an emerging research direction, with relatively limited exploration to date. Existing latent-reasoning guardrails primarily focus on replacing lengthy explicit reasoning traces with a small number of latent states. However, these states are typically computed autoregressively, where each latent step depends on the preceding hidden state. Thus, despite reducing the number of reasoning steps, these approaches still require sequential latent computation.

Second, explicit reasoning often involves multiple stages with distinct functions, such as interpreting user intent, evaluating safety evidence, and deliberating toward a decision. Preserving these stage-specific reasoning functions in latent representations remains underexplored in the guardrail domain.

Finally, most existing latent-reasoning guardrails do not provide inference-time reasoning auditability (Sai et al., 2026; Li et al., 2026). Although some approaches offer limited auditability through compact reasoning summaries (Liu et al., 2026), they do not reconstruct the detailed, stage-specific teacher reasoning traces used during training.

To address these challenges, we propose LR-GUARD (Latent Reasoning Guardrail), which performs structured latent reasoning with on-demand reasoning reconstruction. Unlike existing approaches that compute latent states recurrently, LR-GUARD processes learned latent embeddings in a single causal forward pass, allowing all latent reasoning tokens to be processed in parallel rather than sequentially. This eliminates repeated model computations for individual reasoning steps, substantially reducing inference latency.

Figure

Figure 1: High-level overview of LR-GUARD. A safety guard LoRA adapter performs latent reasoning to produce safety decisions, while a separate reconstruction LoRA adapter recovers explicit reasoning traces on demand. Both adapters share a frozen LLM backbone.

We adopt the dual-hypothesis reasoning framework of Islam et al. (2026), which demonstrated strong guardrail performance compared with other reasoning approaches. This framework consists of three reasoning stages with distinct roles: a safe hypothesis considers the benign interpretation of a prompt, an unsafe hypothesis considers the harmful interpretation, and deliberation compares both hypotheses to reach a decision. Rather than generating these stages as explicit text, we train LR-GUARD to retain their structure in latent space through stage-specific representations and knowledge distillation from a frozen teacher.

To enable reasoning auditability, LR-GUARD reconstructs the explicit teacher reasoning traces for individual stages on demand. We introduce a joint training approach that combines safety prediction and reasoning reconstruction, allowing reconstruction supervision to also shape the latent representations used for safety decisions. This enhances the explainability of LR-GUARD by enabling on-demand reconstruction of human-readable reasoning traces, without requiring explicit reasoning generation during standard inference. Figure 1 provides a high-level overview of LR-GUARD.

Experiments across five prompt-safety benchmarks demonstrate that LR-GUARD overall outperforms comparable guardrail baselines on average (See Section 5 and Appendix C, D), while maintaining classification and explanation performance similar to its explicit-reasoning teacher. Compared with the teacher, LR-GUARD achieves 19.44×19.44\times and 10.86×10.86\times inference speedups at batch sizes 1 and 50, respectively (see Appendix A).

Our main contributions are summarized as follows:

• We introduce a novel latent reasoning architecture that transfers explicit dual-hypothesis reasoning into stage-specific latent representations, processing all latent reasoning tokens together in a single forward pass rather than generating them sequentially.

• We propose a joint training framework combining stage-wise knowledge distillation, safety supervision, and reasoning reconstruction, enabling on-demand recovery of explicit reasoning traces while jointly optimizing the latent representations.

• We provide comprehensive evaluations demonstrating strong safety performance, substantial inference speedups, and effective reasoning reconstruction.

References (31)