NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Online Safety Monitoring for LLMs

Mona Schirmer, Metod Jazbec, Alexander Timans, Christian A. Naesseth, Maja Waldron, Eric Nalisnick

TL;DR

This paper introduces a simple yet effective method for monitoring Large Language Models (LLMs) in real-time to detect unsafe outputs. By calibrating a single threshold on a safety signal, their approach achieves performance comparable to more complex methods, offering crucial guarantees on preventing harmful generations as LLMs are deployed.

What Problem Does This Paper Address?

Large Language Models (LLMs) are increasingly integrated into our daily lives, powering everything from search engines to coding assistants. Despite extensive training to align them with human values and safety guidelines, LLMs can still produce undesirable outputs, such as factual inaccuracies, toxic content, or malicious responses. While offline evaluations are standard, they cannot cover every possible scenario. Therefore, monitoring LLMs during their operation (online) and intervening when safety is compromised is critical. The challenge lies in the real-time nature of this monitoring and the lack of perfect safety labels. Existing methods often involve complex sequential hypothesis testing, and this paper aims to simplify this process while maintaining strong safety guarantees.

Methods

The core of this paper's contribution is a simple statistical framework for online LLM safety monitoring based on risk control. The proposed monitor works by:

  • Leveraging a Safety Signal: It uses a signal ($s_t$) that provides an imperfect indication of the LLM's output safety at each step ($t$) of generation. This signal can come from an external verifier model (like a safety classifier) or even internal LLM metrics.
  • Thresholding: A single, time-invariant threshold ($\lambda$) is applied to this signal. If the signal drops below $\lambda$, an alarm is raised, indicating a potential safety violation.
  • Risk Calibration: The crucial innovation is how the threshold $\lambda$ is determined. The authors use statistical methods (Conformal Risk Control - CRC, and Upper Confidence Bound - UCB) to calibrate $\lambda$ using a labeled calibration dataset. This calibration ensures that the monitor's risks – specifically, the false alarm rate (flagging safe outputs as unsafe) and the missed detection risk (failing to flag unsafe outputs) – are controlled within a user-specified tolerance ($\epsilon$) either in expectation or with high probability.

This approach is significantly simpler than sequential hypothesis testing methods, as it avoids the need for multiple density estimators or complex online learning.

Datasets

The paper evaluates their approach on the following datasets:

  • MATH dataset: Used for monitoring factuality in mathematical reasoning tasks.
  • Anthropic Red Teaming dataset: Used for monitoring harmlessness in multi-turn conversations.
  • FineHarm dataset: Also used for monitoring harmlessness, focusing on single-turn interactions.

Key Insights and Ideas

  • Simplicity Can Be Powerful: A straightforward thresholding mechanism, when properly calibrated with statistical guarantees, can be as effective as more complex sequential hypothesis testing methods for online LLM safety monitoring.
  • Risk Control is Key: The ability to provide formal guarantees on false alarm and missed detection rates is crucial for building trust in LLM safety systems. The proposed risk control framework offers this capability.
  • Signal Quality Matters: The performance of any monitor is fundamentally limited by the quality of the safety signal it receives. The paper highlights that a dedicated external verifier generally provides a stronger signal than internal LLM metrics like token log-probabilities.
  • Early Detection is Valuable: The proposed method often detects safety violations earlier in the generation process compared to more complex baselines, which is beneficial for limiting user exposure to harmful content and reducing computational costs.

Key Results

  • The proposed simple thresholding monitor, calibrated using CRC and UCB, demonstrates performance competitive with more advanced e-valuator methods on both factuality and harmlessness monitoring tasks.
  • In experiments on mathematical reasoning, the risk-controlling monitors (CRC and UCB) detected incorrect answers earlier than e-valuators, despite the latter being more complex.
  • For harmlessness monitoring, the effectiveness of the signal varied by dataset. The e-valuator-PAC achieved higher power on the Red Teaming dataset, while CRC and UCB performed better on FineHarm, underscoring the importance of using signals tailored to the specific use case.
  • When using internal LLM signals (token log-probabilities) instead of external verifiers, power significantly decreased, highlighting the trade-off between computational cost and monitoring effectiveness.

Limitations and Future Work

The authors acknowledge two main limitations:

  • Signal Dependency: The monitor's performance is inherently tied to the quality and limitations of the chosen safety signal (verifier). Future work could explore combining multiple signals for a more robust statistic or optimizing the cost-signal strength trade-off.
  • Ignoring Temporal Structure: The current approach uses a single, time-invariant threshold, which doesn't fully account for potential temporal dependencies in the safety signal. Future research could involve calibrating per-step thresholds using more advanced techniques like Pareto testing.

They also suggest investigating targeted safety checks upon alarm triggering and exploring more advanced methods for calibrating thresholds.

Summary updated

BibTeX
@inproceedings{schirmer2026online,
  author = {Mona Schirmer and Metod Jazbec and Alexander Timans and Christian A. Naesseth and Maja Waldron and Eric Nalisnick},
  title = {{Online Safety Monitoring for LLMs}},
  booktitle = {Hypothesis Testing @ ICML},
  year = {2026},
  url = {https://openreview.net/forum?id=lNgPP6CUj2},
}
Figure