LAFED at SemEval-2026 Task 13: Language-Agnostic Feature Engineering for Cross-Lingual AI-Generated Code Detection
Summary
LAFED (Language-Agnostic Feature Engineering Detector) addresses the challenge of robustly detecting AI-generated source code across diverse programming languages, particularly when facing language-specific cues and distribution shifts. This feature-engineering approach was trained on Python, Java, and C++ code, then evaluated on a multilingual test set including unseen languages like C, C#, Go, JavaScript, and PHP. LAFED integrates three types of features: structural skeletal features (indentation, control-flow density, and approximations of McCabe/Halstead complexity), character and whitespace statistics inspired by stylometry, and micro-style patterns such as operator spacing and indentation consistency. Utilizing XGBoost with Optuna hyperparameter search, the best model achieved a macro-F1 score of 0.7570 on a 1,000-sample test set. The official submission secured 5th place in SemEval-2026 Task 13 Subtask A with a macro-F1 of 0.75209, demonstrating strong transfer to C# (0.7753) and JavaScript (0.7683), though performance was weaker on Go (0.6400) and PHP (0.5238).
Key takeaway
For AI Security Engineers tasked with identifying AI-generated code across multiple programming languages, you should consider implementing language-agnostic feature engineering. This approach, which uses structural, stylometric, and micro-style patterns, offers robust cross-lingual transferability, even to unseen languages. Focus on features like control-flow density and indentation consistency, as these proved effective. Your detection systems can achieve strong performance, as demonstrated by LAFED's macro-F1 of 0.7570, but be aware of varying performance across different target languages like Go and PHP.
Key insights
Language-agnostic feature engineering can effectively detect AI-generated code across diverse programming languages, even unseen ones.
Principles
- Stylometric features aid cross-lingual detection.
- Structural complexity metrics are transferable.
- Micro-style patterns reveal generation artifacts.
Method
LAFED combines structural skeletal features, character/whitespace statistics, and micro-style patterns, then trains an XGBoost model with Optuna for hyperparameter optimization to detect AI-generated code.
In practice
- Apply stylometry to code authorship tasks.
- Use XGBoost for feature-rich classification.
- Evaluate transfer learning on unseen languages.
Topics
- AI-Generated Code Detection
- Cross-Lingual Transfer
- Feature Engineering
- Stylometry
- XGBoost
- SemEval-2026 Task 13
Best for: AI Engineer, 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.