Efficient Safety Guardrails through Latent Dual-Hypothesis Reasoning with On-Demand Trace Reconstruction
Organizations: Department of Computer Science University of Arizona, USA
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.4x inference speedup at batch size one. Further, reconstructed reasoning traces from the latent information exhibit high semantic similarity to the teacher's explicit reasoning.
Figures & tables
| Model | Test sets | ||
| AEGIS- 2.0 | Wild- GuardMix | Toxic- Chat0124 | |
| OpenAI Moderation API | 37.8 | 12.1 | 61.41 |
| LLAMAGUARD2-8B | 76.8 | 70.9 | - |
| LLAMAGUARD3-1B | 49.6 | 47.2 | - |
| LLAMAGUARD3-8B | 77.3 | 76.8 | - |
| Llama Prompt Guard 2-22M | 7.69 | 32.91 | 32.13 |
| Test dataset | BLEU | ROUGE | Sim. | ||||
| B-1 | B-2 | B-3 | R-1 | R-2 | R-L | ||
| LR-Guard -aegis2.0 | |||||||
| AEGIS2.0 | 68.50 | 60.75 | 55.47 | 68.55 | 53.87 | 61.16 | 0.86 |
| WildGuardMix | 69.62 | 62.28 | 57.17 | 69.72 | 55.76 | 62.87 | 0.88 |
| ToxicChat0124 | 69.68 | 62.32 | 57.25 | 69.88 | 55.87 | 63.00 | 0.86 |
| LR-Guard -wildguardmix | |||||||
| Model | Test sets | ||
| AEGIS- 2.0 | Wild- GuardMix | Toxic- Chat0124 | |
| Trained on AEGIS2.0 | |||
| LEG-1.0-aegis2.0-base | 76.95 | 60.40 | 59.78 |
| LEG-1.0-aegis2.0-large | 79.60 | 66.66 | 63.18 |
| ARBITER-aegis2.0 | 76.39 | 72.38 | 67.59 |
| LR-Guard -aegis2.0 | 77.65 | 72.91 | 68.64 |
Appendix figures & tables8 assets
Supplementary material from the paper’s appendix.
Appendix
| Model | Inference mode | Batch size 1 | Batch size 50 | ||
| Latency (ms/input) | Throughput (inputs/s) | Latency (ms/input) | Throughput (inputs/s) | ||
| ARBITER | Winner only | 9360.36 | 0.11 | 557.57 | 1.79 |
| Winner + Final JSON | 9820.91 | 0.10 | 664.26 | 1.51 | |
| LR-Guard | Winner only (No reconstruction) | 70.33 | 14.22 | 24.67 | 40.53 |
| Winner + Final JSON (No reconstruction) | 505.12 | 1.98 | 61.16 | 16.35 | |
| Winner + Final JSON + Reasoning trace reconstruction | 2799.64 | 0.36 | 145.39 | 6.88 | |
| Model | Model Size | GPU | Batch Size | Latency (ms/input) | Speedup |
| CoLaGuard-3B | 3B | H100 80GB | - | 318.90 | |
| CoLaGuard-8B | 8B | H100 80GB | - | 342.00 | |
| LatentGuard-1B | 1B | Not reported | 8 | 38.00 | |
| LatentGuard-3B | 3B | Not reported | 8 | 69.00 | |
| LatentGuard-8B | 8B | Not reported | 8 | 89.00 | |
| LPG-4B | 4B | A100 80GB | 1 | 748.00 |
| Assessment Type | Condition | Rate (%) |
| Reasoning Reconstruction | Safe-hypothesis reasoning is preserved | 89.0 |
| Unsafe-hypothesis reasoning is preserved | 95.0 | |
| Deliberation reasoning is preserved | 84.0 | |
| All three reasoning sections are preserved | 72.0 | |
| Decision Consistency | Deliberation decision agrees with the final predicted label | 85.0 |
| Model | Precision | Recall | F1 | FPR | FNR |
| AprielGuard ( Kasundra et al., 2026 ) | 97.00 | 96.00 | 96.00 | 31.00 | - |
| ARBITER-wildguardmix | 99.17 | 96.15 | 97.64 | 7.62 | 3.85 |
| LR-Guard -wildguardmix | 99.03 | 96.70 | 97.85 | 9.05 | 3.30 |
| Model | Precision | Recall | F1 | FPR | FNR |
| LlamaGuard3-8B | 95.20 | 80.00 | 87.00 | – | – |
| LlamaGuard4-12B | 90.10 | 77.50 | 83.30 | – | – |
| GradSafe (Llama-3.1-8B) | 88.60 | 93.50 | 91.00 | – | – |
| RLShield (Llama-2-7B) | 86.90 | 96.50 | 91.50 | – | – |
| RLShield (Llama-3.1-8B) | 95.30 | 91.00 | 93.10 | – | – |
| ARBITER-wildguardmix | 94.17 | 97.00 | 95.57 | 4.80 | 3.00 |
| Unsafe Category | ARBITER | LR-Guard -wildguardmix |
| Violence and Physical Harm | 98.73 | 98.73 |
| Cyberattack | 98.95 | 98.95 |
| Fraud Assisting Illegal Activities | 88.89 | 88.89 |
| Private Information Individual | 89.80 | 89.80 |
| Sensitive Information Organization Government | 90.11 | 92.47 |
| Causing Material Harm by Disseminating Misinformation | 98.88 | 98.88 |
| Model | Prompt classification | Explainability classification | ||||
| AEGIS2.0 | WildGuardMix | ToxicChat0124 | AEGIS2.0 | WildGuardMix | ToxicChat0124 | |
| LR-Guard -aegis2.0 | 0.55 | 0.62 | 0.53 | 0.22 | 1.00 | 1.24 |
| LR-Guard -wildguardmix | 0.15 | 0.19 | 1.05 | 0.72 | 0.40 | 2.72 |
| LR-Guard -toxicchat0124 | 0.51 | 0.54 | 0.42 | 1.04 | 0.49 | 0.61 |
| Model | AEGIS2.0 | WildGuardMix | ToxicChat0124 | ||||||||||||
| P | R | F1 | FPR | FNR | P | R | F1 | FPR | FNR | P | R | F1 | FPR | FNR | |
| LR-Guard -aegis2.0 | 86.49 | 90.26 | 88.33 | 16.46 | 9.74 | 79.19 | 87.92 | 83.32 | 17.92 | 12.08 | 59.88 | 86.19 | 70.67 | 4.43 | 13.81 |
| LR-Guard -wildguardmix | 73.27 | 94.05 | 82.37 | 40.11 | 5.95 | 91.71 | 86.60 | 89.09 | 6.08 | 13.40 | 56.55 | 90.61 | 69.64 | 5.34 | 9.39 |
| LR-Guard -toxicchat0124 | 87.19 | 72.16 | 78.96 | 12.39 | 27.84 | 88.06 | 62.60 | 73.18 | 6.59 | 37.40 | 82.62 | 85.36 | 83.97 | 1.38 | 14.64 |
LLM Guardrails
Large language model guardrails detect or constrain harmful outputs, prompt attacks, and unsafe agent actions before they cause harm.
See all 194 papers