Hitting a Moving Target: Test-Time Adaptation for AI Text Detection under Continual Distribution Shift

Kevin Ren, Manish Raghavan, Nikhil Garg
6/23/2026
cs.CLcs.AI

Official code: kkr36/llm_detection (0 stars, last commit 2026-06-23).

Abstract

Deployed approaches for AI text detection often rely on training-time access to labeled datasets of both human-written and AI-generated text. This approach is vulnerable to three types of distribution shifts that occur continually post-deployment, and for which labeled data is often unavailable: adversarial humanization, new LLMs being released, and temporal drift in human writing. Simultaneously, existing approaches do not leverage a key signal of LLM usage: inference-time homogeneity. We propose a test-time adaptation (TTA) approach, using semi-supervised learning, that adapts to distribution shifts by leveraging homogeneity among unlabeled samples observed at inference time. Empirically, we find that state-of-the-art supervised detectors systematically fail when they encounter distribution shifts in AI-generated and human writing, both adversarial and natural, while test-time adaptation with semi-supervised learning is largely robust; e.g., the commercial model Pangram detects just 24.1% of our adversarial AI-generated text, compared to 90.5% for our test-time approach. We establish that test-time adaptation is a promising framework for AI text detection in the wild. We publicly release our code (which includes code for model training, evaluation, and plots) at https://github.com/kkr36/llm_detection.

View on arXivView PDF

Code Implementations(1)

00Shell, PythonDec 6, 20254 months ago

Similar Papers

Cite this paper

@article{ren2026hitting,
  title  = {Hitting a Moving Target: Test-Time Adaptation for AI Text Detection under Continual Distribution Shift},
  author = {Kevin Ren and Manish Raghavan and Nikhil Garg},
  year   = {2026},
  eprint = {2606.25152},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2606.25152v1}
}

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/2606.25152.svg)](https://codeofpaper.com/paper/2606.25152)

Discussion