CMulti-Feature Fusion Method for Programming Exercise Difficulty Assessment Using CodeBERT
摘要
Current studies of programming exercise difficulty assessment often overlook the unique characteristics of programming exercises and fail to explore the implicit relationships between exercise difficulty and various code structure features, leading to insufficient model accuracy. To address these limitations, this paper proposes a Multi-Feature Fusion Method for Programming Exercise Difficulty Assessment Using CodeBERT (MFFD-CodeBERT). This method overcomes the deficiencies of existing techniques in jointly modeling deep semantic and multimodal features of code. Specifically, the pre-trained language model CodeBERT is utilized to extract high-level semantic features from exercise text descriptions and syntactic structural features from source code. A dual-token cross-fusion mechanism is designed to dynamically integrate textual and code features. Furthermore, to enhance model interpretability, a solution-assisted feature representation module is introduced. This module extracts constraint information—such as time limits, memory limits, and input-output scale—through static analysis and integrates it with text and code features to construct a multi-dimensional feature space, optimizing difficulty prediction. Experimental validation on the Codeforces and CodeChef datasets shows that the proposed method achieves AUC values of 88.15% and 76.21%, with accuracy improvements of 0.9% and 0.17% over the best baseline models, respectively. The results demonstrate that MFFD-CodeBERT provides more accurate difficulty assessment for programming exercises.