一句话:跨生成器评估表明专用代码检测器会迅速过时且高准确率可掩盖严重预测偏差,通用 LLM 判定器更具前景。
论文指出代码检测器会随代码生成模型演进而过时,即存在“检测器半衰期”:在一个模型世代上验证的检测器未必能迁移到下一代。作者在 C++、Java、Python 三种语言上,以人类代码与七种生成器产生的代码为样本,评估了八个通用 LLM 判定器和三个专用检测器。结果暴露两个问题:其一,性能随生成器与提示策略大幅波动,说明部分检测器依赖生成器特有模式而非通用的代码来源证据;其二,准确率可能掩盖严重的预测偏差——DetectCodeGPT 与 GPT-Sniffer 在所有生成器上准确率虽为 0.50,但 F1 为 0.00,因为它们几乎把所有样本都判为 AI 生成。相比之下,通用 LLM 判定器取得了更高的准确率与 F1。作者认为通用 LLM 是有前景的免训练代码来源判定器,但其可靠性取决于判定模型、代码生成器与提示策略,因此建议跨多个生成器评估,并同时报告 macro-F1 与各类别的精确率和召回率。
Code detectors can become obsolete as code-generating models evolve: a detector validated on one generation of models may not transfer to the next. We call this limited useful life a detector half-life. We evaluate eight general-purpose LLM judges and three dedicated detectors on human-written code and code produced by seven generators across C++, Java, and Python. Our results reveal two problems. First, performance varies considerably across generators and prompting strategies, suggesting that some detectors rely on generator-specific patterns rather than general evidence of code provenance. Second, accuracy can conceal severe prediction bias. DetectCodeGPT and GPT-Sniffer achieved an accuracy of 0.50 but an 𝐹1 score of 0.00 across all generators because they classified almost every sample as AI-generated. However, general-purpose LLM judges achieved stronger accuracy and 𝐹1 scores. Our results show that general-purpose LLMs are promising training-free judges of code provenance and can outperform dedicated detectors. However, their reliability depends on the judge model, the code generator, and the prompting strategy. We therefore recommend evaluating LLM judges across multiple generators and reporting macro-𝐹1 alongside class-specific precision and recall.