MedHastra at SemEval-2026 Task 13: Stylometric Ensembles and Transformer Fine-Tuning for Robust AI Code Detection, Attribution, and Adversarial Analysis

· Source: Paper Index on ACL Anthology · Field: Technology & Digital — Artificial Intelligence & Machine Learning, Software Development & Engineering · Depth: Expert, medium

Summary

Team MedHastra's submission to SemEval-2026 Task 13 addressed the detection of machine-generated code across diverse programming languages and generators. The team participated in three subtasks: binary detection of AI-generated code under out-of-distribution conditions (Subtask A), multi-class attribution across ten large language model families (Subtask B), and classification of human, fully AI-generated, hybrid, and adversarial code (Subtask C). For Subtask A, they used a stylometric ensemble with structural formatting and TF-IDF features, trained via Random Forest, Gradient Boosting, and Logistic Regression. For Subtasks B and C, CodeBERT was fine-tuned, incorporating class balancing strategies like downsampling and weighted cross-entropy. Results showed that handcrafted stylometric features performed poorly under strong distribution shifts, while transformer-based contextual modeling proved more effective for fine-grained attribution and hybrid/adversarial code detection.

Key takeaway

For Machine Learning Engineers developing AI code detection systems, prioritize transformer-based models like CodeBERT over traditional stylometric approaches. Your systems will achieve greater robustness for fine-grained attribution across LLM families and better handle hybrid or adversarial code, particularly under out-of-distribution conditions. Ensure you incorporate class balancing techniques during fine-tuning to optimize performance.

Key insights

Transformer-based contextual models outperform stylometric features for robust AI code detection and attribution, especially under distribution shifts.

Principles

Method

For binary detection, combine stylometric features (TF-IDF, structural) with ensemble models (Random Forest, Gradient Boosting, Logistic Regression). For attribution/hybrid, fine-tune CodeBERT with class balancing.

In practice

Topics

Best for: Research Scientist, AI Scientist, Machine Learning Engineer, NLP Engineer

Related on AIssential

Open in AIssential →

Editorial summary, takeaway, and curation by AIssential. Original article published by Paper Index on ACL Anthology.