跳转至

基于隐式推理的强大且高效的安全护栏

文章背景与核心概要

在大规模生产环境中维护大语言模型(LLM)的安全性,通常面临着效率与鲁棒性之间的艰难权衡:快速的单遍分类器(single-pass classifiers)虽然高效但缺乏鲁棒性,而多步推理安全护栏虽然具备极高的鲁棒性,却会带来严重的查询延迟和巨大的 Token 开销。

为了突破这一局限,本文作者推出了 COLAGUARD。这是一种全新的安全护栏模型,它通过分阶段的训练课程(stage-wise training curriculum),将多步安全推理过程迁移到了连续的隐空间(continuous latent space)中。通过在推理阶段实现直接的隐藏状态传播(hidden-state propagation),COLAGUARD 兼顾了高效性与高准确率,在宏平均 F1 分数(macro-F1)上比 Llama Guard 3 提升了 8.24 个点,匹配了显式推理基线(GuardReasoner)的推理性能,同时实现了 12.9 倍的加速和 22.4 倍的 Token 消耗缩减。


📌 摘要 / Summary

维护大语言模型(LLM)的安全性至关重要,因为它们正越来越多地被部署到现实世界的应用中。现有的安全护栏通常依赖于单遍分类,或是最近兴起的蒸馏推理。基于推理的安全护栏在性能上远超纯分类基线,但它们会产生大量的查询延迟和 Token 开销,导致其无法在高吞吐量的场景中实际部署。为了应对这一挑战,我们提出了 COLAGUARD,这是一种通过分阶段训练课程将多步安全推理迁移到连续隐空间中的安全护栏模型,从而在推理时实现直接的隐藏状态传播。在横跨八个安全基准的十个提示词和响应审核设置下进行评估,COLAGUARD 的 macro-F1 比 Llama Guard 3 提高了 8.24 个点,并且在 macro-F1 上与我们的显式推理基线 GuardReasoner 持平,同时实现了 12.9 倍的加速和 22.4 倍的 Token 使用量缩减。我们的结果表明,对于可部署的安全护栏而言,隐式推理提供了一种替代显式理由生成的实用方案,能够同时提升安全性鲁棒性与推理效率,而不再将它们视为互斥的竞争目标。

Maintaining the safety of large language models (LLMs) is crucial as they are increasingly deployed in real-world applications. Existing safety guardrails typically rely on single-pass classification or, more recently, distilled reasoning. Reasoning-based guardrails significantly outperform classification-only baselines, but they incur substantial query latency and token overhead that make them impractical for highthroughput deployment. To address this challenge, we propose COLAGUARD, a guardrail model that transfers multi-step safety reasoning into a continuous latent space through a stage-wise training curriculum, enabling direct hidden-state propagation at inference. Evaluated on ten prompt- and response-moderation settings spanning eight safety benchmarks, COLAGUARD improves macro-F1 by 8.24 points over Llama Guard 3 and matches our explicit reasoning baseline, GuardReasoner, in macroF1 while delivering a 12.9X speedup and 22.4X reduction in token usage. Our results suggest that latent reasoning offers a practical alternative to explicit rationale generation for deployable guardrails, jointly improving safety robustness and inference efficiency rather than treating them as competing objectives.


📑 附加元数据 / Additional Metadata

  • 提交历史:
  • [v1] 2026年5月27日,周三
  • [v2] 2026年9月3日,周四 (当前版本)
  • 其他学科分类: 计算与语言 (cs.CL)、密码学与安全 (cs.CR)、机器学习 (cs.LG)
  • 全文与资源:
  • 查看 PDF
  • TeX 源码
  • HTML 版本(实验性)
  • Submission History:
  • [v1] Wed, 27 May 2026
  • [v2] Thu, 3 Sep 2026 (Current Version)
  • Other Subject Classifications: Computation and Language (cs.CL), Cryptography and Security (cs.CR), Machine Learning (cs.LG)
  • Full-Text & Resources:
  • View PDF
  • TeX Source
  • HTML Version (Experimental)