A Lightweight Explainable Guardrail for Prompt Safety
Md. Asiful Islam, Mihai Surdeanu
Abstract
We propose a lightweight explainable guardrail (LEG) method to detect unsafe prompts. LEG uses a multi-task learning architecture to jointly learn a prompt classifier and an explanation classifier, where the latter labels prompt words that explain the safe/unsafe overall decision. LEG is trained on synthetic explanation data, which is generated using a novel strategy that counteracts the confirmation biases of LLMs. Lastly, LEG's training process uses a novel loss that captures global explanation signals as a weak supervision and combines crossentropy and focal losses with uncertainty-based weighting. LEG obtains equivalent or better performance than the state-of-the-art for both prompt classification and explainability, both in-domain and out-of-domain on three datasets, despite the fact that its model size is considerably smaller than current approaches. Code 1 Models and Datasets 2
Ask Lune
Know this paper in minutes, not an afternoon.
Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.
Lineage
- Bootstrapping Language Models with DPO Implicit Rewards cites Direct Preference Optimization: Your Language Model is Secretly a Reward Model
- A Causal Explainable Guardrails for Large Language Models cites Direct Preference Optimization: Your Language Model is Secretly a Reward Model
Builds on8
- Direct Preference Optimization: Your Language Model is Secretly a Reward ModelRafael Rafailov, Archit Sharma, Eric Mitchell, Christopher D. Manning et al.NeurIPS 2023 · 10,924 citations
- ToxicChat: Unveiling Hidden Challenges of Toxicity Detection in Real-World User-AI ConversationZi Lin, Zihan Wang, Yongqi Tong, Yangkun Wang et al.EMNLP Findings 2023 · 44 citations
- ShieldLM: Empowering LLMs as Aligned, Customizable and Explainable Safety DetectorsZhexin Zhang, Yida Lu, Jingyuan Ma, Di Zhang et al.EMNLP Findings 2024 · 14 citations
- A Causal Explainable Guardrails for Large Language ModelsZhixuan Chu, Yan Wang, Longfei Li, Zhibo Wang et al.CCS 2024 · 5 citations
- Bootstrapping Language Models with DPO Implicit RewardsChangyu Chen, Zichen Liu, Chao Du, Tianyu Pang et al.ICLR 2025
Related papers
- LS-Guard: Adaptive Safety Guardrails Tailored to Individual LLMsJinggui Liang, Lizi LiaoACL Findings 2026
- MrGuard: A Multilingual Reasoning Guardrail for Universal LLM SafetyYahan Yang, Soham Dan, Shuo Li, Dan Roth et al.EMNLP 2025
- ExpGuard: LLM Content Moderation in Specialized DomainsMinseok Choi, Dongjin Kim, Seungbin Yang, Subin Kim et al.ICLR 2026 · 3 citations
- Harnessing Hyperbolic Geometry for Harmful Prompt Detection and SanitizationIgor Maljkovic, Maria Rosaria Briglia, Iacopo Masi, Antonio Emanuele Cinà et al.ICLR 2026 · 2 citations
- Proxy Barrier: A Hidden Repeater Layer Defense Against System Prompt Leakage and JailbreakingPedro Schindler Freire Brasil Ribeiro, Iago Alves Brito, Rafael Teixeira Sousa, Fernanda Bufon Färber et al.EMNLP Findings 2025
