ADTGuard: Adaptive Depth-Time Safeguard for Streaming Inference in Large Language Models
作者: Chuming Wei, Churui Yang, Zihan Zhang, Ruien Li, Wusheng Zhang, Yan Zhang, Guangwen Yang
分类: cs.AI
发布日期: 2026-10-27
💡 一句话要点
提出ADTGuard以解决大语言模型流媒体推理中的安全问题
🎯 匹配领域: 支柱九:具身大模型 (Embodied Foundation Models)
关键词: 大语言模型 流媒体推理 安全检测 深度学习 风险管理 动态调整 内容审核
📋 核心要点
- 现有的安全措施在流媒体推理中存在延迟干预和粗略监督的问题,无法及时识别有害内容。
- ADTGuard通过在每个令牌发布前进行检查,并逐步细化训练目标,解决了现有方法的不足。
- 实验结果表明,ADTGuard在多个安全基准上表现优异,超越了现有的最先进技术,同时保持较低的参数量和延迟。
📝 摘要(中文)
大语言模型(LLMs)能够流畅地响应多样化的用户请求,但在流媒体过程中,用户可能在生成完成之前接触到有害内容。现有的安全措施存在两个主要局限:一是后期审核在响应或块边界处进行,延迟干预,增加了有害内容暴露的风险;二是即使在令牌级别检测中,粗略的响应级别监督也无法明确有害内容的开始时间,同时固定层的读取可能会错过其他深度的相关安全信号。为了解决这些问题,本文提出了ADTGuard,它在每个令牌发布前进行检查,逐步细化令牌级训练目标,并根据当前前缀自适应选择层。ADTGuard通过深度-时间安全动态(DTSD)建模风险,整合每个令牌的安全证据,并指导后续令牌的风险累积。通过广泛的实验,ADTGuard在多个安全基准上表现出色,匹配或超越了现有的安全措施,同时仅需16M可训练参数,并保持竞争性的每令牌延迟。
🔬 方法详解
问题定义:本文旨在解决大语言模型在流媒体推理中可能导致的有害内容暴露问题。现有方法在内容生成后进行审核,存在延迟和不准确的问题,无法及时识别和处理有害内容。
核心思路:ADTGuard的核心思想是通过在每个令牌发布前进行检查,逐步细化令牌级训练目标,并根据当前前缀自适应选择观察层,从而提高安全性和响应速度。
技术框架:ADTGuard的整体架构包括深度-时间安全动态(DTSD)模块和因果深度路由器(CDR)。DTSD整合每个令牌的安全证据,指导风险累积;CDR则根据当前前缀动态选择观察层。
关键创新:ADTGuard的主要创新在于其深度-时间安全动态建模和因果深度路由器的设计,使得安全性检测能够在令牌级别进行,并适应不同的上下文,从而克服了现有方法的局限。
关键设计:在训练过程中,ADTGuard使用风险起始目标细化(RTR)技术,逐步构建令牌级训练目标。该方法仅依赖响应级标签,确保了训练的有效性和灵活性。
🖼️ 关键图片
📊 实验亮点
在广泛的实验中,ADTGuard在多个安全基准上表现出色,其流媒体检测性能与最先进的安全措施相当或更优。具体而言,ADTGuard在仅使用16M可训练参数的情况下,保持了竞争性的每令牌延迟,显示出其高效性和实用性。
🎯 应用场景
ADTGuard的研究成果在多个领域具有潜在应用价值,尤其是在需要实时内容审核的场景,如社交媒体、在线聊天和自动内容生成等。通过提高流媒体推理的安全性,ADTGuard能够有效降低用户接触有害内容的风险,提升用户体验和信任度。
📄 摘要(原文)
Large Language Models (LLMs) can generate fluent responses to diverse user requests, yet streaming may expose users to harmful content before generation is complete. Existing guardrails face two limitations in this setting. First, post-hoc moderation at response or chunk boundaries delays intervention, risking harmful exposure when content is released before verification. Second, even with token-level detection, coarse response-level supervision does not specify when harmful content begins, while fixed-layer readouts may miss relevant safety signals at other depths. To address these limitations, we introduce ADTGuard, which checks each token before release, progressively refines token-level training targets, and adapts layer selection to the current prefix. ADTGuard models risk across depth and time through Depth-Time Safety Dynamics (DTSD), which integrates safety evidence across layers at each token and uses it to guide risk accumulation over successive tokens. To adapt the choice of observation layers to the current prefix, we propose the Causal Depth Router (CDR). With only response-level labels available, we further develop Risk-Onset Target Refinement (RTR) to progressively construct token-level training targets for both components. Through extensive experiments across multiple safety benchmarks, we demonstrate that ADTGuard consistently achieves strong streaming detection performance, matching or surpassing state-of-the-art safeguards while requiring only 16M trainable parameters and maintaining competitive per-token latency.