cd /news/ai-safety/show-hn-reproducing-three-ai-text-de… · home › topics › ai-safety › article
[ARTICLE · art-149580] src=github.com ↗ pub= topic=ai-safety verified=true sentiment=· neutral

Show HN: Reproducing three AI text detectors, and why filtering hurt my model

A GitHub repository published by abduldattijo reproduces three AI text detectors — perplexity, near-duplicate similarity, and embedding density — plus a sentiment-classifier evaluation on 600 training reviews (200 source and 400 generated) and 200 held-out test reviews, using GPT-2 and the all-MiniLM-L6-v2 sentence-embedding model downloaded from Hugging Face. The package includes an audit script for Mendeley Data dataset version 1, whose IMDb-extracted reviews are treated as human-written because the collection was published in 2019, before ChatGPT launched publicly, though the collection does not verify each review's author and the audit reports detector flags rather than confirmed AI authorship. The author reports that filtering AI-generated text hurt the downstream sentiment model, and the repository ships the exact generated reviews used in that run because regenerating them would require a model API key and the same model versions while still producing different text.

read2 min views11 publishedOct 12, 2026
Show HN: Reproducing three AI text detectors, and why filtering hurt my model
Image: Michielbdejong (auto-discovered)

This package contains the exact review files and scripts used for the experiment described in the accompanying article. It lets you rerun the detector comparison, the sentiment-classifier evaluation, and (if you download the source archive) the Mendeley collection audit on your own computer.

  • Python 3.11 or newer
  • The packages in requirements.txt
  • About 2 GB of free disk space for the first run, when the pretrained models are downloaded

The first run downloads GPT-2 and the all-MiniLM-L6-v2 sentence-embedding model from Hugging Face. The detector and classifier then run locally. The included review files preserve the exact generated examples used in the reported run, so they can be used directly in the analysis.

Clone the repository, enter its directory, create and activate a virtual environment, then install the dependencies:

git clone https://github.com/abduldattijo/ai-slop-detection-reproduction.git
cd ai-slop-detection-reproduction
python3 -m venv .venv
source .venv/bin/activate
python -m pip install --upgrade pip
python -m pip install -r requirements.txt
mkdir -p outputs

Score the 600 training reviews with all four detector scores (perplexity, near-duplicate similarity, embedding density, and their combined score):

python code/run_experiment.py \
  --data data/reviews_train.jsonl \
  --out outputs/detector_results.json

Train and evaluate the sentiment classifier using the same four data treatments reported in the article:

python code/downstream_eval.py \
  --data data/reviews_train.jsonl \
  --results outputs/detector_results.json \
  --test-data data/reviews_test.jsonl \
  --out outputs/downstream_results.json

The test file contains 200 source reviews kept separate from training. The scripts write their results under outputs/. Compare them with the captured run in reference_outputs/. Small numerical differences can occur across operating systems, hardware, or library versions.

Download version 1 of the source collection from Mendeley Data. Extract Dataset.rar so the extracted directory contains the ten movie folders, then run:

python code/audit_mendeley_collection.py \
  --source-dir /path/to/extracted/Dataset \
  --train data/reviews_train.jsonl \
  --test data/reviews_test.jsonl \
  --out outputs/source_audit.json

The Mendeley reviews are treated as human-written because the collection says they were extracted from IMDb and was published in 2019, before ChatGPT launched publicly. The collection does not verify each review's author. The audit reports detector flags, not confirmed AI authorship. Attribution and license details are in DATASET-ATTRIBUTION.md.

  • data/reviews_train.jsonl : 200 source reviews and 400 generated reviews used to fit and score the detectors and train the classifier.
  • data/reviews_test.jsonl : 200 source reviews reserved for classifier evaluation.
  • code/ : the detector, evaluation, and archive-audit scripts.
  • reference_outputs/ : the saved JSON results used for the article's reported figures and counts.

The exact generated reviews used in the reported run are included in the training file. This package does not regenerate them: doing so requires a model API key, access to the same model versions, and would still produce different text and potentially different results.

── more in #ai-safety 4 stories · sorted by recency
── more on @github 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
→ Live at https://your-agent.zahid.host ✓
Get free account → Pricing
from €0/mo · no card required
LIVE [news/show-hn-reproducing-…] indexed:0 read:2min 2026-10-12 · —