/ Модель

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

Контекст
514 токенов
Параметры
95,2 млн
Лицензия
Apache 2.0
Архитектура
roberta · dense
Базовая модель
distilroberta-base
Опубликована
20 янв 2024

distilroberta-base-rejection-v1

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

Англоязычный классификатор ProtectAI на базе distilroberta-base для обнаружения отказов в ответах LLM.

7 173скачиваний за 30 дней9лайковвеса обновлены9 июл 2026

Бенчмарки

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

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

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

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

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

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

Модель distilroberta-base-rejection-v1 разработана ProtectAI и дообучена на distilroberta-base для обнаружения отказов в ответах языковых моделей. Она классифицирует текст на два класса: обычный ответ и обнаруженный отказ, например, когда модель отказывается выполнять запрос из-за модерации. Модель предназначена для анализа ответов LLM и может применяться в NoRefusal Scanner из LLM Guard, чтобы выявлять нежелательные отказы и проблемы с промптами.

Это англоязычная модель классификации последовательностей на архитектуре RoBERTa, с 95,2 млн параметров и контекстом до 514 токенов. В карточке приведены результаты оценки: точность 0,9887, полнота 0,9810 и F1 0,9537. Модель чувствительна к регистру, а её качество зависит от сходства входного текста с данными обучения; она может хуже работать на незнакомых стилях и темах. Проект архивирован и больше не поддерживается. Лицензия — Apache 2.0.

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

  • обнаружение отказов в ответах чат-ботов
  • проверка ответов LLM после модерации
  • поиск отказов в наборах ответов языковых моделей
  • мониторинг отказов в конвейере LLM Guard

Ограничения

Модель чувствительна к регистру, а качество может снижаться на стилях и темах, не представленных в обучающих данных. Проект архивирован и не поддерживается.

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

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

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

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

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

Открыть на Hugging Face

[!WARNING] THIS PROJECT HAS BEEN ARCHIVED.

This project and its associated code on GitHub are no longer under active development or maintained.

Model Card for distilroberta-base-rejection-v1

This model is a fine-tuned version of distilroberta-base on multiple combined datasets of rejections from different LLMs and normal responses from RLHF datasets.

It aims to identify rejections in LLMs when the prompt doesn't pass content moderation, classifying inputs into two categories: 0 for normal outputs and 1 for rejection detected.

It achieves the following results on the evaluation set:

  • Loss: 0.0544
  • Accuracy: 0.9887
  • Recall: 0.9810
  • Precision: 0.9279
  • F1: 0.9537

Model details

  • Fine-tuned by: ProtectAI.com
  • Model type: distilroberta-base
  • Language(s) (NLP): English
  • License: Apache license 2.0
  • Finetuned from model: distilroberta-base

Intended Uses & Limitations

It aims to identify rejection, classifying inputs into two categories: 0 for normal output and 1 for rejection detected.

The model's performance is dependent on the nature and quality of the training data. It might not perform well on text styles or topics not represented in the training set.

Additionally, distilroberta-base is case-sensitive model.

How to Get Started with the Model

Transformers

from transformers import AutoTokenizer, AutoModelForSequenceClassification, pipeline
import torch

tokenizer = AutoTokenizer.from_pretrained("ProtectAI/distilroberta-base-rejection-v1")
model = AutoModelForSequenceClassification.from_pretrained("ProtectAI/distilroberta-base-rejection-v1")

classifier = pipeline(
  "text-classification",
  model=model,
  tokenizer=tokenizer,
  truncation=True,
  max_length=512,
  device=torch.device("cuda" if torch.cuda.is_available() else "cpu"),
)

print(classifier("Sorry, but I can't assist with that."))

Optimum with ONNX

Loading the model requires the 🤗 Optimum library installed.

from optimum.onnxruntime import ORTModelForSequenceClassification
from transformers import AutoTokenizer, pipeline

tokenizer = AutoTokenizer.from_pretrained("ProtectAI/distilroberta-base-rejection-v1", subfolder="onnx")
model = ORTModelForSequenceClassification.from_pretrained("ProtectAI/distilroberta-base-rejection-v1", export=False, subfolder="onnx")

classifier = pipeline(
  task="text-classification",
  model=model,
  tokenizer=tokenizer,
  truncation=True,
  max_length=512,
)

print(classifier("Sorry, but I can't assist with that."))

Use in LLM Guard

NoRefusal Scanner to detect if output was rejected, which can signal that something is going wrong with the prompt.

Training and evaluation data

The model was trained on a custom dataset from multiple open-source ones. We used ~10% rejections and ~90% of normal outputs.

We used the following papers when preparing the datasets:

Training procedure

Training hyperparameters

The following hyperparameters were used during training:

  • learning_rate: 2e-05
  • train_batch_size: 16
  • eval_batch_size: 8
  • seed: 42
  • optimizer: Adam with betas=(0.9,0.999) and epsilon=1e-08
  • lr_scheduler_type: linear
  • lr_scheduler_warmup_steps: 500
  • num_epochs: 3

Training results

Training LossEpochStepValidation LossAccuracyRecallPrecisionF1
0.05251.035360.03550.99120.95830.96750.9629
0.02192.070720.03120.99190.99170.94340.9669
0.01213.0106080.03500.99390.99050.95960.9748

Framework versions

  • Transformers 4.36.2
  • Pytorch 2.1.2+cu121
  • Datasets 2.16.1
  • Tokenizers 0.15.0

Community

Join our Slack to give us feedback, connect with the maintainers and fellow users, ask questions, get help for package usage or contributions, or engage in discussions about LLM security!

Citation

@misc{distilroberta-base-rejection-v1,
  author = {ProtectAI.com},
  title = {Fine-Tuned DistilRoberta-Base for Rejection in the output Detection},
  year = {2024},
  publisher = {HuggingFace},
  url = {https://huggingface.co/ProtectAI/distilroberta-base-rejection-v1},
}

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

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

GPU в ailist

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

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

Подбираем GPU…

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

0 моделей