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

用轻量特征检测大模型生成的代码,速度快且无需GPU。

FMI_SU_Yotkova_Kastreva at SemEval-2026 Task 13: Lightweight Detection of LLM-Generated Code via Stylometric Signals

论文配图:FMI_SU_Yotkova_Kastreva at SemEval-2026 Task 13: Lightweight Detection of LLM-Generated Code via Stylometric Signals
图 1 · 摘自论文原文
  • 设计长度无关的比率特征,提升检测鲁棒性。
  • 结合解析器与分类器,捕捉代码风格差异。
  • 仅需CPU即可实时推理,适合资源受限场景。

SemEval-2026 Task 13 聚焦多语言、多场景下的机器生成代码检测,要求系统具备对未见语言和领域的泛化能力。本文报告我们在子任务A(二分类)中的参与,探索预训练代码编码器与轻量级特征方法。提出基于比率的特征,降低代码片段长度带来的干扰。为提取描述性信号,引入解析引擎与编程语言分类器;另训练代码-文本行分类器,识别嵌入样本中的自然语言段落。最终采用浅层决策树结合数据驱动的启发式规则进行预测。该方法计算开销低,仅需CPU训练,推理速度接近实时,是大型预训练模型的轻量替代方案。

原文摘要 · Abstract (English)

SemEval-2026 Task 13 investigates machine-generated code detection across multiple programming languages and application scenarios, asking participating systems to generalize to unseen languages and domains. This paper describes our participation in Subtask A (binary classification) and explores both pretrained code encoders and lightweight feature-based methods. We design ratio-based features that are less sensitive to snippet length. To support the extraction of descriptiveness-related signals, we use parsing engines and a programming-language classifier. Additionally, we train a separate code-vs-text line classifier to identify raw natural language segments embedded within samples. We combine a shallow decision tree with heuristic rules derived from data analysis to produce the final predictions. Our approach is computationally efficient, requires only CPU resources for training, and achieves near-instant inference time, offering a lightweight alternative to large pretrained models.

代码生成轻量检测风格分析

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