arXiv:2605.01596cs.CL2026-05ACL被引 1

微调代码大模型提升生成代码检测准确率

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

  • 针对不同任务设计专用微调策略,融合数据增强与集成方法
  • 在子任务A中达到0.737的宏平均F1,排名前6%;子任务B为0.422,排名前20%
  • 适用于需要精准识别生成代码来源的研究与安全检测场景

本文介绍团队Archaeology提交至SemEval-2026第13任务(AI生成代码检测)的系统。该任务包含三个子任务,本文参与子任务A(人类写作与AI生成代码的二分类)和子任务B(11类生成模型归属)。从TF-IDF与逻辑回归基线出发,分别对CodeBERT、GraphCodeBERT、UniXcoder和CodeT5+四款预训练代码模型进行微调,采用不同策略应对各子任务。子任务A使用留一语言交叉验证、代码增强、分块推理与截尾均值聚合,以及在困难数据集上进行阈值校准;子任务B采用夹心标记打包、类别平衡损失函数,以及多种子集成与测试时增强。最佳提交在子任务A取得0.737的宏平均F1(81支队伍中第6),子任务B为0.422(34支队伍中第7)。

原文摘要 · Abstract (English)

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生成NLP

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。