English

Single-pass Detection of Jailbreaking Input in Large Language Models

Machine Learning 2025-02-24 v1 Artificial Intelligence Computation and Language

Abstract

Defending aligned Large Language Models (LLMs) against jailbreaking attacks is a challenging problem, with existing approaches requiring multiple requests or even queries to auxiliary LLMs, making them computationally heavy. Instead, we focus on detecting jailbreaking input in a single forward pass. Our method, called Single Pass Detection SPD, leverages the information carried by the logits to predict whether the output sentence will be harmful. This allows us to defend in just one forward pass. SPD can not only detect attacks effectively on open-source models, but also minimizes the misclassification of harmless inputs. Furthermore, we show that SPD remains effective even without complete logit access in GPT-3.5 and GPT-4. We believe that our proposed method offers a promising approach to efficiently safeguard LLMs against adversarial attacks.

Keywords

Cite

@article{arxiv.2502.15435,
  title  = {Single-pass Detection of Jailbreaking Input in Large Language Models},
  author = {Leyla Naz Candogan and Yongtao Wu and Elias Abad Rocamora and Grigorios G. Chrysos and Volkan Cevher},
  journal= {arXiv preprint arXiv:2502.15435},
  year   = {2025}
}

Comments

Accepted in TMLR 2025

R2 v1 2026-06-28T21:52:42.925Z