Did you notice the drift? Catching LLM task drift with activation differencesGet my drift? Catching LLM Task Drift with Activation Deltas
Translation in progress — untranslated text is omitted.
The 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.
- 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.
- 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.
- 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).
- 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.
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.