mlsanityData to 7 Oct 2026

Efficient Detection of Toxic Prompts in Large Language Models

arXiv 2408.11727 ↗First posted 21 Aug 2024cs.CR cs.AI cs.CLcited by 11

Not on the map. Why?

Abstract (arXiv)

Large language models (LLMs) like ChatGPT and Gemini have significantly advanced natural language processing, enabling various applications such as chatbots and automated content generation. However, these models can be exploited by malicious individuals who craft toxic prompts to elicit harmful or unethical responses. These individuals often employ jailbreaking techniques to bypass safety mechanisms, highlighting the need for robust toxic prompt detection methods. Existing detection techniques, both blackbox and whitebox, face challenges related to the diversity of toxic prompts, scalability, and computational efficiency. In response, we propose ToxicDetector, a lightweight greybox method designed to efficiently detect toxic prompts in LLMs. ToxicDetector leverages LLMs to create toxic concept prompts, uses embedding vectors to form feature vectors, and employs a Multi-Layer Perceptron (MLP) classifier for prompt classification. Our evaluation on various versions of the LLama models, Gemma-2, and multiple datasets demonstrates that ToxicDetector achieves a high accuracy of 96.39% and a low false positive rate of 2.00%, outperforming state-of-the-art methods. Additionally, ToxicDetector's processing time of 0.0780 seconds per prompt makes it highly suitable for real-time applications. ToxicDetector achieves high accuracy, efficiency, and scalability, making it a practical method for toxic prompt detection in LLMs.

Key facts. Cited by 11 papers in the map (data through 7 Oct 2026). Builds on 21 of its 46 references that are in the map. First posted on arXiv 21 Aug 2024.

Builds on

21 of 46 references.

References · 21

  1. 2023GPT-4 Technical Reportcited by 18,132
  2. 2019Exploring the Limits of Transfer Learning with a Unified Text-to-Text Transformercited by 14,491
  3. 2023Universal and Transferable Adversarial Attacks on Aligned Language Modelscited by 2,914
  4. 2018UMAP: Uniform Manifold Approximation and Projection for Dimension Reductioncited by 2,841
  5. 2020RealToxicityPrompts: Evaluating Neural Toxic Degeneration in Language Modelscited by 1,235
  6. 2023Prompt Injection attack against LLM-integrated Applicationscited by 568
  7. 2023Jailbreaking ChatGPT via Prompt Engineering: An Empirical Studycited by 478
  8. 2023Safety-Tuned LLaMAs: Lessons From Improving the Safety of Large Language Models that Follow Instructionscited by 377
  9. 2022A Holistic Approach to Undesired Content Detection in the Real Worldcited by 337
  10. 2016Understanding Neural Networks through Representation Erasurecited by 223
  11. 2022A New Generation of Perspective API: Efficient Multilingual Character-level Transformerscited by 181
  12. 2023MasterKey: Automated Jailbreak Across Multiple Large Language Model Chatbotscited by 172
9 more
  1. 2023From ChatGPT to ThreatGPT: Impact of Generative AI in Cybersecurity and Privacycited by 137
  2. 2024A Comprehensive Study of Jailbreak Attack versus Defense for Large Language Modelscited by 95
  3. 2023Red teaming ChatGPT via Jailbreaking: Bias, Robustness, Reliability and Toxicitycited by 86
  4. 2024Play Guessing Game with LLM: Indirect Jailbreak Attack with Implicit Cluescited by 57
  5. 2022Why So Toxic? Measuring and Triggering Toxic Behavior in Open-Domain Chatbotscited by 31
  6. 2023Efficient Toxic Content Detection by Bootstrapping and Distilling Large Language Modelscited by 21
  7. 2024Uncovering Logit Suppression Vulnerabilities in LLM Safety Alignmentcited by 16
  8. 2023Jailbreaker in Jail: Moving Target Defense for Large Language Modelscited by 14
  9. 2022Transformers are Short Text Classifiers: A Study of Inductive Short Text Classifiers on Benchmarks and Real-world Datasetscited by 11

Built on by

Cited by year (2026 to 7 Oct)

Citing papers per year: 2025: 7; 2026: 4.

11 papers.