AI-Assisted Code Generation: Semantic and Structural Evaluation on CodeForces C++ Problems | AMiner
AI-Assisted Code Generation: Semantic and Structural Evaluation on CodeForces C++ Problems
Hartawan Bahari Mulyadi,Windi Eka Yulia Retnani,Ratih Nur Esti Anggraini
2025 COMPUTING, COMMUNICATIONS AND IOT APPLICATIONS, COMCOMAP(2025)
Inst Teknol Sepuluh Nopember
被引用0|浏览0
摘要
Reliable evaluation of AI-generated programming code remains a critical challenge due to the dual necessity of ensuring semantic correctness and maintaining structural integrity. Existing evaluation methods often fail to capture both these aspects comprehensively, limiting the understanding of AI code generation quality. To address this gap, we propose a multi-dimensional evaluation framework that integrates semantic similarity metrics derived from CodeBERT with structural complexity analyses based on abstract syntax trees (AST), program dependence graphs (PDG), and control flow graphs (CFG). Our experimental setup involved fine-tuning the CodeT5 model (220 million parameters) on 232 programming language problems sourced from the CodeForces platform, generating a total of 2,320 code samples in C++ language. Semantic evaluation revealed a median CodeBERT similarity score of 81.53, indicating consistent semantic alignment between generated and reference codes. Structural complexity metrics exhibited significant variability, with complexity scores having a median of 91.34. These results illuminate both the strengths and limitations of current AI code generation models, underscoring the need for combined semantic and structural assessments.