대형 언어 모델에서 유해 프롬프트를 효율적으로 탐지하기
Efficient Detection of Toxic Prompts in Large Language Models
August 21, 2024
저자: Yi Liu, Junzhe Yu, Huijia Sun, Ling Shi, Gelei Deng, Yuqi Chen, Yang Liu
cs.AI
초록
ChatGPT 및 Gemini과 같은 대형 언어 모델(LLM)은 자연어 처리를 크게 발전시켜 챗봇 및 자동 콘텐츠 생성과 같은 다양한 응용 프로그램을 가능케 했습니다. 그러나 이러한 모델은 유해하거나 윤리적이지 않은 응답을 유도하기 위해 유해 프롬프트를 작성하는 악의적인 개인들에 의해 악용될 수 있습니다. 이러한 개인들은 종종 안전 메커니즘을 우회하기 위해 탈옥 기술을 사용하며, 이는 견고한 유해 프롬프트 감지 방법의 필요성을 강조합니다. 기존의 감지 기술인 블랙박스 및 화이트박스는 유해 프롬프트의 다양성, 확장성 및 계산 효율성과 관련된 도전에 직면하고 있습니다. 이에 우리는 LLM에서 유해 프롬프트를 효율적으로 감지하기 위해 설계된 경량 그레이박스 방법인 ToxicDetector을 제안합니다. ToxicDetector은 LLM을 활용하여 유해 개념 프롬프트를 생성하고, 임베딩 벡터를 사용하여 특징 벡터를 형성하며, 프롬프트 분류를 위해 다층 퍼셉트론(MLP) 분류기를 사용합니다. LLama 모델의 다양한 버전, Gemma-2 및 여러 데이터셋에 대한 평가 결과, ToxicDetector은 96.39%의 높은 정확도와 2.00%의 낮은 거짓 양성률을 달성하여 최신 기술을 능가합니다. 또한, ToxicDetector의 프롬프트 당 처리 시간이 0.0780초로 실시간 응용에 매우 적합합니다. ToxicDetector은 높은 정확도, 효율성 및 확장성을 달성하여 LLM에서 유해 프롬프트 감지를 위한 실용적인 방법으로 나타납니다.
English
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.Summary
AI-Generated Summary