CoolFace
Modelpublic

frankhanhj/roberta-base-all-sources-ai-identifier

sourceHugging Faceotherupdated 4mo agoView on Hugging Face
0likes180downloads
Model Card

RoBERTa All-Sources AI Text Identifier

This model is a roberta-base sequence classifier fine-tuned to distinguish human-written text from AI-generated text, with emphasis on creative-writing and prose-like distributions.

Labels:

  • human: label 0
  • ai: label 1

Intended Use

The model is intended for research and internal evaluation of AI-generated prose detection. It should not be used as the sole basis for high-stakes decisions about authorship, academic integrity, employment, moderation, or user sanctions. Outputs are classifier probabilities, not proof of authorship.

Loading

python
from transformers import AutoModelForSequenceClassification, AutoTokenizer

model_id = "frankhanhj/roberta-base-all-sources-ai-identifier"

tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForSequenceClassification.from_pretrained(model_id)

Training Data

The training corpus is datasets/all-sources-ai-identifier, assembled from the local sources below. Validation and test rows were not used for training. For chunked external sources, splits were isolated by group_id / original_index; the recorded split audit found 0 leaks across 10,992 checked groups.

SourceTrain RowsValidation RowsTest RowsLabels / Notes
MAGE / HC3 / RAID mixed research corpus10,0001,6001,600Balanced human/AI mixture from hc3, mage, and raid
RL Claude creative-writing SFT outputs3,549442446AI-only generated writing
Gale Creativewriting GPT outputs23,9862,8432,960AI-only generated creative writing
human-writing-dpo21,5012,6702,629chosen_human as human, rejected_ai as AI
Human creative MAGE holdout800100100Human-only roct_human and wp_human

Overall split sizes:

SplitRowsHumanAI
Train59,83618,32241,514
Validation7,6552,4735,182
Test7,7352,4015,334

Techniques Tried

Several detector families were trained or evaluated before selecting this checkpoint:

RunTechniqueTrain RowsTest RowsTest AccuracyTest ROC AUC
roberta-base-all-sources-ai-identifierRoBERTa sequence classifier on all sources59,8367,7350.9848740.998999
roberta-base-mixed-plus-claude-ai-identifierRoBERTa sequence classifier on mixed research + Claude16,0001,6000.9912500.999239
roberta-base-mixed-research-ai-identifierRoBERTa sequence classifier on MAGE/HC3/RAID10,0001,6000.9893750.999022
token-qwen35-mixed-research-ai-identifierQwen3.5 token-level CNN/attention classifier10,0001,6000.9818750.998786
qwen35-2b-mixed-research-embedding-identifierPooled Qwen3.5 embeddings + MLP10,0001,6000.9718750.998188
raw-mixed-research-ai-identifierRaw text n-gram + stylometric classifier10,0001,6000.9656250.989867
raw-mixed-plus-claude-ai-identifierRaw text n-gram + stylometric classifier on mixed + Claude16,0001,6000.9500000.985572
qwen35-2b-mage-embedding-identifierPooled Qwen3.5 embeddings + MLP on MAGE40,0006,0000.8615000.939538
roberta-base-mage-4k-ai-identifierRoBERTa sequence classifier on small MAGE subset4,0001,0000.7380000.883386
token-qwen35-mage-4k-ai-identifierQwen3.5 token-level CNN/attention classifier on small MAGE subset4,0001,0000.7720000.864189
raw-mage-ai-identifierRaw text n-gram + stylometric classifier on MAGE40,0006,0000.7300000.813246

The selected model is the all-sources RoBERTa checkpoint. It has slightly lower original mixed-benchmark accuracy than the earlier mixed-plus-Claude RoBERTa run, but it fixes a severe false-positive failure on human-writing-dpo.

Training Procedure

Base model: roberta-base

Key settings:

  • Max sequence length: 512
  • Batch size: 8
  • Evaluation batch size: 64
  • Gradient accumulation: 2
  • Epochs: 2
  • Learning rate: 2e-5
  • Weight decay: 0.01
  • Warmup ratio: 0.06
  • Class weighting: balanced
  • Mixed precision: fp16
  • Seed: 20260530
  • Best checkpoint selection: validation ROC AUC

The selected checkpoint is epoch 1. Epoch 2 increased AI recall slightly but reduced human recall, so epoch 1 was kept.

Evaluation

All-sources held-out test result:

AccuracyROC AUCHuman RecallAI RecallConfusion Matrix
0.9848740.9989990.9670970.992876[[2322, 79], [38, 5296]]

Comparison against the previous mixed-plus-Claude RoBERTa model on the all-sources test set:

ModelAccuracyROC AUCHuman RecallAI Recall
all-sources RoBERTa0.9848740.9989990.9670970.992876
previous mixed-plus-Claude RoBERTa0.7928890.7064780.4331530.954818

Important held-out slice results:

Test SliceAccuracyHuman RecallAI Recall
human-writing-dpo0.9771780.9600271.000000
Gale Creativewriting GPT0.989527n/a0.989527
RL Claude Creative Writing SFT1.000000n/a1.000000
Human creative MAGE0.9400000.940000n/a
MAGE mixed0.9733330.9600000.986667
HC30.9975000.9950001.000000
RAID0.9950001.0000000.990000

Known Limitations

  • The model is sensitive to the distributions represented in the assembled datasets.
  • AI text detectors can produce false positives, especially under domain shift.
  • The training set is not balanced by source; balanced class loss was used, but source imbalance remains.
  • Some evaluation slices are single-label, so they report only human recall or AI recall rather than full binary metrics.
  • The model should be calibrated and re-evaluated before use on new domains, languages, or generator families.

Artifacts

This repository contains the full fine-tuned Transformers checkpoint:

  • model.safetensors
  • config.json
  • tokenizer.json
  • tokenizer_config.json
  • metrics.json
  • history.json
  • run_config.json
  • group_metrics.json