Efficient Detection of Toxic Prompts in Large Language Models
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
- 2023GPT-4 Technical Reportcited by 18,132
- 2019Exploring the Limits of Transfer Learning with a Unified Text-to-Text Transformercited by 14,491
- 2023Universal and Transferable Adversarial Attacks on Aligned Language Modelscited by 2,914
- 2018UMAP: Uniform Manifold Approximation and Projection for Dimension Reductioncited by 2,841
- 2020RealToxicityPrompts: Evaluating Neural Toxic Degeneration in Language Modelscited by 1,235
- 2023Prompt Injection attack against LLM-integrated Applicationscited by 568
- 2023Jailbreaking ChatGPT via Prompt Engineering: An Empirical Studycited by 478
- 2023Safety-Tuned LLaMAs: Lessons From Improving the Safety of Large Language Models that Follow Instructionscited by 377
- 2022A Holistic Approach to Undesired Content Detection in the Real Worldcited by 337
- 2016Understanding Neural Networks through Representation Erasurecited by 223
- 2022A New Generation of Perspective API: Efficient Multilingual Character-level Transformerscited by 181
- 2023MasterKey: Automated Jailbreak Across Multiple Large Language Model Chatbotscited by 172
9 more
- 2023From ChatGPT to ThreatGPT: Impact of Generative AI in Cybersecurity and Privacycited by 137
- 2024A Comprehensive Study of Jailbreak Attack versus Defense for Large Language Modelscited by 95
- 2023Red teaming ChatGPT via Jailbreaking: Bias, Robustness, Reliability and Toxicitycited by 86
- 2024Play Guessing Game with LLM: Indirect Jailbreak Attack with Implicit Cluescited by 57
- 2022Why So Toxic? Measuring and Triggering Toxic Behavior in Open-Domain Chatbotscited by 31
- 2023Efficient Toxic Content Detection by Bootstrapping and Distilling Large Language Modelscited by 21
- 2024Uncovering Logit Suppression Vulnerabilities in LLM Safety Alignmentcited by 16
- 2023Jailbreaker in Jail: Moving Target Defense for Large Language Modelscited by 14
- 2022Transformers are Short Text Classifiers: A Study of Inductive Short Text Classifiers on Benchmarks and Real-world Datasetscited by 11
Built on by
Citing papers per year: 2025: 7; 2026: 4.
11 papers.
- 2025AgentSpec: Customizable Runtime Enforcement for Safe and Reliable LLM Agentscited by 196
- 2025The Scales of Justitia: A Comprehensive Survey on Safety Evaluation of LLMscited by 24
- 2025Advancing Embodied Agent Security: From Safety Benchmarks to Input Moderationcited by 12
- 2025Guardians and Offenders: A Survey on Harmful Content Generation and Safety Mitigation of LLMcited by 8
- 2026Loop as a Bridge: Can Looped Transformers Truly Link Representation Space and Natural Language Outputs?cited by 8
- 2025GuardNet: Graph-Attention Filtering for Jailbreak Defense in Large Language Modelscited by 3
- 2025Beyond External Monitors: Enhancing Transparency of Large Language Models for Easier Monitoringcited by 2
- 2025Benign-to-Toxic Jailbreaking: Inducing Harmful Responses from Harmless Promptscited by 1
- 2026Do Prompts Guarantee Safety? Mitigating Toxicity from LLM Generations through Subspace Interventioncited by 1
- 2026Efficient and Adaptable Detection of Malicious LLM Prompts via Bootstrap Aggregationcited by 0
- 2026Trustworthy Data- and ML-Ops for Intelligent Transportation Systems and Logisticscited by 0
- 2026Trustworthy Data- and ML-Ops for Intelligent Transportation Systems and Logistics1 Oct 2026
- 2026Efficient and Adaptable Detection of Malicious LLM Prompts via Bootstrap Aggregation8 Feb 2026
- 2026Do Prompts Guarantee Safety? Mitigating Toxicity from LLM Generations through Subspace Intervention6 Feb 2026
- 2026Loop as a Bridge: Can Looped Transformers Truly Link Representation Space and Natural Language Outputs?15 Jan 2026
- 2025GuardNet: Graph-Attention Filtering for Jailbreak Defense in Large Language Models27 Sep 2025
- 2025Guardians and Offenders: A Survey on Harmful Content Generation and Safety Mitigation of LLM7 Aug 2025
- 2025The Scales of Justitia: A Comprehensive Survey on Safety Evaluation of LLMs6 Jun 2025
- 2025Benign-to-Toxic Jailbreaking: Inducing Harmful Responses from Harmless Prompts26 May 2025
- 2025Advancing Embodied Agent Security: From Safety Benchmarks to Input Moderation22 Apr 2025
- 2025AgentSpec: Customizable Runtime Enforcement for Safe and Reliable LLM Agents24 Mar 2025
- 2025Beyond External Monitors: Enhancing Transparency of Large Language Models for Easier Monitoring7 Feb 2025