Beyond Fixed-Context Likelihood: Zero-Shot AI-Generated Text Detection via Context Perturbation Discrepancy

Yifan Tang, Jingran Li, Yihao Wang, Zhen Yang, Jianyi Liu +2 more
11/24/2026
cs.CL

Official code: BUPT-tyf/CPD (0 stars, Python, last commit 2026-11-24).

Abstract

The same increase in token log probability from earlier context can be typical at one position and unusually large at another. We introduce Context Perturbation Discrepancy (CPD), a zero-shot detector that measures this gain relative to what a single pretrained language model expects.

Show full abstract

Keeping the passage fixed, CPD scores each observed token under its full prefix and under a short window of recent tokens. Under the full-prefix distribution, the expected gain equals the KL divergence from that distribution to the restricted-prefix distribution. CPD subtracts this expectation from each observed gain and scales the sum of the signed deviations by its analytical reference standard deviation. On unedited human and AI texts from GEN, DetectRL-X, and HART, subtracting the expected gain raises AUROC by 32.78-35.81 percentage points at the same variance scale. CPD outperforms seven zero-shot baselines, averaging 94.80% AUROC and 79.60% recall at a 5% false-positive rate. On original and edited HART passages, the same scores separate texts more clearly by draft origin than by the benchmark's final-expression labels (89.15% versus 65.50% AUROC). Code is available at https://github.com/BUPT-tyf/CPD.

View on arXivView PDF

Code Implementations(1)

BUPT-tyf/CPDOfficial100%

CPD code & data

00PythonNov 24, 20261 weeks ago

Similar Papers

Cite this paper

@article{tang2026beyond,
  title  = {Beyond Fixed-Context Likelihood: Zero-Shot AI-Generated Text Detection via Context Perturbation Discrepancy},
  author = {Yifan Tang and Jingran Li and Yihao Wang and Zhen Yang and Jianyi Liu and Gongshen Liu and Ru Zhang},
  year   = {2026},
  eprint = {2611.32778},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2611.32778v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2611.32778.svg)](https://codeofpaper.com/paper/2611.32778)

Discussion