用单令牌输出提升代码生成检测的跨语言泛化能力
Dream at SemEval-2026 Task 13: SALSA for Single-Pass Machine-Generated Code Detection

- 将分类结果映射为专属输出令牌,实现单步生成标签
- 在未知语言和领域上达到0.789的F1分数,远超基线
- 适合关注代码版权与生成可信度的研究者
大型语言模型已改变代码生成方式,引发作者归属、评估完整性和软件可信度的担忧。SemEval-2026 Task 13 Subtask A 将检测任务定义为代码片段的二分类问题,特别强调在未见编程语言和应用领域上的分布外(OOD)泛化能力。我们提出一种SALSA式框架——单步自回归大模型结构化分类,将每个类别映射到一个专属输出令牌,训练模型以结构化响应生成单一令牌标签。不依赖人工设计特征或规则,而是将作者归属判断交由模型自主完成。为增强OOD鲁棒性,采用跨语言平衡采样,结合参数高效微调与保守训练策略(低学习率、单轮次),避免对训练域过拟合。最佳系统在官方排行榜上取得OOD F1 = 0.789,显著优于CodeBERT基线(F1 = 0.305)。
原文摘要 · Abstract (English)
Large language models have transformed code generation, raising concerns around authorship, assessment integrity, and software trust. SemEval-2026 Task 13 Subtask A operationalizes detection as binary classification over code snippets, with a particular emphasis on out-of-distribution (OOD) generalization across unseen programming languages and application domains. We propose a SALSA-style formulation, Single-pass Autoregressive LLM Structured Classification, that maps each class to a dedicated output token and trains the model to emit a single-token label in a structured response. Rather than engineering hand-crafted features or decision rules, this formulation delegates the authorship decision to the model. To improve OOD robustness, we combine balanced sampling across languages with parameter-efficient fine-tuning and conservative training (low learning rate, single epoch) to avoid overfitting to the training domain. Our best system achieves OOD $F_1 = 0.789$ on the official leaderboard, substantially outperforming the CodeBERT baseline ($F_1 = 0.305$).
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。