TeamSLS at SemEval-2026 Task 13: Detecting Machine-Generated Code with CodeBERT and Structural Features
Summary
TeamSLS developed a hybrid system for SemEval-2026 Task 13 Subtask A, aimed at detecting whether source code is human-written or AI-generated. Their approach combines semantic embeddings from CodeBERT with language-agnostic structural features extracted using Tree-sitter. These structural signals include normalized ratios such as nesting depth, logic density, complexity per line, average line length, and punctuation frequency. The combined features are fed into a linear classifier for binary prediction. Experimental results demonstrated that integrating semantic and normalized structural representations substantially improved detection performance on seen-language distributions. However, the system experienced significant performance degradation when tested on unseen data under cross-language distribution shifts. On the official leaderboard, TeamSLS's system ranked 47th among 81 participating teams.
Key takeaway
For machine learning engineers developing AI-generated code detection systems, integrating both semantic and structural code features can significantly improve performance on known language distributions. However, you must rigorously test your models for cross-language distribution shifts, as performance can degrade substantially. Prioritize developing robust feature representations or domain adaptation techniques that generalize effectively across diverse programming languages to ensure reliable detection in real-world, multi-language environments.
Key insights
Combining semantic and structural code features improves AI-generated code detection but struggles with cross-language shifts.
Principles
- Hybrid features enhance code detection.
- Structural features can be language-agnostic.
- Cross-language shifts degrade model performance.
Method
Combine CodeBERT semantic embeddings with Tree-sitter extracted structural ratios (nesting depth, logic density, punctuation frequency) into a linear classifier for binary prediction.
In practice
- Extract normalized structural ratios from code.
- Integrate semantic and structural features.
- Test models for cross-language robustness.
Topics
- Machine-Generated Code Detection
- CodeBERT
- Structural Features
- Tree-sitter
- Cross-language Generalization
- SemEval-2026
Best for: Research Scientist, AI Scientist, Machine Learning Engineer, AI Security Engineer
Related on AIssential
Editorial summary, takeaway, and curation by AIssential. Original article published by Paper Index on ACL Anthology.