paperbot · PL 论文追踪

全部论文 待读 收藏

Code Detectors Have a Half-Life: Obsolescence and Metric Illusions in LLM-Generated Code Detection

代码检测器也有半衰期:LLM 生成代码检测中的过时性与指标幻觉
ASE Proceedings of the 41st IEEE/ACM International Conference on Automated Software Engineering2026引用 0 inbox
Alberick Euraste Djire
crossref: 2026-10-09

AI 速览

一句话:跨生成器评估表明专用代码检测器会迅速过时且高准确率可掩盖严重预测偏差,通用 LLM 判定器更具前景。

论文指出代码检测器会随代码生成模型演进而过时,即存在“检测器半衰期”:在一个模型世代上验证的检测器未必能迁移到下一代。作者在 C++、Java、Python 三种语言上,以人类代码与七种生成器产生的代码为样本,评估了八个通用 LLM 判定器和三个专用检测器。结果暴露两个问题:其一,性能随生成器与提示策略大幅波动,说明部分检测器依赖生成器特有模式而非通用的代码来源证据;其二,准确率可能掩盖严重的预测偏差——DetectCodeGPT 与 GPT-Sniffer 在所有生成器上准确率虽为 0.50,但 F1 为 0.00,因为它们几乎把所有样本都判为 AI 生成。相比之下,通用 LLM 判定器取得了更高的准确率与 F1。作者认为通用 LLM 是有前景的免训练代码来源判定器,但其可靠性取决于判定模型、代码生成器与提示策略,因此建议跨多个生成器评估,并同时报告 macro-F1 与各类别的精确率和召回率。

问题
代码来源检测器可能随生成模型演进而失效,且单一准确率指标会掩盖严重的类别预测偏差,现有评估往往只在单一生成器上验证。
方法
在 C++、Java、Python 上,用人类代码和七种生成器的产出,评估八个通用 LLM 判定器与三个专用检测器的检测性能,并分析生成器、提示策略与指标选择的影响。
评估
通过跨生成器、跨提示策略的实验对比准确率、F1、macro-F1 及类别精确率/召回率,揭示检测器依赖生成器特有模式以及准确率掩盖预测偏差的现象。
原文摘要(Abstract)

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.

链接与引用

DOI 原文 · arXiv ·

BibTeX
@inproceedings{paperbot12543,
  title = {Code Detectors Have a Half-Life: Obsolescence and Metric Illusions in LLM-Generated Code Detection},
  author = {Alberick Euraste Djire},
  booktitle = {ASE},
  year = {2026},
  doi = {10.1145/3832783.3844566}
}