Skip to content

Did you notice the drift? Catching LLM task drift with activation differencesGet my drift? Catching LLM Task Drift with Activation Deltas

arXiv· arXiv:2406.00799· SaTML 2025· Sahar Abdelnabi, Aideen Fay, Giovanni Cherubin, Ahmed Salem, Mario Fritz, Andrew PaverdMicrosoft; CISPA Helmholtz Center for Information SecurityIndexed by this site · 26 days ago· Originally publishedSelected DefensesSelectedAttention38

Translation in progress — untranslated text is omitted.

Quick read

Defenses

Based on the paper PDF (AI-generated); refer to the original

AI summaryThe researchers propose using activation differences to detect LLM task drift in order to counter prompt injection; the linear probe achieves ROC AUC above 0.99 on out-of-distribution test sets across six models. Task drift refers to the phenomenon in which a model deviates from the user's original task because of instructions embedded in external data; the method compares the model's activations before and after processing external data, using a linear classifier or metric-learning probe to distinguish clean from injected data chunks. On Phi-3 3.8B/14B, Mistral 7B, Llama-3 8B/70B, and Mixtral 8x7B, the probe detects them zero-shot even though it was not trained on jailbreaks or malicious instructions. The defense requires no model fine-tuning and does not depend on model outputs, and it outperforms the Prompt Guard and Prompt Shields classifiers on the test sets constructed by the authors. The authors released the TaskTracker toolkit, including a dataset of more than 500,000 instances, activation representations for six models, and inspection tools.

Questions
External data processed by retrieval-augmented LLM applications may contain injected instructions that cause the model to deviate from the user's original task (defined by the authors as task drift), which can be used for data exfiltration or output manipulation; existing defenses mostly require modifying the model or rely on prompts.
Methods
The authors propose TaskTracker: use a task-elicitation template to take the activations of the input's last token at each layer, compute the activation deltas before and after processing external data, and then train either a logistic regression linear probe or a triplet-loss-based metric-learning embedding model to distinguish clean from poisoned samples.
Experiments and results
On 6 open-source models, the ROC AUC of the linear probe on the OOD test set (including jailbreaks, malicious instructions, and unseen task domains) mostly exceeded 0.99; on the self-built test set, TaskTracker (Phi-3 14B) scored 0.996, higher than Prompt Guard's 0.974 and Prompt Shields' 0.988 (Table X).
Limitations and future work
The authors note: the mechanism of activation capture is not yet clear; transfer of the probe across different fine-tuned versions of models was not evaluated; adaptive attacks were only preliminarily tested with two kinds, and the authors are holding a public competition to solicit attacks (Discussion section). Experiments cover only 6 open-source instruction-tuned models, and no statistical significance tests are reported.
Why it was selectedThe paper proposes using activation differences to detect task drift induced by prompt injection; it can be deployed without fine-tuning the model and generalizes zero-shot to unseen attacks such as jailbreaks.

The paper proposes using activation differences to detect task drift induced by prompt injection; it can be deployed without fine-tuning the model and generalizes zero-shot to unseen attacks such as jailbreaks.

Related papers

Show 3 more papers
Read originalSaTML 2025