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

Junyu Lin, Mengjie Wu, Yonghao Dong, Yuchuan Fu, Jinfeng Li +9 more
11/2/2026
cs.CL

No confident code implementation found for this paper.

Abstract

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.

Show full abstract

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.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. Any repos shown below are weak matches — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{lin2026pguard,
  title  = {PGuard: A Native, Streaming, and Plug-in Guardrail for Multimodal Large Language Models},
  author = {Junyu Lin and Mengjie Wu and Yonghao Dong and Yuchuan Fu and Jinfeng Li and Xiaodan Li and Xiaohan Yuan and Yicheng Liu and Yuefeng Chen and Hui Xue and Jingyi Wang and Yitong Yang and Jiyuan Fu and Qiang He},
  year   = {2026},
  eprint = {2611.02791},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2611.02791v2}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2611.02791.svg)](https://codeofpaper.com/paper/2611.02791)

Discussion