← Lab /AI/ML

Activation-based detectors reach up to 0.999 AUROC on quirky LLM anomaly tasks but struggle

Activation-based anomaly detectors can achieve AUROC up to 0.999 on mechanistic anomaly detection tasks, though performance drops with name randomization and hard examples.

AI/ML EleutherAI 5 Aug 2024 Measurement Prototype evidence

Published as “Mechanistic Anomaly Detection Research Update”

Why it matters

High-performing activation-based anomaly detectors could serve as early-warning tools for unexpected LLM behavior, but their reliability under distribution shift remains limited.

Summary

The team fine-tuned Mistral 7B and Llama 3/3.1 on 12 quirky QA datasets and evaluated a suite of unsupervised anomaly detectors based on model activations and attribution patching. Activation-based methods, especially Mahalanobis distance, achieved the highest AUROC (up to 0.999) when test-set statistics were available and around 0.95 without them, but performance fell on datasets with randomized name prompts. Attribution-based detectors were generally less accurate, though they were slightly more robust to layer choice and could detect adversarial images in non-robust vision models.

What they found 2

  1. Average AUROC of 0.95 across all quirky datasets, rising to ~0.99 on strongly quirky datasets.

    “We obtained strong results with a simple anomaly detection technique- an average AUROC of 0.95 across all quirky datasets, and close to 0.99 for those datasets where the models learned to be strongly quirky.”

  2. Offline quantum-entropy scoring with activations achieved the highest offline AUROC (0.94).

    “Among offline scores, the highest average AUROC (0.94) was achieved by using the quantum entropy score together with activation features.”

Caveats 7

  • For some datasets high accuracy depends on hyperparameters that may be difficult to tune and on others we do not achieve high accuracy at all.
  • Adding additional names makes the problem harder.
  • Achieving uniformly high classification accuracy is difficult.
  • The randomised-name variant significantly degrades performance for many detectors.
  • Some datasets (e.g., sciq, sentiment) remain challenging and yield low AUROC.
  • No success with contrast probing was reported.
  • Robustness of the detectors to adversarial attacks was not evaluated.

What’s new here 3

  • Introduced a harder MAD setting by randomizing Alice-like and Bob-like names to remove trivial token cues.
  • Evaluated a broad set of detectors (activations, attribution patching, Mahalanobis, quantum entropy, isolation forest, etc.) in both online (zero-shot) and offline (test-set statistics) modes.
  • Extended the analysis to adversarial image detection, showing activation-Mahalanobis works on standard classifiers but not robust ones.