paperbot · PL 论文追踪

全部论文 待读 收藏

P2 LLMSafeGuard: A Training-Free Framework for Safeguarding LLM Decoding via Context-Wise Similarity Validation

LLMSafeGuard:一种通过上下文相似性验证保障 LLM 解码的免训练框架
FSE Proceedings of the 34th ACM International Conference on the Foundations of Software Engineering2026匹配度 2/10 · 该论文聚焦于 LLM 解码阶段的安全防护与毒性/越狱输出过滤,研究目标本身是 LLM 的行为控制,而非静态分析、Agentic 程序分析、浮点程序分析、贝叶斯程序分析或 LLM 与形式化验证的交叉。虽然标签含“机器学习与程序语言”,但核心方法与程序语言/静态分析无关,因此与用户研究方向匹配度很低。引用 0 inbox
Ximing Dong, Shaowei Wang, Dayi Lin, Ahmed E. Hassan
crossref: 2026-09-12dblp: 2026-09-12

AI 速览

一句话:提出免训练实时解码框架,用外部验证器与上下文相似性校验拒绝 LLM 不安全输出。

LLM 易生成有害内容,现有安全方法常需训练控制模型并在生成中主动干预,造成质量下降与计算开销。LLMSafeGuard 是一个轻量实时框架,将外部验证器集成到解码过程,拒绝不安全输出并放行有效输出。它用基于相似度的验证替代外部控制模型训练,并采用上下文级时机选择,仅在必要时干预。作者在去毒、版权保护和越狱防御三类任务、六个模型上评估:去毒至少减少 38.6% 有害输出且保持语言质量;越狱防御的有害分数较最佳基线至少降低 11.4%;上下文级时机选择较逐步验证加速 1.7 倍且不损效果。

问题
LLM 易生成有害内容带来伦理和社会风险;现有安全方法需训练专用控制模型并在生成中主动干预,导致质量下降和计算开销增加。
方法
LLMSafeGuard 将外部验证器接入解码,用基于相似度的验证简化安全约束检查、免去控制模型训练,并通过上下文级时机选择策略仅在必要时干预。
评估
在去毒、版权保护和越狱攻击防御三类任务、六个模型上与 SOTA 基线比较,报告有害输出/有害分数下降、语言质量保持以及相对逐步验证的 1.7 倍加速。
原文摘要(Abstract)

Large Language Models (LLMs) have significantly advanced natural language processing (NLP) tasks, but also pose ethical and societal risks due to their propensity to generate harmful content. Existing methods have limitations, including the need for training specific control models and proactive intervention during text generation, which leads to quality degradation and increased computational overhead. To mitigate those limitations, we propose LLMSafeGuard, a lightweight real-time framework that integrates an external validator into decoding, rejecting unsafe outputs while allowing valid ones. We introduce a similarity-based validation approach, simplifying safety constraint validation and eliminating the need for external control model training. Additionally, LLMSafeGuard employs a context-wise timing selection strategy, which allows LLMSafeGuard to intervene in LLMs only when necessary. We evaluate LLMSafeGuard on three tasks: detoxification, copyright safeguarding, and jailbreak attack defending across six models, and the results demonstrate its superiority over SOTA baselines on all tasks. For instance, in detoxification, LLMSafeGuard reduces toxic output by at least 38.6% while preserving linguistic quality. For Jailbreak attack defending, LLMSafeGuard reduces the harmful score of the response LLMs under jailbreak attack at least by 11.4% compared to the best baseline. Additionally, its context-wise timing selection achieves a speedup of 1.7X over per-step validation, without compromising effectiveness.

链接与引用

DOI 原文 · PDF(开放获取) · DBLP

BibTeX
@inproceedings{DongWLH26,
  title = {LLMSafeGuard: A Training-Free Framework for Safeguarding LLM Decoding via Context-Wise Similarity Validation},
  author = {Ximing Dong and Shaowei Wang and Dayi Lin and Ahmed E. Hassan},
  booktitle = {FSE},
  year = {2026},
  doi = {10.1145/3803437.3806718}
}