/ Модель

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

Лицензия
Своя лицензия
Базовая модель
roberta-large
Библиотека
transformers
Опубликована
25 сен 2024

ai-detector

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

Англоязычный классификатор SuperAnnotate на основе RoBERTa Large определяет, написан ли текст человеком или сгенерирован ИИ.

2 240скачиваний за 30 дней23лайкавеса обновлены17 дек 2024

Бенчмарки

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

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

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

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

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

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

SuperAnnotate AI Detector — англоязычный классификатор текста, разработанный SuperAnnotate на основе дообученной RoBERTa Large. Модель относит текст к одной из двух категорий: написан человеком или сгенерирован искусственным интеллектом. Она предназначена для проверки текстов, учебных и научных работ, а также данных для обучения на признаки машинной генерации и возможного мошенничества.

Модель обучена на сбалансированном наборе из 44 тысяч пар человеческих и сгенерированных ответов из Википедии, Reddit ELI5, научных публикаций и набора RAID. В обучении использовались тексты, созданные 14 моделями из семейств GPT, LLaMA, Anthropic и Mistral; из обучающих данных удаляли наиболее коррелирующие с метками n-граммы длиной от двух до пяти слов. В метаданных указаны библиотека Transformers и формат safetensors. В README приведены результаты на подмножестве RAID, но они различаются по моделям-генераторам, поэтому качество нельзя считать одинаковым для любого текста.

Модель принимает текст и выдаёт классификацию. Она рассчитана прежде всего на английский язык и не должна рассматриваться как окончательное доказательство авторства: результаты могут зависеть от тематики, генератора и способов изменения текста. Лицензия указана как SAIPL в README и как other в метаданных Hugging Face; перед использованием следует проверить условия SAIPL.

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

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

Ограничения

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

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

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

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

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

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

Открыть на Hugging Face

Description

The model designed to detect generated/synthetic text.
At the moment, such functionality is critical for determining the author of the text. It's critical for your training data, detecting fraud and cheating in scientific and educational areas.
Couple of articles about this problem: Problems with Synthetic Data | Risk of LLMs in Education

Model Details

Model Description

  • Model type: The custom architecture for binary sequence classification based on pre-trained RoBERTa, with a single output label.
  • Language(s): Primarily English.
  • License: SAIPL
  • Finetuned from model: RoBERTa Large

Model Sources

  • Repository: GitHub for HTTP service

Training Data

The training dataset for this version includes 44k pairs of text-label samples, split equally between two parts:

  1. Custom Generation: The first half of the dataset was generated using custom specially designed prompts and human version sourced from three domains:

    Texts were generated by 14 different models across four major LLM families (GPT, LLaMA, Anthropic, and Mistral). Each sample consists of a single prompt paired with one human-written and one generated response, though prompts were excluded from training inputs.

  2. RAID Train Data Stratified Subset: The second half is a carefully selected stratified subset from the RAID train dataset, ensuring equal representation across domains, model types, and attack methods. Each example pairs a human-authored text with a corresponding machine-generated response (produced by a single model with specific parameters and attacks applied).

This balanced dataset structure maintains approximately equal proportions of human and generated text samples, ensuring that each prompt aligns with one authentic and one generated answer.

[!NOTE] Furthermore, key n-grams (n ranging from 2 to 5) that exhibited the highest correlation with target labels were identified and subsequently removed from the training data utilizing the chi-squared test.

Peculiarity

During training, one of the priorities was not only maximizing the quality of predictions but also avoiding overfitting and obtaining an adequately confident predictor.
We are pleased to achieve the following state of model calibration and high acccuracy prediction.

Usage

Pre-requirements:
Install generated_text_detector
Run following command: pip install git+https://github.com/superannotateai/generated_text_detector.git@v1.1.0

Native Usage

from generated_text_detector.utils.model.roberta_classifier import RobertaClassifier
from generated_text_detector.utils.preprocessing import preprocessing_text
from transformers import AutoTokenizer
import torch.nn.functional as F


model = RobertaClassifier.from_pretrained("SuperAnnotate/ai-detector")
tokenizer = AutoTokenizer.from_pretrained("SuperAnnotate/ai-detector")

model.eval()

text_example = "It's not uncommon for people to develop allergies or intolerances to certain foods as they get older. It's possible that you have always had a sensitivity to lactose (the sugar found in milk and other dairy products), but it only recently became a problem for you. This can happen because our bodies can change over time and become more or less able to tolerate certain things. It's also possible that you have developed an allergy or intolerance to something else that is causing your symptoms, such as a food additive or preservative. In any case, it's important to talk to a doctor if you are experiencing new allergy or intolerance symptoms, so they can help determine the cause and recommend treatment."

text_example = preprocessing_text(text_example)

tokens = tokenizer.encode_plus(
   text_example,
   add_special_tokens=True,
   max_length=512,
   padding='longest',
   truncation=True,
   return_token_type_ids=True,
   return_tensors="pt"
)

_, logits = model(**tokens)

proba = F.sigmoid(logits).squeeze(1).item()

print(proba)

Usage in Detector Wrapper

from generated_text_detector.utils.text_detector import GeneratedTextDetector


detector = GeneratedTextDetector(
    "SuperAnnotate/ai-detector",
    device="cuda",
    preprocessing=True
)

text_example = "It's not uncommon for people to develop allergies or intolerances to certain foods as they get older. It's possible that you have always had a sensitivity to lactose (the sugar found in milk and other dairy products), but it only recently became a problem for you. This can happen because our bodies can change over time and become more or less able to tolerate certain things. It's also possible that you have developed an allergy or intolerance to something else that is causing your symptoms, such as a food additive or preservative. In any case, it's important to talk to a doctor if you are experiencing new allergy or intolerance symptoms, so they can help determine the cause and recommend treatment."

res = detector.detect_report(text_example)

print(res)

Training Detailes

A custom architecture was chosen for its ability to perform binary classification while providing a single model output, as well as for its customizable settings for smoothing integrated into the loss function.

Training Arguments:

  • Base Model: FacebookAI/roberta-large
  • Epochs: 20
  • Learning Rate: 5e-05
  • Weight Decay: 0.0033
  • Label Smoothing: 0.38
  • Warmup Epochs: 2
  • Optimizer: SGD
  • Gradient Clipping: 3.0
  • Scheduler: Cosine with hard restarts
  • Number Scheduler Cycles: 6

Performance

This solution has been validated on strytify subset from RAID train dataset.
This benchmark, which includes a diverse dataset covering:

  • 11 LLM models
  • 11 adversarial attacks
  • 8 domains

The performance of detector

ModelAccuracy
Human0.731
ChatGPT0.992
GPT-20.649
GPT-30.945
GPT-40.985
LLaMA-Chat0.980
Mistral0.644
Mistral-Chat0.975
Cohere0.823
Cohere-Chat0.906
MPT0.757
MPT-Chat0.943
Average0.852

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

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

GPU в ailist

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

Нельзя запустить

Архитектура ? неизвестна transformers в образе рантайма.

Ревизия весов
74b2b85

0 моделей