From Judgment to Interference: Early Stopping LLM Harmful Outputs via Streaming Content Monitoring

Yang Li, Qiang Sheng, Yehan Yang, Xueyao Zhang, Juan Cao
6/11/2025
cs.CLcs.CY

No official code found. Best implementation: ICTMCG/SCM (12 stars, last commit 2025-11-06).

Abstract

Though safety alignment has been applied to most large language models (LLMs), LLM service providers generally deploy a subsequent moderation as the external safety guardrail in real-world products. Existing moderators mainly practice a conventional full detection, which determines the harmfulness based on the complete LLM output, causing high service latency. Recent works pay more attention to partial detection where moderators oversee the generation midway and early stop the output if harmfulness is detected, but they directly apply moderators trained with the full detection paradigm to incomplete outputs, introducing a training-inference gap that lowers the performance. In this paper, we explore how to form a data-and-model solution that natively supports partial detection. For the data, we construct FineHarm, a dataset consisting of 29K prompt-response pairs with fine-grained annotations to provide reasonable supervision for token-level training. Then, we propose the streaming content monitor, which is trained with dual supervision of response- and token-level labels and can follow the output stream of LLM to make a timely judgment of harmfulness. Experiments show that SCM gains 0.95+ in macro F1 score that is comparable to full detection, by only seeing the first 18% of tokens in responses on average. Moreover, the SCM can serve as a pseudo-harmfulness annotator for improving safety alignment and lead to a higher harmlessness score than DPO.

View on arXivView PDF

Code Implementations(1)

ICTMCG/SCMCommunity65%

Offical repository for NeurIPS 2025 paper "From Judgment to Interference: Early Stopping LLM Harmful Outputs via Streaming Content Monitoring".

120Shell, PythonAug 20, 202511 months ago
llm-guardrailsllm-safetyneurips-2025

Similar Papers

Cite this paper

@article{li2025from,
  title  = {From Judgment to Interference: Early Stopping LLM Harmful Outputs via Streaming Content Monitoring},
  author = {Yang Li and Qiang Sheng and Yehan Yang and Xueyao Zhang and Juan Cao},
  year   = {2025},
  eprint = {2506.09996},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2506.09996v3}
}

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/2506.09996.svg)](https://codeofpaper.com/paper/2506.09996)

Discussion