首页›Ahead of AI›文章

Building an AI Text Detector From Scratch

Sebastian Raschka, PhD · 2026年8月15日

AI 摘要 AI 生成,可能有误

本文提供了一份教学教程,讲解如何通过微调 DistilBERT 分类器从零开始构建 AI 文本检测器,该分类器输出一个 0-100 之间的分数,用于估计某段文本由 AI 生成的可能性,其思路类似于 Substack 新推出的 AI 检测功能背后的方法。该检测器还可作为验证器,用于训练一个小型语言模型生成能够避开检测的文本,由此展示了 AI 检测“猫鼠游戏”般的特性、其诸如误报之类的局限性,以及基于验证器的 LLM 应用这一更广泛的概念。这个端到端的项目包括评估、训练,以及通过 API 和用户友好的浏览器界面进行本地部署。

Substack recently launched its AI detector feature in the UI, which is super interesting.

Separately, lots of people asked me about interesting local do-it-yourself LLM projects as demos to show what small language models (SLMs) are capable of.

Putting one and one together, I thought it would be interesting to show how an AI detector can be implemented. I will also use it as a verifier to train a small language model to produce text that avoids detection. This is a small educational project for studying the limitations of AI detectors and exploring a verifier-based LLM application beyond regular reasoning models trained on math and code.

继续阅读全文

为了尊重作者,这里只展示开头几段。你可以去原文阅读,或者在 HorizonReader 里读:划线做笔记、让 AI 帮忙。

更多来自 Ahead of AI

Understanding Positional Embeddings in Modern LLMs

AI 摘要This article is a detailed tutorial on how LLMs encode token position information, explaining why explicit positional signals are needed (beyond the implicit order given by causal attention masks) and walking through methods like GPT-2's learned absolute position embeddings, the original transformer's fixed sinusoidal encodings, and RoPE, illustrated with visuals, math, and PyTorch code. The author also previews which positional encoding approaches are used in 2026 open-weight model architectures. The article serves as a standalone foundational reference, motivated by reader requests for a RoPE tutorial and as preparation for an upcoming analysis of modern LLM architecture trends.

Building Reasoning Models from the Ground Up: A Full Video Course

AI 摘要The author announces an 11-hour, eight-video course that builds a reasoning model from scratch in Python and PyTorch, starting from a pre-trained Qwen3 model and covering evaluation with a math verifier, inference-time scaling techniques like sampling, self-consistency, and self-refinement, and reinforcement learning with verifiable rewards using GRPO. The videos accompany his book 'Build a Reasoning Model (From Scratch)' and require comfort with Python and PyTorch, with a GPU recommended for the training-focused later videos. He also explains that reasoning models act as the 'engine' inside agent harnesses, making them essential for understanding modern LLM-based agents.

Language Models for Text Classification: From Bag-of-Words to Jev

AI 摘要This article analyzes the newly released Jev AI model, positioning it as a fast and inexpensive text classifier that bridges the gap between general-purpose LLMs and narrow task-specific classifiers. To demystify the hype, the author traces the history of language models for text classification, from bag-of-words representations with classic methods like naive Bayes and logistic regression, through word embeddings and recurrent neural networks such as LSTMs, up to transformer-era approaches. The author concludes that while Jev is essentially a text classifier, it is more general and capable than its simple predecessors, which explains its recent popularity.

GPT-6 Astra, Looped Transformers, and Hidden Reasoning

AI 摘要The article reviews OpenAI's newly released GPT-6 Astra, describing it as the best model the author has used, with standout performance in 3D rendering, animation, and computer-use tasks, and explaining how computer-use skills are trained via reinforcement learning in macOS environments. It then explains 'looped transformers' (recurrent depth), an architecture in which intermediate representations pass through the same transformer blocks multiple times with shared weights, an idea dating back to Universal Transformers (2018). Finally, it examines whether this looped design relates to rumors that Astra conceals its chain-of-thought reasoning trace.

How Claude Watermarks AI-Generated Text

AI 摘要The author expands on a popular social media post by creating a detailed 48-minute video lecture (with over 50 slides and a transcript) explaining how Anthropic's new watermarking for Claude-generated text works. The lecture first covers how LLM text generation functions under the hood—tokenization, score distributions, and next-token sampling—to show that watermarking is a minor tweak within the normal generation process. The goal is to help readers understand how the invisible watermark is embedded, why it can fail or be removed, and its pros and cons.