A Flexible Large Language Models Guardrail Development Methodology Applied to Off-Topic Prompt Detection

Published: 05 Mar 2025, Last Modified: 10 Apr 2025BuildingTrustEveryoneRevisionsBibTeXCC BY 4.0
Track: Long Paper Track (up to 9 pages)
Keywords: LLM, Guardrails, Synthetic Data
TL;DR: This paper introduces a data-free methodology using LLMs to generate synthetic data for training effective and generalizable off-topic prompt detection guardrails, achieving high performance and open-sourcing resources for LLM safety
Abstract: Large Language Models (LLMs) are prone to off-topic misuse, where users may prompt these models to perform tasks beyond their in- tended scope. Current guardrails, which often rely on curated examples or custom classifiers, suffer from high false-positive rates, limited adaptability, and the impracticality of requiring real-world data that isn’t available in pre-production. In this paper, we introduce a flexible, data-free guardrail development methodology that addresses these challenges. By thoroughly defining the problem space qualitatively and passing this to an LLM to generate diverse prompts, we construct a synthetic dataset to benchmark and train off-topic guardrails that outperform heuristic approaches. Addition- ally, by framing the task as classifying whether the user prompt is relevant with respect to the system prompt, our guardrails effectively generalize to other misuse categories, including jailbreak and harmful prompts. Lastly, we further contribute to the field by open- sourcing both the synthetic dataset and the off-topic guardrail models, providing valuable resources for developing guardrails in pre-production environments and supporting future research and development in LLM safety.
Submission Number: 142
Loading