English

Detecting Fluent Optimization-Based Adversarial Prompts via Sequential Entropy Changes

Machine Learning 2026-05-20 v1 Artificial Intelligence

Abstract

Optimization-based adversarial suffixes can jailbreak aligned large language models (LLMs) while remaining fluent, weakening static and windowed perplexity-based detectors. We cast adversarial suffix detection as an online change-point detection problem over the token-level next-token entropy stream. Using the LLM system prompt to estimate a robust baseline, we standardize user-token entropies and apply a one-sided CUSUM statistic. The resulting detector, CPD Online (CPD), is model-agnostic, training-free, runs online, and localizes the adversarial suffix onset. On a benchmark of 1,012 optimization-based suffix attacks (GCG, AutoDAN, AdvPrompter, BEAST, AutoDAN-HGA) and 1,012 perplexity-controlled benign prompts, CPD improves F1 over the strongest windowed-perplexity baseline on all six open-weight chat models (LLaMA-2-7B/13B, Vicuna-7B/13B, Qwen2.5-7B/14B). On LLaMA-2-7B at the canonical CUSUM setting (k=0k=0), CPD reaches AUROC 0.880.88 and F1 0.820.82. Beyond prompt-level detection, CPD concentrates 79.6% of its triggers inside the adversarial suffix, versus 17-46% for windowed perplexity. Finally, when used as a lightweight gate for LLaMA Guard, CPD reduces guard calls by 17-22% on a high-volume, benign-dominated deployment while preserving guard-level detection quality

Keywords

Cite

@article{arxiv.2605.19966,
  title  = {Detecting Fluent Optimization-Based Adversarial Prompts via Sequential Entropy Changes},
  author = {Mohammed Alshaalan and Miguel R. D. Rodrigues},
  journal= {arXiv preprint arXiv:2605.19966},
  year   = {2026}
}

Comments

Accepted at ICML 2026; 20 pages, including 9 pages main text, references, and appendix