A fine-tuned sentence embedding model for
AI-generated text detection, built for the
Voight-Kampff Generative AI Shared Task (PAN @ CLEF 2024).
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).
1from sentence_transformers import SentenceTransformer
2
3model = SentenceTransformer(
4 'alejandroparbas/voight-kampff-pan2024-gte-en-v1.5',
5 trust_remote_code=True
6)
7
8texts = [
9 "A chunk of human-written text...",
10 "A chunk of AI-generated text..."
11]
12
13embeddings = model.encode(texts)
The embeddings can be used to train any classifier. We use a calibrated Linear SVM:
1from sklearn.svm import LinearSVC
2from sklearn.calibration import CalibratedClassifierCV
3
4# Generate embeddings for your labeled data
5train_embeddings = model.encode(train_texts, show_progress_bar=True)
6test_embeddings = model.encode(test_texts, show_progress_bar=True)
7
8# Train SVM
9svm = LinearSVC(random_state=42, max_iter=10000)
10svm.fit(train_embeddings, train_labels) # labels: 0 = human, 1 = AI
11
12# Calibrate for probability output
13calibrated_svm = CalibratedClassifierCV(estimator=svm, cv='prefit')
14calibrated_svm.fit(test_embeddings, test_labels)
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
1@misc{pardo2025voightkampff,
2 title={Voight-Kampff: Contrastive Embedding Learning for AI-Generated Text Detection},
3 author={Pardo-Bascu{\~n}ana, Alejandro and Amaya-Moreno, Pedro},
4 year={2025},
5 url={https://github.com/Alejandro-Pardo/voight-kampff-pan2024/}
6}