LPG: Balancing Efficiency and Policy Reasoning in Latent Policy Guardrails

Nanxi Li, Zhengyue Zhao, Chaowei Xiao
5/17/2026
7 citations
cs.CRcs.AI

Official code: SaFo-Lab/Latent_Policy_Guard (5 stars, Python, MIT, last commit 2026-07-04).

Abstract

Guardrails are a critical safety layer for modern AI systems, but their operating regime is changing. As LLMs are deployed as customized assistants, safety policies are increasingly specified at inference time by users, organizations, or regulatory contexts.

Show full abstract

This makes safety enforcement fundamentally dynamic: the guardrail should adapt to changing safety policies without retraining. Yet this requirement creates a fundamental tension: faithfully judging complex policy contexts demands reasoning capability, while practical deployment requires low-latency responses. We introduce Latent Policy Guardrail (LPG), a guardrail framework that learnssemantic latent deliberation over dynamic policies. LPG compresses the internal deliberation needed for intent interpretation and policy grounding into continuous states supervised by decision-relevant semantics. At inference time, it generates only a compact verdict anchored to the violated policy clauses, preserving auditability while avoiding the latency of explicit reasoning. Across policy guardrail benchmarks, LPG-4B reaches 84.5% average safety accuracy and 77.9% F1 by compressing deliberation into just 10 latent tokens, outperforming the strongest dynamic baseline while running roughly 11 times faster than Qwen3-4B-Thinking under the single-sample evaluation setup. Code and data are available at https://github.com/SaFo-Lab/Latent_Policy_Guard.

View on arXivView PDF

Code Implementations(1)

MIT

Latent Policy Guard (LPG) — a guardrail model that performs semantic latent deliberation over dynamic safety policies. LPG compresses intent and risk reasoning into latent tokens and emits a compact policy-indexed verdict.

50Python, ShellMay 15, 20265 months agoMIT

Similar Papers

Cite this paper

@article{li2026lpg,
  title  = {LPG: Balancing Efficiency and Policy Reasoning in Latent Policy Guardrails},
  author = {Nanxi Li and Zhengyue Zhao and Chaowei Xiao},
  year   = {2026},
  eprint = {2605.17329},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2605.17329v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2605.17329.svg)](https://codeofpaper.com/paper/2605.17329)

Discussion