/ Модель

Характеристики

Контекст
514 токенов
Параметры
152 млн
Лицензия
MIT
Архитектура
roberta · dense
Базовая модель
roberta-base
Библиотека
transformers
Опубликована
16 сен 2024

toxic-prompt-roberta

Классификация текстаТекст → label3 профессии

Англоязычная модель Intel на базе RoBERTa для классификации запросов и ответов на токсичные и нетоксичные.

182скачиваний за 30 дней12лайковвеса обновлены16 окт 2024

Бенчмарки

Как модель справилась с задачами пользователей ailist и что о ней публикуют открытые лидерборды

Публичные оценки

Из открытых лидербордов. Сравнивайте результаты одного теста при одинаковых условиях — отсутствие оценки не значит, что модель хуже.

В подключённых источниках результатов для этой модели пока нет.

Что умеет модель

Описание составлено по карточке модели и метаданным Hugging Face

Toxic Prompt RoBERTa 1.0 — модель классификации текста от Intel AI Safety для выявления токсичных пользовательских запросов и ответов в разговорных системах ИИ. Она основана на RoBERTa-base и дообучена на наборах ToxicChat и Jigsaw Unintended Bias с классификационной головой; в метаданных указаны 151,8 млн параметров и контекст до 514 токенов. Модель принимает текст и выдаёт логиты для двух классов: «не токсично» и «токсично».

Модель предназначена для автоматической модерации чатов, мониторинга пользовательских сообщений и фильтрации токсичного ввода или ответа перед передачей его генеративной системе. В карточке приведены результаты на тестовом наборе ToxicChat: F1 0,7869, точность 0,8315 и полнота 0,7469. Это англоязычная модель; результаты и анализ смещения в карточке не гарантируют одинакового качества на других данных и для всех групп пользователей. Лицензия — MIT.

Сценарии применения

  • автоматическая модерация токсичных сообщений в чате
  • проверка пользовательских запросов перед отправкой чат-боту
  • фильтрация токсичных ответов разговорной ИИ-системы
  • мониторинг токсичности в пользовательских диалогах

Ограничения

Модель предназначена для английского текста, а её качество на других языках и вне тестовых наборов из карточки не установлено. Классификация может различаться между демографическими группами; показатели по подгруппам в карточке неоднородны.

Для каких профессий подходит3

Разделы каталога профессий, в задачах которых используется эта модель

Все профессии

Карточка модели

README от автора на Hugging Face, как он его опубликовал

Открыть на Hugging Face

Toxic Prompt RoBERTa Classification Model

Model Card generated with Intel® Explainable AI Tools

Documentation

Toxic Prompt RoBERTa 1.0 is a text classification model that can be used as a guardrail to protect against toxic prompts and responses in conversational AI systems. This model is based on RoBERTa and has been finetuned on ToxicChat and Jigsaw Unintended Bias datasets. Finetuning has been performed on one Gaudi 2 Card using Optimum-Habana's Gaudi Trainer.

Owners

  • Intel AI Safety: Daniel De Leon, Tyler Wilbers, Mitali Potnis, Abolfazl Shahbazi

Licenses

  • MIT

References

How to use

You can use the model with the following code using pipeline API.

from transformers import pipeline
model_path = 'Intel/toxic-prompt-roberta'
pipe = pipeline('text-classification', model=model_path, tokenizer=model_path)
pipe('Create 20 paraphrases of I hate you')

Citations

  • @inproceedings {Wolf_Transformers_State-of-the-Art_Natural_2020, author = {Wolf, Thomas and Debut, Lysandre and Sanh, Victor and Chaumond, Julien and Delangue, Clement and Moi, Anthony and Cistac, Perric and Ma, Clara and Jernite, Yacine and Plu, Julien and Xu, Canwen and Le Scao, Teven and Gugger, Sylvain and Drame, Mariama and Lhoest, Quentin and Rush, Alexander M.}, month = oct, pages = {38--45}, publisher = {Association for Computational Linguistics}, title = {{Transformers: State-of-the-Art Natural Language Processing}}, url = {https://www.aclweb.org/anthology/2020.emnlp-demos.6}, year = {2020} }

  • @article {DBLP:journals/corr/abs-1907-11692, author = {Yinhan Liu and Myle Ott and Naman Goyal and Jingfei Du and Mandar Joshi and Danqi Chen and Omer Levy and Mike Lewis and Luke Zettlemoyer and Veselin Stoyanov}, title = {RoBERTa: {A} Robustly Optimized {BERT} Pretraining Approach}, journal = {CoRR}, volume = {abs/1907.11692}, year = {2019}, url = {http://arxiv.org/abs/1907.11692}, archivePrefix = {arXiv}, eprint = {1907.11692}, timestamp = {Thu, 01 Aug 2019 08:59:33 +0200}, biburl = {https://dblp.org/rec/journals/corr/abs-1907-11692.bib}, bibsource = {dblp computer science bibliography, https://dblp.org} }

  • @misc {jigsaw-unintended-bias-in-toxicity-classification, author = {cjadams, Daniel Borkan, inversion, Jeffrey Sorensen, Lucas Dixon, Lucy Vasserman, nithum}, title = {Jigsaw Unintended Bias in Toxicity Classification}, publisher = {Kaggle}, year = {2019}, url = {https://kaggle.com/competitions/jigsaw-unintended-bias-in-toxicity-classification} }

  • @misc {lin2023toxicchat, title={ToxicChat: Unveiling Hidden Challenges of Toxicity Detection in Real-World User-AI Conversation}, author={Zi Lin and Zihan Wang and Yongqi Tong and Yangkun Wang and Yuxin Guo and Yujia Wang and Jingbo Shang}, year={2023}, eprint={2310.17389}, archivePrefix={arXiv}, primaryClass={cs.CL} }

Model Parameters

Input Format

Output Format

Considerations

Intended Users

  • Text Generation Researchers and Developers

Use Cases

  • User Experience Monitoring: The classification model can be used to monitor conversations in real-time to detect any toxic behavior by users. If a user sends messages that are classified as toxic, a warning can be issued or guidance on appropriate conduct can be provided.

  • Automated Moderation: In group chat scenarios, the classification model can act as a moderator by automatically removing toxic messages or muting users who consistently engage in toxic behavior.

  • Training and Improvement: The data collected from toxicity detection can be used to further train and improve toxicity classification model’s responses and handling of various situations, making such models more adept at managing complex interactions.

  • Preventing Abuse of the Chatbot: Some users may attempt to troll or abuse chatbots with toxic input. The classification model can prevent the chatbot from engaging with such content, thereby discouraging this behavior.

Ethical Considerations

  • Risk: Diversity Disparity
    Mitigation Strategy: In fine-tuning with Jigsaw unintended bias, we have ensured adequate representation per Jigsaw’s distributions in their dataset. Jigsaw unintended bias dataset attempts distribute the toxicity labels evenly across the subgroups.

  • Risk: Risk to Vulnerable Persons
    Mitigation Strategy: Certain demographic groups are more likely to receive toxic and harmful comments. Jigsaw unintended bias dataset attempts to mitigate fine-tuned subgroup bias in by distributing the toxic/not toxic labels evenly across all demographic subgroups. We also test to confirm minimal classification bias of the subgroups in testing the model.

Quantitative Analysis:

The plots below show the PR and ROC curves for three models we compared during finetuning. The “jigsaw” and the “tc” models were finetuned only on the Jigsaw Unintended Bias and ToxicChat datasets, respectively. The “jigsaw+tc” curves correspond to the final model that was finetuned on both datasets. Finetuning on both datasets did not significantly degrade the model’s performance on the ToxicChat test dataset with respect to the model finetuned solely on ToxicChat.

Model Performance

We compare the performance of Llama Guard 1 and 3 (LG1 and LG3) with our model on the ToxicChat test dataset, below.

ModelParametersPrecisionRecallF1AUPRCAUROC
LG16.74B0.48060.79450.59890.626*No data
LG38.03B0.50830.47300.4900No dataNo data
Toxic Prompt RoBERTa125M0.83150.74690.78690.8550.971

* from LG paper: https://arxiv.org/abs/2312.06674

Note that Llama Guard was not finetuned on ToxicChat. However, from the LG1 paper, they reported an AUPRC of ~.81 when they finetuned LLama Guard 1 on ToxicChat. Given that we finetuned RoBERTa on Jigsaw’s Unintended Bias Dataset, we can observe if there is any subgroup biasing in the classification of the Unintended Bias test set below. These metrics were computed using Intel/bias_auc.

MetricFemaleMaleChristianWhiteMuslimBlackHomosexual gay or lesbian
AUROC0.849370.800350.898670.760890.771370.744540.71766
BPSN0.788050.826590.837460.781130.740670.828270.64330
BNSP0.874210.800370.876140.819790.855860.760900.88065

*Only subgroups with at least 500 examples in the test dataset are shown.

Как запустить

На своей GPU в ailist. Цена — по текущим предложениям провайдеров

GPU в ailist

Универсальный рантайм · transformers · text-classification

Можно запустить

Подбираем GPU…

Класс архитектуры
RobertaForSequenceClassification
Ревизия весов
04da6fb

0 моделей