Saved in:
| Main Authors: | , , , , |
|---|---|
| Format: | Preprint |
| Published: |
2024
|
| Subjects: | |
| Online Access: | https://arxiv.org/abs/2405.18822 |
| Tags: |
Add Tag
No Tags, Be the first to tag this record!
|
| _version_ | 1866916472312299520 |
|---|---|
| author | Hu, Zhanhao Piet, Julien Zhao, Geng Jiao, Jiantao Wagner, David |
| author_facet | Hu, Zhanhao Piet, Julien Zhao, Geng Jiao, Jiantao Wagner, David |
| contents | Current LLMs are generally aligned to follow safety requirements and tend to refuse toxic prompts. However, LLMs can fail to refuse toxic prompts or be overcautious and refuse benign examples. In addition, state-of-the-art toxicity detectors have low TPRs at low FPR, incurring high costs in real-world applications where toxic examples are rare. In this paper, we introduce Moderation Using LLM Introspection (MULI), which detects toxic prompts using the information extracted directly from LLMs themselves. We found we can distinguish between benign and toxic prompts from the distribution of the first response token's logits. Using this idea, we build a robust detector of toxic prompts using a sparse logistic regression model on the first response token logits. Our scheme outperforms SOTA detectors under multiple metrics. |
| format | Preprint |
| id |
arxiv_https___arxiv_org_abs_2405_18822 |
| institution | arXiv |
| publishDate | 2024 |
| record_format | arxiv |
| spellingShingle | Toxicity Detection for Free Hu, Zhanhao Piet, Julien Zhao, Geng Jiao, Jiantao Wagner, David Computation and Language Current LLMs are generally aligned to follow safety requirements and tend to refuse toxic prompts. However, LLMs can fail to refuse toxic prompts or be overcautious and refuse benign examples. In addition, state-of-the-art toxicity detectors have low TPRs at low FPR, incurring high costs in real-world applications where toxic examples are rare. In this paper, we introduce Moderation Using LLM Introspection (MULI), which detects toxic prompts using the information extracted directly from LLMs themselves. We found we can distinguish between benign and toxic prompts from the distribution of the first response token's logits. Using this idea, we build a robust detector of toxic prompts using a sparse logistic regression model on the first response token logits. Our scheme outperforms SOTA detectors under multiple metrics. |
| title | Toxicity Detection for Free |
| topic | Computation and Language |
| url | https://arxiv.org/abs/2405.18822 |