Detecting Language Model Attacks with Perplexity

Gabriel Alon, Michael Kamfonas
8/27/2023
cs.CLcs.AIcs.CR

No confident code implementation found for this paper. 2 possible matches can be shown below.

Abstract

A novel hack involving Large Language Models (LLMs) has emerged, exploiting adversarial suffixes to deceive models into generating perilous responses. Such jailbreaks can trick LLMs into providing intricate instructions to a malicious user for creating explosives, orchestrating a bank heist, or facilitating the creation of offensive content. By evaluating the perplexity of queries with adversarial suffixes using an open-source LLM (GPT-2), we found that they have exceedingly high perplexity values. As we explored a broad range of regular (non-adversarial) prompt varieties, we concluded that false positives are a significant challenge for plain perplexity filtering. A Light-GBM trained on perplexity and token length resolved the false positives and correctly detected most adversarial attacks in the test set.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. 2 weaker matches are hidden by default — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{alon2023detecting,
  title  = {Detecting Language Model Attacks with Perplexity},
  author = {Gabriel Alon and Michael Kamfonas},
  year   = {2023},
  eprint = {2308.14132},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2308.14132v3}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2308.14132.svg)](https://codeofpaper.com/paper/2308.14132)

Discussion