arXivDaily arXiv每日学术速递 周一至周五更新
感恩节,周五至周末无更新,大家顺遂。周一再来吧
arXiv 2611.02791cs.CL
收藏

PGuard:面向多模态大语言模型的原生、流式、即插即用安全护栏

PGuard: A Native, Streaming, and Plug-in Guardrail for Multimodal Large Language Models

Alibaba AAIG(阿里巴巴先进人工智能实验室)

Junyu Lin, Mengjie Wu, Yonghao Dong, Yuchuan Fu, Jinfeng Li, Xiaodan Li, Xiaohan Yuan, Yicheng Liu, Yuefeng Chen, Hui Xue, Jingyi Wang, Yitong Yang, Jiyuan Fu, Qiang He

AI总结:

针对多模态大语言模型流式生成的安全挑战,提出原生流式即插即用安全护栏PGuard,利用骨干模型中间表征检测安全风险,在30余个基准测试中性能领先,仅产生0.82-2.26%的端到端开销。

摘要:

随着流式生成为纯文本及多模态大语言模型的主流服务范式,确保生成过程全程安全已成为关键挑战。我们提出PGuard,一种原生、流式、即插即用的安全护栏,将安全监控从外部服务依赖转化为骨干模型的集成能力。PGuard直接利用骨干模型的中间表征进行token级安全检测,无需改变其原始推理路径或生成行为。具体而言,动态门控层在预填充和自回归解码阶段,选择性聚合各层的残差流表征以提取安全相关信号。为平衡检测精度与计算效率,PGuard支持多种表征建模架构,包括轻量级无状态变体,以及基于多尺度因果EMA注意力和GRU循环模块构建的序列感知变体。其设计还考虑了SGLang等LLM服务框架的执行特性,优化计算与数据访问以最小化额外运行时间和同步开销。因此,PGuard在SGLang服务的千亿参数骨干模型Qwen3.5-122B-A10B上仅产生0.82-2.26%的端到端开销。在覆盖文本与多模态安全、越狱攻击、网络与CBRN风险、多语言场景及真实流量的30余个基准测试中,PGuard在原生护栏中展现出最先进性能。在Qwen3.5-9B的文本查询上,PGuard的平均F1分数达0.836,接近专用外部护栏,同时支持部署时配置类别特定阈值与执行动作。

英文摘要:

As streaming generation becomes the dominant serving paradigm for both text-only and multimodal large language models, ensuring safety throughout the generation process has become a critical challenge. We introduce PGuard, a native, streaming, and plug-in guardrail that transforms safety monitoring from an external serving dependency into an integrated capability of the backbone model. PGuard directly leverages the backbone's intermediate representations for token-level safety detection, without altering its original inference pathway or generation behavior. Specifically, dynamic layer gating selectively aggregates residual-stream representations across layers to extract safety-relevant signals during both prefill and autoregressive decoding. To balance detection accuracy and computational efficiency, PGuard supports multiple representation-modeling architectures, including a lightweight stateless variant and sequence-aware variants built on multi-scale causal EMA-attention and GRU-based recurrent modules. Its design also accounts for the execution characteristics of LLM serving frameworks, such as SGLang, optimizing computation and data access to minimize additional runtime and synchronization overhead. As a result, PGuard incurs only 0.82-2.26% end-to-end overhead on the hundred-billion-parameter backbone Qwen3.5-122B-A10B served by SGLang. Extensive evaluations across more than 30 benchmarks spanning text and multimodal safety, jailbreaks, cyber and CBRN risks, multilingual scenarios, and real-world traffic demonstrate state-of-the-art performance among native guardrails. On text queries with Qwen3.5-9B, PGuard achieves an average F1 score of 0.836, approaching dedicated external guardrails, while supporting deployment-time configuration of category-specific thresholds and enforcement actions.

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

↑