atlas

Research map / Large language models / Retrieval and knowledge

$R^2$-Guard: Robust Reasoning Enabled LLM Guardrail via Knowledge-Enhanced Logical Reasoning

ICLR 2025 · Large language models › Retrieval and knowledge · approach: Knowledge graph reasoning with LLMs · 1 citations (OpenAlex)

Read the paperCheck your idea against 108,967 papers

AI-extracted summary. Written by AI from the paper's full text. Numbers and claims can be wrong or missing context, so check the paper before you cite or build on it.

Proposes R²-Guard, an LLM safety guardrail that combines category-specific unsafety classifiers with probabilistic graphical model reasoning (Markov logic networks or probabilistic circuits) over first-order safety-category rules, and introduces the TwinSafety benchmark.

Problem

Existing LLM guardrail models treat safety categories independently and learn safety knowledge implicitly, causing ineffectiveness on correlated long-tail categories, vulnerability to jailbreaks, and inflexibility to new categories.

Approach

Encode inter-category safety knowledge as weighted first-order logical rules compiled into a probabilistic graphical model (MLN or layered probabilistic circuit), which takes per-category unsafety probabilities from data-driven classifiers and outputs a calibrated overall unsafety probability; rule weights are learned by pseudo-learning on simulated scores or real learning on labeled data.

Key results

Measured effects reported in the paper

What was changedWhereMeasuredEffect
add knowledge-enhanced logical reasoning to category-specific guardrail predictionsR²-Guard (MLN) · OpenAI ModAUPRC: 0.870 -> 0.926Helped
add knowledge-enhanced logical reasoning to category-specific guardrail predictionsR²-Guard (MLN) · ToxicChatAUPRC: 0.885 -> 0.903Helped
add knowledge-enhanced logical reasoning to category-specific guardrail predictionsR²-Guard (MLN) · XSTestAUPRC: 0.819 -> 0.878Helped
add knowledge-enhanced logical reasoning to category-specific guardrail predictionsR²-Guard (MLN) · OverkillAUPRC: 0.879 -> 0.921Helped
add knowledge-enhanced logical reasoning to category-specific guardrail predictionsR²-Guard (MLN) · BeaverTailsAUPRC: 0.797 -> 0.830Helped
add knowledge-enhanced logical reasoning to category-specific guardrail predictionsR²-Guard (MLN) · TwinSafetyAUPRC: 0.737 -> 0.758Helped
use PC reasoning instead of MLN reasoning (ablation)R²-Guard · Six standard safety datasetsAverage AUPRC: 0.869 -> 0.869No clear effect
use PC reasoning instead of MLN reasoning (ablation)R²-Guard · Six standard safety datasetsAverage reasoning runtime (seconds per instance): 0.1123 -> 0.0062Helped
use pseudo-learning on simulated scores instead of real-learning on realistic samples (ablation)R²-Guard knowledge-weight learning · ToxicChat and BeaverTailsAUPRCNo clear effect
sequentially add category-specific models and reasoning rules for hate, sexual, harassment, and violence (ablation)R²-Guard · Unseen safety categoriesAUPRCHelped

Surprising findings

Limitations

Experimental setup

Datasets: OpenAI Mod ToxicChat XSTest Overkill BeaverTails AdvBench

Benchmarks: OpenAI Mod ToxicChat XSTest Overkill BeaverTails TwinSafety AdvBench

Metrics: AUPRC unsafety detection rate runtime per instance

Baselines: Detoxify Perspective Azure OpenAI Mod LlamaGuard ToxicChat-T5 CoT Ensemble

Builds on: Markov logic networks probabilistic circuits LlamaGuard ToxicChat-T5

Closest papers by meaning

Writing a paper in this area? scime draft is a free LaTeX editor with AI included, real-time co-authors and a check of your references and venue rules before you submit. It also imports OpenAI Prism projects.

Open scime draft

Get the next scime Dispatch and a monthly field update

Free. We send a confirmation link first; every email has a one-click unsubscribe. Privacy