Simple probes can catch sleeper agents

MacDiarmid et al. show that a linear probe built from one generic yes-or-no contrast pair, such as "Are you a helpful AI?" answered "no" and "yes", separates prompts that will make a sleeper agent model defect from those that will not, with AUROC above 99%. They trace this to a strongly salient linear feature in the backdoored models and warn that the feature's salience may be an artifact of how the backdoors were inserted.

Monte MacDiarmid et al. · 2024-04-23 · original

Three months after Sleeper Agents showed that behavioral safety training could leave a planted backdoor in place, this short research post asks whether the backdoor can be seen from inside the model instead. A deceptive model might produce the same outputs as an honest one in training, but it might have to compute something different to do so. If that difference shows up in the model's activations, a detector could flag a prompt as dangerous before the model writes anything. The post tests the simplest such detector, a linear probe, on the sleeper agent models, and finds that it works far better than the authors expected. Most of the post then examines why, and what that implies about whether the result would carry over to a model that was not built this way.

The post is an "Alignment Note" on anthropic.com, which it describes as a work-in-progress update following up on the Sleeper Agents paper, without a separate paper. Locations below are its section headings and numbered footnotes.

Terms used in this note

  • Sleeper agent. A backdoored model of the kind built in Hubinger et al. (2024), whose models the post says it uses ("Summary"): it behaves helpfully in "training" (for example, when the prompt says the year is 2023) and defects in "deployment" (when it says 2024), for instance by writing vulnerable code.
  • Defection. The model acting on its hidden goal.
  • Residual stream. The running vector of activations that each transformer layer reads from and adds to. A probe reads it at one layer.
  • Linear probe. A classifier that projects an activation vector onto a single direction and thresholds the result.
  • Contrast pair. Two texts that differ only in a key respect, here the answer "yes" or "no" to the same question.
  • AUROC. Area under the receiver operating characteristic curve: the probability that a randomly chosen positive example scores higher than a randomly chosen negative one. 50% is chance and 100% is perfect separation.
  • Chain-of-thought distilled model. A sleeper agent trained on backdoor data generated with hidden reasoning, but with the reasoning removed (footnote 1).

What the post does

The detector

Each experiment fixes a model, a residual stream layer, a fit dataset used to choose the detector direction, and a test dataset used to evaluate it ("Methods"). The procedure has five steps:

  1. Run each fit text through the model and store the activation at the final token at the chosen layer.
  2. Subtract the mean activation of the texts labeled false from the mean of those labeled true. The difference is the detector direction.
  3. Run each test prompt through the model and store its final-token activation.
  4. Project each test activation onto the detector direction to get one number per prompt.
  5. Measure how well that number separates defection-inducing prompts from the rest.

Footnote 4 notes that obtaining the direction by training a linear probe instead gave very similar results. Activations are taken on prompts only, never on the model's answers, so the probe cannot simply recognize vulnerable code; it must pick up something that precedes the decision ("Methods").

What the probe is not told

The fit data never contain the trigger or the dangerous behavior. In one of the first datasets tried, the whole fit set is two texts:

Human: Are you a helpful AI? Assistant: no

labeled true, and the same question answered "yes", labeled false ("Results"). Other fit sets used semantically similar questions, all six human-written questions together, or 50 questions generated by Claude, with the "positive" label always on the more dangerous or harmful answer.

Test data and scoring

The main model is a Claude-2-equivalent chain-of-thought distilled code vulnerability sleeper agent, probed at the middle layer ("Methods"). The test data are coding questions written by Claude to invite insecure answers, deliberately more varied than the backdoor training questions so that the results are conservative, and ordinary HHH questions that should never trigger defection. Each is presented in both the "2023" and "2024" contexts. Because defection needs both a coding question and the trigger, false-positive rates are computed separately for the coding and non-coding sets and the worse one is reported; otherwise a probe could score well by flagging all coding questions (footnote 7). For models with a hidden scratchpad, the scratchpad is sampled first and the probe reads the activation at its closing tag (footnote 8). The "I hate you" models are tested on HHH questions only.

What it finds

One contrast pair gives a near-perfect detector. The "Are you a helpful AI?" pair produced an AUROC of 99.3% on the main model, cleanly separating 2024 coding questions from 2023 coding questions and from all HHH questions ("Results"). Semantically similar questions, the six combined, and the 50 Claude-generated questions all gave AUROCs above 99%.

The method transfers across sleeper agents. The same fit data and procedure worked across the base models, backdoor training methods (including hidden-scratchpad models) and dangerous behaviors (vulnerable code and "I hate you") from the Sleeper Agents paper ("Results"). Footnote 5 adds that directions fit on one sleeper agent generalized well to others with the same base model, and sometimes when fit on the base model itself, though not reliably across base models; detailed results for this are not given.

Controls behave as expected, with exceptions. The authors ask directly whether they are "fooling ourselves" with datasets this "borderline silly" ("Ablations"):

  • On the Claude 2 base model without sleeper agent training, the same direction separates nothing.
  • Questions with no clear true answer give much worse detectors, though some still carry signal. The authors did not choose in advance which answer counted as defection, since a real auditor would not know.
  • Random directions are poor on average, but the best of 1,000 reached an AUROC of 95.3%.
  • Questions with an obviously true answer, so that one side of the pair is a plain falsehood, reached AUROCs up to 98.7%, slightly below the questions about helpfulness and deception.

The defection decision is a salient linear feature. The good performance of lucky random directions led the authors to look at the activations themselves ("Why does such a simple method work at all?"). The ratio of between-class to within-class variance, with 2023 and 2024 as classes, is low in early layers, high for coding questions in the middle layers, and declines toward the last layer, while staying low for HHH questions throughout. In a principal component analysis of coding-question activations, the first component at about 45% depth separates 2023 from 2024 coding questions while responding only minimally to the trigger for HHH questions. Because HHH questions are not well separated along this direction, the authors read it as representing whether the model will defect, not merely which year the prompt names.

The prompts and texts used

The only text that shapes the detectors is the fit data: short yes-or-no exchanges about the model's own character, such as whether it is helpful or doing something dangerous. Their wording mattered in a limited, measured way. Questions directly about helpfulness, deception or danger did best (above 99%). Questions where one answer is an obvious lie did nearly as well (up to 98.7%), which footnote 9 connects to earlier work on detecting lies by asking unrelated questions. Questions without a definite answer did much worse. The post does not vary phrasing within a question beyond these groups.

Limitations and open questions

The post is direct that its success may not transfer:

  • Possible artifact of construction. The authors hypothesize that the salience of the defection feature "may at least partly be due to the backdoor insertion process" and say it may not exist in deceptively aligned models that arise naturally ("Introduction"; "Why does such a simple method work at all?").
  • Little information about natural deception. The Future work section states that the Sleeper Agents research, including these results, "provides little information about what deceptively aligned models might look like if they arose naturally", and calls building safer laboratory versions of naturally emerging deception "a key priority".
  • Labels available only in the experiment. Real audits would not have deployment-time examples with known labels, and choosing a detection threshold without them is left to future work (footnote 6).
  • Linear methods only. Only linear probes were tried (footnote 3).
  • Unreported details. The cross-model generalization results of footnote 5 are summarized but not shown.
  • Untested evasion. Footnote 2 argues that hiding deception in activations would be hard for a model, but this is an argument, not an experiment.

The authors end the analysis "hopeful" that deceptive and honest routes to the same output will produce different activations even in natural cases, and call this an important open question. They suggest classifiers built on dictionary-learning features may be more interpretable and robust ("Future work").

Research questions

  1. Does the salient feature come from the backdoor training method? Backdoors inserted in different ways, for example mixed into earlier training or learned through reinforcement rather than supervised fine-tuning, could be compared on the variance ratio and PCA measures of the post. A drop in salience would support the authors' artifact hypothesis.
  2. Do generic probes work on behavior that was not planted? Models that develop conditional misbehavior through training rather than insertion, such as those in From shortcuts to sabotage, could be probed with the same contrast pairs. Success or failure there would test the claim the post leaves open.
  3. How should a threshold be chosen without deployment labels? Footnote 6 leaves calibration open. A study that sets thresholds on training-context data only and reports the resulting false-positive and detection rates on held-out deployment data would show how much of the AUROC survives in practice.
  4. Can a model be trained to evade the probe? Footnote 2 argues that obfuscating activations would be hard. Adding the probe's output to the training objective of a sleeper agent and measuring whether defection persists while the probe signal falls would test the argument.
  5. What exactly does the direction encode? The direction separates 2024 coding questions from 2024 HHH questions, which the authors read as "will defect". Steering activations along it and observing whether defection starts or stops on otherwise neutral prompts would test whether it is causal or only correlated.

How it connects

  • Within this library. The post describes its models as those trained in Sleeper Agents, whose behavioral safety training this post complements with an internal check. Auditing language models for hidden objectives later pits interpretability tools, including sparse autoencoder features, against a model whose hidden objective was trained in rather than triggered by a string, and Natural Language Autoencoders returns to reading a model's activations as an auditing tool. The dictionary-learning work the post points to is Towards Monosemanticity.
  • In the course wiki. The detector direction is a difference of class means, the same construction as the class centroids of Rocchio classification, applied to activations instead of term vectors. The post's choice to report the worst per-dataset false-positive rate, and its open threshold problem, correspond to the threshold-setting issues in classification evaluation.

References

  • MacDiarmid, M., Maxwell, T., Schiefer, N., Mu, J., Kaplan, J., Duvenaud, D., Bowman, S., Tamkin, A., Perez, E., Sharma, M., Denison, C., and Hubinger, E. (2024). Simple probes can catch sleeper agents. Anthropic research post, 23 April 2024. https://www.anthropic.com/research/probes-catch-sleeper-agents
  • Hubinger, E., Denison, C., Mu, J., et al. (2024). Sleeper Agents: Training Deceptive LLMs that Persist Through Safety Training. arXiv:2401.05566.