arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2605.01596cs.CL
收藏

针对AI生成代码检测的预训练代码模型微调

Fine-Tuning Pre-Trained Code Models for AI-Generated Code Detection

Human Language Technologies Research Center(人类语言技术研究中心);Faculty of Mathematics and Computer Science(数学与计算机科学系);University of Bucharest(布加勒斯特大学)

Jany-Gabriel Ispas, Sergiu Nisioi

AI总结:

本文提出通过微调四个预训练代码模型,解决AI生成代码二分类和生成模型归因问题,取得较高宏F1分数。

摘要:

本文描述了团队Archaeology在SemEval-2026任务13中提交的系统,该共享任务包含三个子任务。我们参与子任务A(人类编写与AI生成代码的二分类)和子任务B(11类生成模型归因)。从TF-IDF和逻辑回归基线出发,我们分别针对每个子任务微调四个预训练代码模型(CodeBERT、GraphCodeBERT、UniXcoder和CodeT5+)。对于子任务A,我们使用留一语言交叉验证、代码增强、分块推理与截断均值聚合以及在困难数据集上的阈值校准。对于子任务B,我们使用三明治标记打包、类平衡损失和多种子集成与测试时增强。我们的最佳提交在子任务A上获得宏F1分数0.737(第6名/81支队伍),在子任务B上获得0.422(第7名/34支队伍)

英文摘要:

This paper describes the system submitted by team \textbf{Archaeology} to SemEval-2026 Task~13 on AI-generated code detection. The shared task consists of three subtasks; we participate in Subtask-A (binary classification: human-written vs.\ AI-generated code) and Subtask-B (11-class attribution of the generating model). Starting from a TF-IDF and Logistic Regression baseline, we fine-tune four pre-trained code models (CodeBERT, GraphCodeBERT, UniXcoder, and CodeT5+) with separate strategies for each subtask. For Subtask-A, we use leave-one-language-out cross-validation, code augmentation, chunked inference with trimmed-mean aggregation, and threshold calibration on a difficult dataset. For Subtask-B, we use sandwich token packing, class-balanced loss, and multi-seed ensembling with test-time augmentation. Our best submissions obtain macro-F1 scores of 0.737 on Subtask-A (6th/81 teams) and 0.422 on Subtask-B (7th/34 teams).

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑