Detecting Fluent Optimization-Based Adversarial Prompts via Sequential Entropy Changes
Abstract
Lay Summary
Large language models like ChatGPT are trained to refuse harmful requests, but attackers can trick them by appending a carefully-crafted string of text to the end of a question. Modern versions of these "adversarial suffixes" are generated automatically and dressed up to read naturally, so ordinary text-quality filters routinely miss them. We built a lightweight watchdog, CPD Online, that does something different: it listens, word by word, to how surprised the model is by what it is reading. The system's own instructions set what normal surprise looks like, and an alarm fires when that pattern shifts and stays shifted — the signature of a hidden suffix taking over from the legitimate question. It needs no training, no second model, runs alongside the model's normal work, and pinpoints where the attack begins. Tested on six open-weight models (LLaMA-2, Vicuna, Qwen2.5, 7–14 billion parameters) against five attack families, it catches these hidden suffixes more reliably than comparable simple defenses. Used as a fast first-pass screen, it cuts the compute cost of running heavier safety classifiers by 17–22% on realistic traffic without weakening protection.