Detection Is Not Early Warning: Evaluating Token-Level Alarms on Language Model Failures

Marco De Negri, Luca Sartori, Lorenzo Baggi, Moritz Reihs, Eduard Frank Ďurech, Mennatallah El-Assady, Valentina Pyatkin, Anna HedströmarXiv 2026 · arXiv

TL;DR

Standard metrics for evaluating language model (LM) monitors, like AUROC, are "timing-blind"—they reward detecting a failure after it has happened just as much as warning before it starts. This paper introduces PREWARN, a new evaluation protocol that specifically measures a monitor's ability to provide early warnings, and demonstrates that linear probes on model activations can predict repetitive degeneration hundreds of tokens before it becomes visible in the text.

What Problem Does This Paper Address?

As Large Language Models (LLMs) generate text, they can fail in various ways: they might hallucinate, output harmful content, or fall into infinite repetition loops. Most of these failures have a clear onset—a specific token where things start to go wrong.

To build safer systems, we need "monitors" that can flag these failures in real-time. However, the current standard for evaluating these monitors is response-level metrics like AUROC or F1-score. These metrics only care if a monitor eventually flags a bad response. For a developer, this is insufficient. If a monitor fires only after the model has already generated a screen full of gibberish, it's too late to intervene. We need early warning to stop, steer, or resample the generation before the failure manifests.

Methods

The authors propose PREWARN (pre-onset warning evaluation), a three-step protocol designed to evaluate token-level alarms:

  1. Calibrate: Set the monitor's threshold on a validation set to meet a specific "error budget" (e.g., a 5% false alarm rate). This ensures the monitor is evaluated under realistic deployment conditions.
  2. Run: Execute the monitor on a test set.
  3. Score: Evaluate alarms against the annotated onset across three tasks: response classification (did it fail?), failure detection (is it failing now?), and early warning (will it fail soon?).
Figure 1: Overview of PREWARN. Left: a monitor runs a scorer over the generated tokens and alarms where the score crosses τ (dots mark flagged tokens, the flag the first alarm); AUROC rates three such monitors as equal although their first alarms fall well before, just before and after the onset o(r). Right: what PREWARN needs and its three steps: calibrate the threshold on validation to the budget β, run the monitor on the test split, and score the alarms against the onset on the three tasks.

As a case study, they apply PREWARN to repetitive degeneration (repetition loops). They build monitors using linear probes—simple classifiers trained on the model's internal residual stream activations. They test both "frozen" probes (reading existing activations) and "adapted" probes (using rank-16 LoRA adapters to surface failure signals more clearly).

Datasets

The study uses three open-weights models: APERTUS-8B-INSTRUCT, LLAMA-3.1-8B-INSTRUCT, and MISTRAL-7B-INSTRUCT.

  • Prompts: 3,630 prompts from seven sources covering math, code, and medical reasoning.
  • Labels: Failures were initially identified by an LLM judge (Claude 3.5 Sonnet) and then human-verified to pinpoint the exact onset token of repetition loops.

Key Insights and Ideas

  • AUROC is deceptive for safety: A "token-cap" rule that simply fires when a response hits the maximum length limit achieves a near-perfect AUROC (0.999) because it correctly identifies every failing response. However, it provides zero early warning. PREWARN exposes this gap.
  • Failures are "visible" internally before they are "audible" in text: For models like Llama and Apertus, internal activations change significantly before the first repeated token is actually generated.
  • Model-specific "Warning Windows": Not all models signal failure the same way. While probes on Apertus and Llama provide strong early warnings, probes on Mistral act more like detectors, firing mostly after the onset.
  • The Power of Adaptation: Adding LoRA adapters doesn't necessarily increase the rate of early warnings (how many responses get a warning), but it dramatically increases the coverage (how many tokens before the onset are flagged). It effectively "stretches" the warning signal further back in time.
Figure 2: Response-level metrics rate four scorers as equal, while only the onset-aligned metrics show how differently they perform. Scorers on APERTUS at layer 15: the frozen probes with the highest and lowest validation AUROC (Section A.5), the adapted probe (hatched) and the token-cap rule, which flags only the last token of a capped response. Panels (a)–(c) group the metrics by task (Section 3); dashed lines in (c) are random alarms. (d) The frozen probe with the selected strategy across layers, with each metric’s best-to-worst ratio; lower plot on a log scale. β = 5%, human-verified in-domain test split; error bars and bands are one standard deviation over three seeds.

Key Results

  • Lead Time: On Apertus and Llama, the median first alarm occurred 137 to 232 tokens before the onset.
  • Warning Rate: Probes on these models achieved an early-warning rate above 0.5, meaning they successfully warned before the onset in more than half of the failing cases.
  • Baselines: None of the six untrained baselines (like windowed entropy or n-gram repetition rules) performed significantly better than random alarms for early warning.
  • Latent Separation: PCA analysis showed that while "healthy" and "pre-failure" activations overlap in the base model, the adapted probes successfully separate these states in the latent space, allowing for much earlier detection.
Figure 3: Probes warn before most loops on APERTUS and LLAMA but not on MISTRAL. Frozen (solid) and adapted (hatched) probe of each model at its selected layer (Table 1). (a) Post-onset and (b) warning coverage, with pre-window coverage (Pre) as a light-blue tick. (c) Early-warning rate; dashed lines are random alarms. (d) Lead, the median first alarm minus the onset in tokens; negative values are warnings. β = 5%, human-verified in-domain test split; error bars are one standard deviation over three seeds.

Limitations and Future Work

  • Onset Convention: The results are sensitive to how the "onset" is defined. The authors chose the very first token of the first loop; a more relaxed definition would make any monitor look "earlier."
  • Conservative False Alarms: The study treats any repetition that eventually terminates as "healthy," which might make the false-alarm budget overly conservative.
  • Intervention: While the paper proves we can detect failures early, it doesn't explore how to best act on those warnings (e.g., via activation steering or backtracking).
  • Generalization: The PREWARN protocol is general, but this study focused only on repetitive degeneration. Future work is needed to apply it to hallucinations and harmful content.

Summary updated

Abstract

Many failures of language models begin at a specific token, the onset. A monitor that reads the model during generation can classify the finished response, detect the failure once it is under way, or warn before it begins, and only a warning leaves time to stop or steer the generation. Monitors are usually evaluated with response-level metrics such as AUROC, which ignore when the monitor fires. We introduce PREWARN, an evaluation protocol for any failure with an annotated onset. It calibrates each monitor's threshold on validation data to an error rate chosen for the application, runs the monitor, and scores its alarms relative to the onset on all three tasks. As a case study we apply it to repetitive degeneration in three open language models, with early warning as the main task, using linear probes on activations and six untrained baselines. Response-level metrics saturate on this failure, and a rule that reads only the response length scores almost perfectly, while probes that AUROC ranks as equal warn very differently under PREWARN. Probes warn before the onset on most degenerate responses of two of the three models, low-rank adapters below the probe more than double the share of tokens just before the onset that it flags, largely by flagging degenerate responses long before the onset, and no untrained baseline warns much more often than random alarms. We release the probes with calibrated thresholds at https://huggingface.co/collections/marcodene/prewarn-degeneration-probes
BibTeX
@misc{negri2026detection,
  author = {Marco De Negri and Luca Sartori and Lorenzo Baggi and Moritz Reihs and Eduard Frank Ďurech and Mennatallah El-Assady and Valentina Pyatkin and Anna Hedström},
  title = {{Detection Is Not Early Warning: Evaluating Token-Level Alarms on Language Model Failures}},
  year = {2026},
  eprint = {2611.16803},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2611.16803},
}
Figure