arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2411.12946cs.CLcs.LG
收藏

一种灵活的、应用于离题提示检测的大语言模型护栏开发方法

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

Government Technology Agency(政府技术局);National University of Singapore(新加坡国立大学)

Gabriel Chua, Shing Yee Chan, Shaun Khoo

AI总结:

本文提出一种无需真实数据的灵活护栏开发方法,通过大语言模型生成多样化提示构建合成数据集,训练离题提示检测模型,并开源数据集与模型以支持预生产环境下的LLM安全研究。

摘要:

大语言模型(LLMs)容易出现离题滥用问题,即用户可能诱导这些模型执行超出其预期范围的任务。当前的护栏通常依赖精心整理的示例或定制分类器,存在误报率高、适应性有限,以及在预生产阶段无法获得真实世界数据而导致方法不切实际等缺陷。本文提出了一种灵活、无需真实数据的护栏开发方法,以应对这些挑战。我们首先对问题空间进行定性、全面的定义,并将其传递给大语言模型以生成多样化的提示,从而构建一个合成数据集,用于基准测试和训练离题护栏,其性能优于启发式方法。此外,通过将该任务形式化为判断用户提示是否与系统提示相关,我们的护栏能够有效泛化到其他滥用类别,包括越狱提示和有害提示。最后,我们通过开源合成数据集和离题护栏模型进一步为该领域做出贡献,为在预生产环境中开发护栏以及支持未来大语言模型安全性的研究与发展提供了宝贵资源。

英文摘要:

Large Language Models (LLMs) are prone to off-topic misuse, where users may prompt these models to perform tasks beyond their intended 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 is not 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. Additionally, 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.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑