Sebastian Raschka、AI テキスト検出器の自作と SLM の学習手法を公開
本文の状態
日本語全文を表示中
詳細モードで約5分の本文を読めます。
同じ出来事の情報源
この情報源を基点に整理
Sebastian Raschka
Sebastian Raschka は、Substack の新機能に触発され、AI テキスト検出器をゼロから構築するチュートリアルと、それを検証者として用いた小規模言語モデルの学習プロジェクトを発表した。
AI深層分析を開く2026年8月15日 21:10
AI深層分析
キーポイント
教育目的での検出器構築
このプロジェクトは、AI チェッカーがどのように機能するかを説明し、評価、トレーニング、ローカルデプロイを含むエンドツーエンドの LLM プロジェクトを示すことを主眼としている。
検出回避による検証者としての活用
著者は構築した検出器を検証者として使用し、検出を回避するテキストを生成する小規模言語モデル(SLM)をトレーニングする実験を行う予定である。
AI チェッカーの限界と猫とネズミゲーム
記事は AI チェッカーが特定のパターンを検知する一方で、次世代 LLM がそのパターンを回避して検出をすり抜ける可能性があり、常に偽陽性のリスクも伴うことを指摘している。
実用的な用途の提案
AI チェッカーはスパムフィルタとしてだけでなく、文章が AI 生成物とみなされないようgrammarチェックを行う際にも利用可能であり、人間による執筆品質を維持するツールとなり得る。
検出手法の概要とスコアリング
本プロジェクトでは、AI生成テキストの確率を示す0-100のスコアを返す分類器を構築する。このスコアは学習分布に基づくAI生成クラスの推定確率であり、一般的なAI作成確率として解釈すべきではない。
重要な引用
The overarching goal is, of course, to illustrate how AI detectors work and show an applied end-to-end LLM project including evaluation, training, and local deployment for real-world use.
AI checkers are essentially a cat-and-mouse game. AI checkers may learn to detect a certain pattern that is indicative of AI-generated content. Then, the next LLM may incidentally or deliberately not exhibit that pattern and avoid detection.
The probability score will denote how likely a text is AI-generated according to the classifier.
However, we shouldn't interpreted it as a general probability that the text was written by AI.
編集コメントを表示
編集コメント
この記事は、AI テキスト検出技術のブラックボックス化を避け、その仕組みを教育目的で開示する意義深い試みである。開発者にとって、検出と回避の攻防を理解し、より健全な AI エコシステムを構築するための実践的な指針となる内容だ。
Source Article
元記事を日本語で読む
本文に関係しない購読案内、埋め込み通知、サイト内プロモーションは除いています。
Substack が最近、UI に組み込んだ AI 検出機能をリリースしました。これは非常に興味深い動きです。
一方、多くの人が「小さな言語モデル(SLM)が何を実現できるか」を示すデモとして、ローカルで動作する DIY の LLM プロジェクトについて質問を寄せていました。
これらを組み合わせることで、AI 検出器を実装する方法を紹介してみようと思いました。また、この検出器を検証ツールとして活用し、検出を回避できるテキストを生成するように小さな言語モデルを訓練することも目指します。これは AI 検出器の限界を探求する教育的なプロジェクトであり、数学やコードに特化した推論モデルを超えた、検証ベースの LLM アプリケーションの可能性を探る試みでもあります。

図 1: Substack には、組み込みの AI 検出機能が搭載されています。
前述した通り、このチュートリアルの目的は、(シンプルな)AI 検出器を構築することで、その仕組みを解説することです。
実用上、こうした検出器はスパム性の高いコンテンツをフィルタリングするだけでなく、AI 生成の文章に仕立て上げるのではなく、個人のライティング品質を向上させるためにも活用できます。例えば、長文の記事を書いた後にスペルや文法の改善を図りたい場合、読みやすさを高めるために文法チェックツールを使うのは自然な発想であり、実際に有用です。これには一般向けの LLM(大規模言語モデル)である ChatGPT なども含まれます。
しかし、こうしたツールの利用にはリスクも伴います。たとえ文章が著者自身のものだったとしても、過度に磨き上げられてしまい、AI が生成したような不自然な響きになってしまい、スパムとして検出されてしまう恐れがあるのです。
例えば、「文法は修正するが、AI 生成スコアは 0% のまま保つように」と指示して AI チェッカーを使うことも可能です。
さて、ここでは完全機能的なチェックツールを構築しますが、主な目的は 1) AI チェッカーが(どのように)動作するかを解説すること、そして 2) LLM と併用できるスコアラーや検証器をどう構築するかという、より一般的なテーマのケーススタディとしてこのプロジェクトを活用することです。
免責事項:AI チェッカーは本質的に「猫と鼠」のゲームです。検出側が AI 生成コンテンツの特徴的なパターンを学習して検知できるようになると、次の世代の LLM はそのパターンを意図的・偶発的に回避し、検出をすり抜けるようになります。すると AI チェッカーは新たな LLM の検出に対応するよう更新され、また次の展開へと続いていきます。さらに、誤検知(人間が書いた文章が AI 生成と判定されるケース)も避けられないでしょう。これについては後ほど詳しく説明します。
プロジェクトの目標
このプロジェクトには複数の目的があります。最大の目標は、AI 検出器がどのように動作するかを解説し、評価、トレーニング、そして実世界での利用に向けたローカル展開を含む、適用可能なエンドツーエンドの LLM プロジェクトを示すことです。
その成果として、人間やエージェントが利用できる AI 検出 API と、使いやすいユーザーインターフェース(UI)が生まれます。

図 2: このプロジェクトの後半で開発するローカルブラウザインターフェースのプレビューです。全文に対する AI スコアを返すだけでなく、個々のテキストチャンクごとのスコアもハイライト表示できます。
手法の概要
ここでは、私が知る限りでは Substack の AI 検出機能の背後にある「Pangram モデル」に似た手法を開発します。
私は以前、2023 年に AI テキスト検出に関する短い記事を書いています。そのタイトルは『ChatGPT などの LLM で生成されたコンテンツを検出するための異なるアプローチとは何か?それらはどのように機能し、どう違うのか?』です。
本質的に、AI による文章を検出する方法はいくつか存在します。教師あり分類器や摂動に基づく確率テストから、パープレキシティ(不確かさ)の測定、ウォーターマーキングに至るまで、多様なアプローチがあります。
このチュートリアルでは、0 から 100 のスコアを返すモデルを作成します。これは本質的に、推定確率スコアを持つ分類器です。このスコアは、テキストが AI によって生成された可能性が高いかどうかを示す指標となります。
厳密に言えば、このスコアは学習データに基づいた分類器による「AI 生成クラス」の推定確率ですが、これを「テキストが人間ではなく AI によって書かれたという一般的な確率」として解釈するのは避けるべきです。
これを実現するために、DistilBERT クラスファインチューニングを行います(これは私が以前執筆した Substack 記事「大規模言語モデルのファインチューニング」で説明したものと同様の手法ですが、詳細は後述します)。
続きを読む
原文を表示
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.

Figure 1: Substack now features a built-in AI detector.
So, as mentioned above, the intended goal of this tutorial is to explain how AI detectors work by building (a simple) one.
In practice, such a detector can be used to filter out spammy content, but also to potentially improve your personal writing without turning it into AI-generated text. For example, if you wrote a lengthy article and want to improve spelling and grammar, it is tempting (and actually useful) to use a grammar checker to polish it and improve readability. There are different services for that, including general-purpose LLMs like ChatGPT. However, this also runs the risk that these tools turn your writing, even though it’s still your own writing, into something that is then overpolished and now sounds like AI and gets flagged as spammy content.
For example, with an AI checker, one could say, “Fix my grammar while ensuring that my text still scores 0% AI-generated.”
Anyway, while we are building a fully functional checker here, the goal is to explain 1) how AI checkers (can) work and 2) use this as a case study for a more general topic on how to build a scorer or verifier that can be used with LLMs.
Disclaimer: AI checkers are essentially a cat-and-mouse game. AI checkers may learn to detect a certain pattern that is indicative of AI-generated content. Then, the next LLM may incidentally or deliberately not exhibit that pattern and avoid detection. The AI checker then has to be updated to detect said LLM, and so forth. Plus, it’s also likely to encounter false positives (human written text flagged as AI-generated), but more on that later.
Project goals
There are several goals of this project. The overarching goal is, of course, to illustrate how AI detectors work and show an applied end-to-end LLM project including evaluation, training, and local deployment for real-world use.
The outcome of this is an AI-detector API that can be used by humans and agents, and a user-friendly UI.

Figure 2: Preview of the local browser interface developed later in this project. It returns a whole-text AI score and can also highlight the scores for individual text chunks.
Method overview
Here, we are going to develop a method similar to Pangram models, which, as far as I know, are behind Substack AI detection feature.
I wrote a short article about AI-text detection a while back in 2023: What Are the Different Approaches for Detecting Content Generated by LLMs Such As ChatGPT? And How Do They Work and Differ?
In essence, there are different ways to detect AI-written text, from supervised classifiers and perturbation-based probability tests to perplexity measures and watermarking.
In this tutorial, we will build a model that returns a 0-100 score. It’s essentially a classifier with an estimated probability score. The probability score will denote how likely a text is AI-generated according to the classifier. (Or, to be precise the score is the classifier’s estimated probability for the AI-generated class based on its training distribution. However, we shouldn’t interpreted it as a general probability that the text was written by AI.)
For this, we are going to fine-tune a DistilBERT classifier (similar to what I described in one of my early Substack articles, Finetuning Large Language Models), but more details on that later when we get to that stage.
Read more
News to Guide
ニュースの次に確認する
発表内容を、現在の料金や仕様と照らし合わせられる関連ガイドです。
今日のまとめ
AIデイリーブリーフで今日の重要ニュースをまとめ読み