ARTFEED — Contemporary Art Intelligence

Building an AI Text Detector From Scratch: A Tutorial

ai-technology · 2026-08-15

So, Sebastian Raschka just posted on Substack about creating an AI text detector from scratch. His motivation comes from the new AI detection feature Substack rolled out. He wants to show how these detectors work and explore their uses with large language models beyond just reasoning. He talks about a method similar to Pangram models, which he thinks is what Substack uses for detection. He aims to improve a DistilBERT classifier that will give a score from 0 to 100 for AI-written content. The guide also shows how to use the detector to train a small language model to avoid being flagged, highlighting the challenges in AI detection and the risk of false positives. Ultimately, he plans to create an API and user-friendly interface for this project.

Key facts

  • Substack recently launched an AI detector feature in its UI.
  • Sebastian Raschka wrote a tutorial on building an AI text detector from scratch.
  • The detector is built using a fine-tuned DistilBERT classifier.
  • The method is similar to Pangram models, which are believed to power Substack's AI detection.
  • The detector returns a 0-100 score indicating the likelihood of AI-generated text.
  • The project also uses the detector as a verifier to train a small language model to avoid detection.
  • The tutorial covers evaluation, training, and local deployment.
  • The outcome includes an AI-detector API and a user-friendly UI.

Entities

Artists

  • Sebastian Raschka

Institutions

  • Substack
  • Pangram

Sources