CoolFace
Modelpublic

alejandroparbas/voight-kampff-pan2024-gte-en-v1.5

sourceHugging Faceapache-2.0updated 5mo agoView on Hugging Face
0likes29downloads
Model Card

voight-kampff-pan2024-gte-en-v1.5

A fine-tuned sentence embedding model for AI-generated text detection, built for the Voight-Kampff Generative AI Shared Task (PAN @ CLEF 2024).

This model generates embeddings where human-written texts cluster together and are separated from AI-generated texts in the vector space. It is designed to be paired with a downstream classifier (we use a calibrated Linear SVM) for authorship verification.

Model Details

ParameterValue
Base ModelAlibaba-NLP/gte-base-en-v1.5
Fine-tuning MethodContrastive learning with triplet loss
Frozen Layers10 of 12 (only last 2 fine-tuned)
Epochs20
Batch Size16
Learning Rate1e-5
Weight Decay0.01
Gradient Accumulation2 steps
Warmup10% of total training steps
Training PlatformKaggle

Training Data

Trained on the PAN 2024 competition dataset, augmented with texts rewritten by local LLMs via Ollama (llama 3.2 1b, qwen 2.5 1b, gemma 2 2b).

  • —Texts are chunked into ~64 token segments using the gte-base-en-v1.5 tokenizer
  • —Triplets formed as (human anchor, human positive, AI negative)
  • —15% of training samples include leetspeak noise injection via pyleetspeak
  • —AI data from 18 different LLM sources (GPT-3.5, GPT-4, LLaMA, Mistral, Alpaca, Qwen, Gemma, etc.)

Usage

Generating Embeddings

python
from sentence_transformers import SentenceTransformer

model = SentenceTransformer(
    'alejandroparbas/voight-kampff-pan2024-gte-en-v1.5',
    trust_remote_code=True
)

texts = [
    "A chunk of human-written text...",
    "A chunk of AI-generated text..."
]

embeddings = model.encode(texts)

Training a Classifier on the Embeddings

The embeddings can be used to train any classifier. We use a calibrated Linear SVM:

python
from sklearn.svm import LinearSVC
from sklearn.calibration import CalibratedClassifierCV

# Generate embeddings for your labeled data
train_embeddings = model.encode(train_texts, show_progress_bar=True)
test_embeddings = model.encode(test_texts, show_progress_bar=True)

# Train SVM
svm = LinearSVC(random_state=42, max_iter=10000)
svm.fit(train_embeddings, train_labels)  # labels: 0 = human, 1 = AI

# Calibrate for probability output
calibrated_svm = CalibratedClassifierCV(estimator=svm, cv='prefit')
calibrated_svm.fit(test_embeddings, test_labels)

Full Classification Pipeline

For the complete text-pair classification pipeline (chunking, embedding, SVM, scoring), see the GitHub repository.

A pre-trained SVM classifier is also available: alejandroparbas/voight-kampff-pan2024-classifier

Evaluation Results

When paired with a calibrated Linear SVM, the full pipeline achieves:

Chunk-Level Classification (~64 token chunks)

MetricScore
F1~0.80
Accuracy~0.80

Full Text-Pair Classification (with chunk averaging)

On PAN 2024 test split (with noise):

MetricScore
ROC-AUC0.993
Brier0.924
C@10.951
F10.951
F0.5u0.953
Mean0.955

On external [Kaggle AI vs Human Text](https://www.kaggle.com/datasets/shanegerami/ai-vs-human-text/data) dataset:

MetricScore
ROC-AUC0.948
Mean0.891

Comparison with PAN 2024 Competition Leaderboard

#TeamROC-AUCBrierC@1F1F0.5uMean
1marsan0.9610.9280.9120.8840.9320.924
2you-shun-you-de0.9310.9260.9280.9050.9130.921
3baselineavengers0.9250.8690.8820.8750.8690.886
-Baseline0.7510.7800.7340.7200.7200.741
Note: Our results are evaluated on our own test split and are not directly comparable to the official competition leaderboard.

Training Metrics

EpochStepTraining LossValidation LossCosine Accuracy
2.77785005.00515.00430.4734
5.555610005.00084.99690.5029
8.333315004.99024.98040.5650
11.111120004.9534.86450.7361
13.888925004.76924.57410.8066
16.666730004.48974.25320.8212
19.444435004.23944.06440.8324

Limitations

  • —English only: The base model and training data are in English. Performance on other languages is not guaranteed.
  • —Short texts: Works best on texts long enough to produce multiple ~64 token chunks. With only 1-2 chunks, downstream classification accuracy is ~80%.
  • —Requires downstream classifier: This model produces embeddings, not classifications directly.
  • —Evaluation caveat: Results are on our own test split, not the official PAN 2024 evaluation set.

Authors

  • —Alejandro Pardo Bascuñana - Universidad Politécnica de Madrid
  • —Pedro Amaya Moreno - Universidad Politécnica de Madrid

Developed as part of the NLP course in the Master's program Aprendizaje Automático y Datos Masivos at UPM (2024-2025).

Citation

bibtex
@misc{pardo2025voightkampff,
  title={Voight-Kampff: Contrastive Embedding Learning for AI-Generated Text Detection},
  author={Pardo-Bascu{\~n}ana, Alejandro and Amaya-Moreno, Pedro},
  year={2025},
  url={https://github.com/Alejandro-Pardo/voight-kampff-pan2024/}
}

Links