YNU-HPCC at SemEval-2026 Task 13: Robust Machine-Generated Code Detection under Distribution Shifts
Summary
The YNU-HPCC team developed a system for SemEval-2026 Task 13, focusing on robust machine-generated code detection under distribution shifts, including cross-language, multi-generator, and hybrid scenarios. The system systematically examined three modeling paradigms: encoder-based fine-tuning, feature-based machine learning, and task-specific robustness strategies. For Subtask A (Binary Detection), frozen pre-trained encoders and shallow stylometric features demonstrated superior cross-domain robustness compared to full fine-tuning, with indentation entropy identified as a crucial discriminative signal. Subtask B (Multi-Class Attribution) utilized a hierarchical two-stage framework to separate human–machine discrimination from fine-grained generator attribution, effectively addressing class imbalance. For Subtask C (Hybrid Detection), a token-level splicing augmentation strategy, combined with Supervised Contrastive Learning and Focal Loss, was employed to model intra-sample stylistic variation. The system achieved notable rankings: 12th out of 81 teams in Subtask A, 14th out of 34 in Subtask B, and 8th out of 32 in Subtask C.
Key takeaway
For AI Engineers developing code origin detection systems, prioritize robust strategies against distribution shifts. You should consider using frozen pre-trained encoders and shallow stylometric features, like indentation entropy, for better cross-domain performance. When tackling multi-generator attribution, implement a hierarchical two-stage framework to manage class imbalance effectively. For hybrid code detection, explore token-level splicing augmentation with Supervised Contrastive Learning and Focal Loss to capture stylistic variations.
Key insights
Robust machine-generated code detection benefits from specialized strategies for distribution shifts and class imbalance.
Principles
- Frozen encoders and stylometric features enhance cross-domain robustness.
- Indentation entropy is a key discriminative signal for code origin.
- Decoupling attribution helps manage multi-class imbalance.
Method
A hierarchical two-stage framework for multi-class attribution, and token-level splicing augmentation with Supervised Contrastive Learning and Focal Loss for hybrid detection.
In practice
- Prioritize frozen encoders and stylometric features for cross-domain code detection.
- Implement indentation entropy as a core feature in code analysis.
- Use two-stage attribution for multi-generator code classification.
Topics
- Machine-Generated Code Detection
- Large Language Models
- Code Stylometry
- Distribution Shift Robustness
- SemEval-2026 Task 13
- Supervised Contrastive Learning
Best for: Research Scientist, AI Scientist, Machine Learning Engineer, AI Engineer
Related on AIssential
Editorial summary, takeaway, and curation by AIssential. Original article published by Paper Index on ACL Anthology.