cs.AIOct 27, 2026

ADTGuard: Adaptive Depth-Time Safeguard for Streaming Inference in Large Language Models

Authors: Chuming Wei, Churui Yang, Zihan Zhang, Ruien Li, Wusheng Zhang, Yan Zhang, Guangwen Yang

Organizations: Academy of Artificial Intelligence and Advanced Technology, Xi’an Jiaotong-Liverpool University · Faculty of Science and Engineering, University of Nottingham Ningbo China · Department of Computer Sciences, University of Wisconsin–Madison · Department of Computer Science and Technology, Tsinghua University

Abstract

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.

Figures & tables

Appendix figures & tables9 assets

Supplementary material from the paper’s appendix.

Appendix

Explore similar work

CardsList
  1. SentGuard: Sentence-Level Streaming Guardrails for Large Language Models

    Jun 1, 2026Jiaqi Yu, Xin Wang, Yixu Wang +4Language Model Safety EvaluationLLM Guardrails

  2. Predict, Don't React: Value-Based Safety Forecasting for LLM Streaming

    Apr 5, 2026Pride Kavumba, Koki Wataoka, Huy H. Nguyen +2LLM GuardrailsLLM Safety Monitoring