Detecting Language Model Attacks with Perplexity

By Gabriel Alon, Michael Kamfonas. arXiv.org, 2023

481 citations recorded by the source corpus.

A novel hack involving Large Language Models (LLMs) has emerged, leveraging adversarial suffixes to trick models into generating perilous responses. This method has garnered considerable attention from reputable media outlets such as the New York Times and Wired, thereby influencing public perception regarding the security and safety of LLMs. In this study, we advocate the utilization of perplexity as one of the means to recognize such potential attacks. The underlying concept behind these hacks revolves around appending an unusually constructed string of text to a harmful query that would otherwise be blocked. This maneuver confuses the protective mechanisms and tricks the model into generating a forbidden response. Such scenarios could result in providing detailed instructions to a malicious user for constructing explosives or orchestrating a bank heist. Our investigation demonstrates the feasibility of employing perplexity, a prevalent natural language processing metric, to detect these adversarial tactics before generating a forbidden response. By evaluating the perplexity of queries with and without such adversarial suffixes using an open-source LLM, we discovered that nearly 90 percent were above a perplexity of 1000. This contrast underscores the efficacy of perplexity for detecting this type of exploit.

Subfields: Artificial Intelligence

View Paper: https://www.semanticscholar.org/paper/b8b8d5655df1c6a71bbb713387863e34cc055332

How researchers see this paper

The researchers whose trusted networks rank it highest, strongest advocate first. Every researcher gets a different order.

In Artificial Intelligence

  1. Jinyuan Jia
  2. Neil Zhenqiang Gong
  3. Francesco Croce
  4. Maksym Andriushchenko
  5. Nicolas Flammarion
  6. Vikash Sehwag
  7. Edoardo Debenedetti
  8. Matthias Hein

Citations in the corpus