Adversarial Restlessness in LLMs
- Adversarial restlessness is defined by a distinctive jittery activation signature in LLMs during multi-turn prompt-injection attacks.
- It quantifies cumulative drift using vector displacements between conversation turns to detect subtle adversarial phase shifts.
- Enhanced detection using scalar trajectory features boosts accuracy up to 93.8% and enables early warning in real-time systems.
Adversarial restlessness is a phenomenon observed in multi-turn prompt-injection attacks on LLMs, defined by a distinctive “jittery” activation-level signature in the model’s residual stream. This signature is empirically and theoretically characterized by an abnormally long and erratic trajectory in hidden-state activation space, discernible only through internal model activations and not from surface-level conversation text. The concept demarcates attack processes (trust-building, pivoting, escalation) that are undetectable by standard text-level methods but manifest as elevated cumulative path lengths in activation space, providing a promising direction for real-time, process-aware adversarial detection and mitigation in dialogue systems (Kulkarni, 30 Apr 2026).
1. Formal Definition and Mathematical Framework
Let be a decoder-only transformer. Fix a layer with hidden dimension . Consider a -turn conversation with messages . For each turn , the last-token hidden-state activation is extracted:
The per-turn drift vector is defined as , and the cumulative path length up through turn as
Adversarial restlessness is the observation that, for prompt-injection attacks following the trust-building 0 pivoting 1 escalation trajectory, 2 is consistently and significantly larger than for benign dialogues. Each adversarial phase shift produces distinct activation displacements, accumulating a long, irregular trajectory in activation space (Kulkarni, 30 Apr 2026).
2. Measurement and Feature Extraction
The activation trajectory 3 forms a discrete path in 4. Key computed quantities per turn 5 include:
- 6 (displacement)
- 7 (drift magnitude)
- 8 (cosine similarity)
- 9 (cumulative path length)
- 0 (drift acceleration)
- 1 (mean drift)
Benign conversations result in smooth, short trajectories with small and approximately constant 2. Adversarial sequences induce large, spiking 3 values at phase boundaries, leading to increased 4 and erratic 5.
Five scalar features distilled for detection are:
- 6 (drift magnitude)
- 7 (cosine similarity)
- 8 (cumulative drift)
- 9 (drift acceleration)
- 0 (mean drift)
Extraction proceeds by concatenating 1 per turn for downstream classification. Pseudocode for algorithmic extraction is given in the source appendix (Kulkarni, 30 Apr 2026).
3. Detection Performance and Feature Utility
On synthetic benchmark datasets, conversation-level detection using only per-turn activation vectors 2 yields 3 accuracy at 4 false positive (FP) rate. Inclusion of the five scalar trajectory features increases performance to 5 at the same FP threshold. Using only these scalars (no 6) achieves 7 accuracy. Feature-importance analysis attributes dominant detection power to cumulative drift 8 and drift magnitude 9.
Early detection of attacks, particularly in the "pivoting" phase, is enabled by restlessness features, with a mean lead time of approximately 0 turns before overt adversarial activity. Longer pivoting phases augment early-detection rates to 1–2, imparting a 3 to 4 turn lead time, dependent on the underlying model (Kulkarni, 30 Apr 2026).
4. Cross-Architecture and Source-Dependent Generalization
Cross-model evaluation using scalar-augmented probes, retrained for each architecture, yields 5–6 detection (FP 7–8) on LLMs such as Mistral 24B, Gemma 27B, Qwen 32B, and Llama 70B. However, scalar-only feature transfer across architectures fails (9 near 0), demonstrating strict model specificity—probes must be retrained per deployment.
In terms of source generalization, a detector trained solely on synthetic activations flags 1 of LMSYS-Chat-1M conversations as adversarial, illustrating that synthetic data fails to capture real-world conversational distributions. Leave-one-out experiments confirm that each source (synthetic, SafeDialBench, LMSYS) provides non-redundant attack distributions; omitting any source leads to catastrophic detection failures for that distribution. Mixed-source training (three data sources, 22,500 conversations) yields robust, general detection (3 at 4 FP, ROC AUC 5 for each source), with significant increase in PR-AUC (LMSYS: 6) (Kulkarni, 30 Apr 2026).
5. Labeling Paradigms and Deployment Implications
Effective adversarial restlessness detection depends critically on three-phase turn-level labels (benign, pivoting, adversarial). Binary conversation-level supervision produces 100% detection but an unusably high (50–59%) false positive rate; detailed turn-level labels reduce FP to 0.5–2%. Explicit pivoting annotations are required to detect subtle steering before overt adversarial acts.
Deployment for a new model requires roughly 1,000 synthetic, three-phase-labeled conversations (automatically generable) plus a small real-world sample for FP calibration. Continual adaptation is feasible via fast retraining (<30 seconds on CPU) using cached activations and human/LLM-validated labels, with FP rates serving as model or data drift signals (Kulkarni, 30 Apr 2026).
6. Distinction from Other “Restless” Constructs
“Adversarial restlessness” is not directly related to “restless bandits” in sequential decision-making or robust reinforcement learning. In RMABs, as formulated by Killian et al. (Killian et al., 2021), “restless” refers to multi-armed bandits where arms evolve even when not selected, and “adversary” denotes robustness to uncertain environment parameters via minimax regret optimization. There is no explicit notion of internal activation path lengths or trajectory features analogous to adversarial restlessness in LLMs. Any conceptual connection is limited to the broader sense of “adversarial” interplay—between agent and environment in RMABs, versus attacker and model in LLM dialog.
7. Broader Impact and Research Directions
Adversarial restlessness introduces an activation-level, process-tracking defense orthogonal to surface-level filtering in LLM systems. It provides early warning of multi-turn prompt injection by identifying activation trajectory anomalies induced by intent steering. This mechanism supports real-time, white-box monitoring and opens the possibility of activation-level interventions, such as steering the model back to a “safe manifold” when restlessness is excessive. The work establishes empirical and labeling preconditions for robust deployment, especially in scenarios demanding continual adaptation and coverage across diverse attack sources (Kulkarni, 30 Apr 2026).