Search papers, labs, and topics across Lattice.
This paper addresses the challenge of detecting machine-generated code by introducing a novel approach called Single-pass Autoregressive LLM Structured Classification (SALSA), which maps code snippets to dedicated output tokens for binary classification. The method emphasizes out-of-distribution generalization by employing balanced sampling and conservative training techniques, allowing the model to effectively handle unseen programming languages and application domains. The results demonstrate a significant improvement in detection accuracy, achieving an OOD F1 score of 0.789, far surpassing the baseline performance of CodeBERT at 0.305.
Achieving an OOD F1 score of 0.789, this method dramatically outperforms existing models in detecting machine-generated code across diverse programming languages.
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$).