SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2301.11305 · ICML · 2023

DetectGPT: Zero-Shot Machine-Generated Text Detection using Probability Curvature

Chelsea Finn, Christopher Manning, Yoonho Lee, Eric Mitchell, Alexander Khazatsky

arXiv · PDF · Open in the Atlas

Code that ran

5 of 9 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (0 of them constructed an object rather than computing a result; 1 honoured the contract we drafted, 2 violated it and 2 have no contract verdict; 0 failures of our instrument; 4 no recorded run); 1 of them was also run on the host, not in the jail, by the peer-agreement lane that set its level, measured 2026-11-23; repository links from the Papers with Code archive attributed under CC BY-SA, no affiliation; bodies inline only under a permissive licence as GitHub detects it. Not a reproduction of the paper's results.

"Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results. This record, dated, as JSON: /api/ran/2301.11305.json · badge: /api/ran/2301.11305.svg

Each repository's role is a label: a classifier's output recorded on the link, or, where no role is recorded, what the Papers with Code archive marked. The line under it names its basis. Neither says who wrote the code.

RepositoryRoleRan
eric-mitchell/detect-gpt canonical (classifier label)
classifier basis not recorded on the link
2 ran · 1 no recorded run
BurhanUlTayyab/DetectGPT reimplementation (classifier label)
classifier basis: classifier_2025
3 ran · 1 no recorded run
loris3/evaluation_explanation_quality community
Papers with Code archive
0 ran · 2 no recorded run
FunctionStatusWhere it lives
normCdf Ran
ran, violated the contract we drafted
BurhanUlTayyab/DetectGPT/model.py
code served (permissive licence) · get_code("3e5aae6e8479eaf6")
How it ran

Ran in Syntology's jail on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1) and returned ndarray, ndim 1, dtype family float, shape (4,) as a later run recorded it. The image it ran in was not recorded. The comparison behind this sample's level is a different run: the peer-agreement lane ran it again on the host, not in the jail (report dated 2026-09-04T23:25:04Z). If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import numpy as np
from scipy.stats import norm

torch.manual_seed(0)

# The function normCdf takes a single parameter x and returns norm.cdf(x)
# x can be a scalar, array, or tensor - scipy.stats.norm.cdf handles all these

# Create a small test input - using a numpy array
x_value = np.array([-1.0, 0.0, 1.0, 2.0])

ARGS = {
    "x": x_value
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
numpy, scipy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ndarray, ndim 1, dtype family float, shape (4,) — shape (4,) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
likelihoodRatio Ran
ran, violated the contract we drafted
BurhanUlTayyab/DetectGPT/model.py
code served (permissive licence) · get_code("66c03b65d35bf7c6")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1) and returned ndarray, ndim 1, dtype family float, shape (4,) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import numpy as np
from scipy.stats import norm

torch.manual_seed(0)

# The function likelihoodRatio takes two parameters: x and y
# It computes normCdf(x) / normCdf(y)
# normCdf uses scipy.stats.norm.cdf which accepts scalar or array-like inputs
# We'll use numpy arrays or scalars as arguments

x = np.array([0.5, 1.2, -0.3, 2.1])
y = np.array([0.1, 0.8, -0.5, 1.5])

ARGS = {
    "x": x,
    "y": y
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
numpy, scipy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ndarray, ndim 1, dtype family float, shape (4,) — shape (4,) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
process_prompt Ran
ran on a synthesized input
eric-mitchell/detect-gpt/custom_datasets.py
code served (permissive licence) · get_code("a9123b58146ec27b")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned str. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch

torch.manual_seed(0)

ARGS = {
    'prompt': '[ WP ] This is a writing prompt [ OT ] with some text'
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
process_spaces Ran
ran on a synthesized input
eric-mitchell/detect-gpt/custom_datasets.py
code served (permissive licence) · get_code("2b3a1c3191857159")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned str. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

# Setup code for process_spaces function

ARGS = {
    'story': "Hello world , this is a test . What do you think ? Great ! Here's an example ; it's working ( nicely ) . The word n't should work . i am here and i'm good . Replace `` quotes '' and .. dots . Replace ' apostrophes too .<newline>New line here ."
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
similar Ran
ran, honoured the contract we drafted
BurhanUlTayyab/DetectGPT/model.py
code served (permissive licence) · get_code("5e4b02e5bc753357")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1) and returned float, ndim 0, dtype family float, shape () as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

from difflib import SequenceMatcher

# The similar function takes two arguments (a, b) and compares them using SequenceMatcher
# SequenceMatcher works with any sequence type (strings, lists, etc.)
# We'll use strings as they're the most common use case

a = "hello world"
b = "hello there"

ARGS = {
    "a": a,
    "b": b,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type float, ndim 0, dtype family float, shape () — shape () as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
Detector Not yet run
unverified (harvested, no recorded run)
loris3/evaluation_explanation_quality/detector_detectgpt.py
pointer only (licence: CC-BY-SA-4.0) · get_code("4e2699cf133844a3")
How it ran

The body of this sample is withheld: CC-BY-SA-4.0, as GitHub detects it on this paper's repository, loris3/evaluation_explanation_quality, is not in the permissive set Syntology serves inline. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. No invocation recorded.

DetectorDetectGPT Not yet run
unverified (harvested, no recorded run)
loris3/evaluation_explanation_quality/detector_detectgpt.py
pointer only (licence: CC-BY-SA-4.0) · get_code("66355c7f76566633")
How it ran

The body of this sample is withheld: CC-BY-SA-4.0, as GitHub detects it on this paper's repository, loris3/evaluation_explanation_quality, is not in the permissive set Syntology serves inline. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. No invocation recorded.

GPT2PPLV2 Not yet run
unverified (harvested, no recorded run)
BurhanUlTayyab/DetectGPT/model.py
code served (permissive licence) · get_code("297d4d0040856424")
How it ran

no invocation recorded.

load_pubmed Not yet run
unverified (harvested, no recorded run)
eric-mitchell/detect-gpt/custom_datasets.py
code served (permissive licence) · get_code("14beed14f0519675")
How it ran

no invocation recorded.

Also present in other papers' code

Of 9 samples lifted from this paper's linked repositories, 9 carry a function identity and 0 do not. Of the 9 distinct functions with an identity, 4 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 4 later) and 5 are only here among the 52,977 papers whose code Syntology holds (as of 2026-09-26).

Only here means: among the 52,977 papers whose code Syntology holds (51,887 with lifted samples, 1,090 through their assemblies only), as of 2026-09-26, no other paper's lifted samples or current assembly bricks contain an identical function body after normalisation.

FunctionAlso present inEarliest-datedOthers named
similar 6 other papers
6 later
2305.00909 (2023-05)
Outline, Then Details: Syntactically Guided Coarse-To-Fine Code Generation
2310.05914 (2023-10)
NEFTune: Noisy Embeddings Improve Instruction Finetuning
2404.04269 (2024-04)
Algorithmic Collective Action in Recommender Systems: Promoting Songs by Reordering Playlists
and 3 more not named here
load_pubmed 2 other papers
2 later
2305.19713 (2023-05)
Red Teaming Language Model Detectors with Language Models
2402.17012 (2024-02)
Pandora's White-Box: Precise Training Data Detection and Extraction in Large Language Models
process_prompt 1 other paper
1 later
2305.19713 (2023-05)
Red Teaming Language Model Detectors with Language Models
process_spaces 1 other paper
1 later
2305.19713 (2023-05)
Red Teaming Language Model Detectors with Language Models

Presence, not direction: an identical function body in two papers' repositories does not say who wrote it, which came from which, or that either paper's method rests on it. Matching is exact after normalisation, so a renamed or edited function is not matched. Dates are when papers appeared, not when code was written. Only .py files the harvester lifted are covered; notebooks are not read. A new-style arXiv id YYMM.NNNN dates a paper to the month 20YY-MM; otherwise Paper.year dates it to the year; otherwise it is undated. Dates are when the paper appeared, not when the code was written. Read 2026-11-23.

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

The increasing fluency and widespread usage of large language models (LLMs) highlight the desirability of corresponding tools aiding detection of LLM-generated text. In this paper, we identify a property of the structure of an LLM's probability function that is useful for such detection. Specifically, we demonstrate that text sampled from an LLM tends to occupy negative curvature regions of the model's log probability function. Leveraging this observation, we then define a new curvature-based criterion for judging if a passage is generated from a given LLM. This approach, which we call DetectGPT, does not require training a separate classifier, collecting a dataset of real or generated passages, or explicitly watermarking generated text. It uses only log probabilities computed by the model of interest and random perturbations of the passage from another generic pre-trained language model (e.g., T5). We find DetectGPT is more discriminative than existing zero-shot methods for model sample detection, notably improving detection of fake news articles generated by 20B parameter GPT-NeoX from 0.81 AUROC for the strongest zero-shot baseline to 0.95 AUROC for Detect-GPT. See ericmitchell.ai/detectgpt for code, data, and other project information.

For agents

The same record, over MCP at https://syntology.ai/mcp:

get_harvested_code_for_paper("2301.11305")
get_code_for_paper("2301.11305")
have("2301.11305")

The run record, dated, one paper per request, free:

curl https://syntology.ai/api/ran/2301.11305.json

A badge for a README (the split and the date, never a ratio):

[![Syntology run record](https://syntology.ai/api/ran/2301.11305.svg)](https://syntology.ai/paper/2301.11305)

Connect an agent — have() is free.