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

超越红队测试:LLM防护分类器的正式保证

Beyond Red-Teaming: Formal Guarantees of LLM Guardrail Classifiers

Delft University of Technology(代尔夫特理工大学);University of Birmingham(伯明翰大学);Zeroth Research(Zeroth研究)

Nikita Kezins, Urbas Ekka, Pascal Berrang, Luca Arnaboldi

AI总结:

本文提出通过将验证空间从离散输入空间转移到分类器预激活空间,定义有害区域为包含已知有害提示表示的凸形区域,从而为LLM防护分类器提供正式保证,揭示了不同模型在安全性和鲁棒性上的差异。

摘要:

防护分类器旨在防止生产语言模型产生有害行为,但尽管测试结果看似有希望,它们仍无法提供正式保证。为这些模型提供正式保证是困难的,因为“有害行为”在离散输入空间中没有自然的规范定义:其他领域的标准epsilon球属性不具有语义意义。我们通过将验证从离散输入空间转移到分类器的预激活空间,定义有害区域为包含已知有害提示表示的凸形区域。由于sigmoid分类头是单调的,验证最坏情况点足以验证整个区域,从而在O(d)时间内获得闭式证明。为了正式评估这些分类器,我们提出两种此类区域的构造:SVD对齐的超矩形,其产生精确的SAT/UNSAT证书,以及高斯混合模型,其产生基于语义相干聚类的概率证书。将此框架应用于三个作者训练的Guardrail分类器在毒性领域,每个超矩形配置返回SAT,揭示了所有分类器中可验证的安全漏洞,尽管其似乎具有高经验指标。概率GMM证书也揭示了这些模型在表示危害方面的结构稳定性差异。虽然GPT-2和Llama-3.1-8B在变化边界下保持鲁棒覆盖90%和80%,但BERT的安全保证证明独特地波动。这种“覆盖崩溃”在最优阈值下降至55%,揭示了BERT中稀疏分布的安全边际,仅通过采用极端保守的悲观阈值才能实现完全覆盖。这些方法结合,提供了对Guardrail分类器真正有效性的新见解,超越传统红队测试。

英文摘要:

Guardrail Classifiers defend production language models against harmful behavior, but although results seem promising in testing, they provide no formal guarantees. Providing formal guarantees for such models is hard because "harmful behavior" has no natural specification in a discrete input space: and the standard epsilon-ball properties used in other domains do not carry semantic meaning. We close this gap by shifting verification from the discrete input space to the classifier's pre-activation space, where we define a harmful region as a convex shape enclosing the representations of known harmful prompts. Because the sigmoid classification head is monotonic, certifying the worst-case point is sufficient to certify the entire region, yielding a closed-form soundness proof without approximation in O(d) time. To formally evaluate these classifiers, we propose two constructions of such regions: SVD-aligned hyper-rectangles, which yield exact SAT/UNSAT certificates, and Gaussian Mixture Models, which yield probabilistic certificates over semantically coherent clusters. Applying this framework to three author-trained Guardrail Classifiers on the toxicity domain, every hyper-rectangle configuration returns SAT, exposing verifiable safety holes across all classifiers, despite seemingly high empirical metrics. Probabilistic GMM certificates also expose a divergent structural stability in how these models represent harm. While GPT-2 and Llama-3.1-8B maintain robust coverage of 90% and 80% across varying boundaries, BERT's safety guarantees prove uniquely volatile. This 'coverage collapse' to 55% at the optimal threshold reveals a sparsely populated safety margin in BERT, which only achieves full coverage by adopting an extremely conservative pessimistic threshold. These approaches combined, provide new insights on how effective Guardrail Classifiers really are, beyond traditional red-teaming.

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

↑