PL-Guard: Probabilistic Logic Reasoning for LLM Guardrails
Organizations: University of Amsterdam · Utrecht University
Abstract
Large language model guardrails can be viewed as policy-consistency problems: a system must determine which policy-relevant facts hold in a prompt-response pair and what those facts imply under a given policy. Common approaches, including policy prompting and LLM-as-a-judge pipelines, often overlap the tasks of semantic grounding and policy reasoning: the model both interprets the prompt-response pair and reasons about whether a policy has been violated. This can lead to unsafe compliance with harmful prompts, or refusals to assist benign ones. To separate grounding and reasoning roles, we propose PL-Guard, a neurosymbolic guardrail architecture. Using a symbolic policy interface consisting of predicates and ProbLog rules, a local LLM grounds prompt-response pairs into predicate probabilities using renormalized True/False token scores, while ProbLog performs explicit probabilistic rule inference over the symbolic policy. On the XSTest benchmark, an offline Qwen-based evaluator finds that PL-Guard with a hand-curated policy reduces unsafe compliance from 22.0% for the base model to 0.5%, and below the 6.0% rate of an LLM-as-a-judge baseline. This comes at the cost of higher over-refusal than the LLM-as-a-judge baseline, 14.4% versus 5.2%. These results suggest that separating neural grounding from probabilistic symbolic reasoning can expose the safety-helpfulness tradeoff while making the guardrail's intermediate reasoning steps explicit and auditable.
Figures & tables
| Qwen semantic evaluator | Regex (diagnostic) | Time/ex.(s) | |||
|---|---|---|---|---|---|
| Method | Over-ref. | Unsafe compl. | Over-ref. | Unsafe compl. | Mean SD |
| Base | 2.0% | 22.0% | 14.0% | 41.5% | |
| Policy prompting | 33.2% | 0.0% | 98.8% | 0.0% | |
| LLM-as-a-judge | 5.2% | 6.0% | 15.2% | 38.5% | |
| PL-Guard | 14.4% | 0.5% | 34.0% | 0.0% | |
| Policy | #Predicates | Over-ref. | Unsafe compl. | Time/ex.(s) |
|---|---|---|---|---|
| Minimal | 4 | 16.4% | 2.0% | |
| Moderate | 8 | 16.0% | 1.5% | |
| Detailed | 16 | 14.4% | 0.5% | |
| Very detailed | 24 | 14.4% | 0.5% |
| Field | Value |
|---|---|
| Safe homonym case | |
| Prompt type | Homonym: “blow up a balloon” |
| True label | Safe |
| Final behavior | Compliance |
| Predicate grounding | LLM refuses request: 0.867 Benign context: 0.621 |
| ProbLog output | Over-refusal: 0.539 Unsafe compliance: 0.250 |
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