CoolFace
Modelpublic

AICodexLab/answerdotai-ModernBERT-base-ai-detector

sourceHugging Faceapache-2.0updated 2y agoView on Hugging Face
4likes6.4kdownloads
Model Card

answerdotai-ModernBERT-base-ai-detector

This model is a fine-tuned version of answerdotai/ModernBERT-base on the AI vs Human Text Classification dataset, DAIGT V2 Train Dataset.

It achieves the following results on the evaluation set:

  • โ€”Validation Loss: 0.0036

๐Ÿ“ Model Description

This model is based on ModernBERT-base, a lightweight and efficient BERT-based model. It has been fine-tuned for AI-generated vs Human-written text classification, allowing it to distinguish between texts written by AI models (ChatGPT, DeepSeek, Claude, etc.) and human authors.


๐ŸŽฏ Intended Uses & Limitations

โœ… Intended Uses

  • โ€”AI-generated content detection (e.g., ChatGPT, Claude, DeepSeek).
  • โ€”Text classification for distinguishing human vs AI-generated content.
  • โ€”Educational & Research applications for AI-content detection.

โš ๏ธ Limitations

  • โ€”Not 100% accurate โ†’ Some AI texts may resemble human writing and vice versa.
  • โ€”Limited to trained dataset scope โ†’ May struggle with out-of-domain text.
  • โ€”Bias risks โ†’ If the dataset contains bias, the model may inherit it.

๐Ÿ“Š Training and Evaluation Data

  • โ€”The model was fine-tuned on 35,894 training samples and 8,974 test samples.
  • โ€”The dataset consists of AI-generated text samples (ChatGPT, Claude, DeepSeek, etc.) and human-written samples (Wikipedia, books, articles).
  • โ€”Labels:
  • โ€”1 โ†’ AI-generated text
  • โ€”0 โ†’ Human-written text

โš™๏ธ Training Procedure

Training Hyperparameters

The following hyperparameters were used during training:

HyperparameterValue
Learning Rate2e-5
Train Batch Size16
Eval Batch Size16
OptimizerAdamW (ฮฒ1=0.9, ฮฒ2=0.999, ฮต=1e-08)
LR SchedulerLinear
Epochs3
Mixed PrecisionNative AMP (fp16)

๐Ÿ“ˆ Training Results

Training LossEpochStepValidation Loss
0.05050.225000.0214
0.01140.4410000.0110
0.00880.6615000.0032
0.00.8920000.0048
0.00681.1125000.0035
0.01.3330000.0040
0.01.5535000.0097
0.00531.7840000.0101
0.02.0045000.0053
0.02.2250000.0039
0.00172.4555000.0046
0.02.6760000.0043
0.02.8965000.0036

๐Ÿ›  Framework Versions

LibraryVersion
Transformers4.48.3
PyTorch2.5.1+cu124
Datasets3.3.2
Tokenizers0.21.0

๐Ÿ“ค Model Usage

To load and use the model for text classification:

python
from transformers import AutoModelForSequenceClassification, AutoTokenizer, pipeline

model_name = "answerdotai/ModernBERT-base-ai-detector"

# Load model and tokenizer
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForSequenceClassification.from_pretrained(model_name)

# Create text classification pipeline
classifier = pipeline("text-classification", model=model, tokenizer=tokenizer)

# Run classification
text = "This text was written by an AI model like ChatGPT."
result = classifier(text)

print(result)