NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Programming Knowledge Tracing based on Problem Solution Embedding

Yongfeng Huang, Rongfang Wang2024

Abstract

With the development of the internet and information technology, using online learning systems for programming practice has increasingly become a new trend. In this process, continuously tracking students' proficiency in programming skills is particularly important. However, current research on Knowledge Tracing (KT) often treats student responses as binary (correct/incorrect), neglecting the rich semantic information within the code itself and the expert-provided solutions. This paper proposes CTGKT (Code and Tutorial Graph-based Knowledge Tracing), a novel model that integrates student code, problem descriptions, and official solutions to better model knowledge evolution. Experimental results show that CTGKT significantly outperforms existing models, achieving an AUC of 83.42%.

Introduction

In online programming education, Knowledge Tracing (KT) serves as the core engine for monitoring student progress. Traditionally, KT models analyze a sequence of exercise attempts to predict whether a student will succeed on a subsequent task. However, programming is a complex cognitive activity where two students might achieve the same "Accepted" status through vastly different approaches—one using a brute-force method and another an optimal algorithm.

Existing models like Deep Knowledge Tracing (DKT) or Graph-based Knowledge Tracing (GKT) often overlook these nuances. They typically ignore the semantic depth of problem descriptions and, crucially, the "gold standard" provided by expert solutions. The authors of this study argue that a true understanding of a student's skill level requires comparing their work against these official benchmarks.

Methods

The proposed CTGKT model consists of three primary modules designed to capture and evolve student knowledge states:

  1. Embedding Module: This layer transforms diverse data types into high-dimensional vectors. It utilizes RoBERTa for problem descriptions and expert solutions, CodeBERT for student-submitted code, and a Graph Convolutional Network (GCN) to map relationships between problems and underlying skills (e.g., recursion, greedy algorithms).
  2. Fusion Module: This component uses an attention mechanism to integrate the various embeddings into a single representation of a learning interaction, effectively benchmarking student code against the official solution.
  3. Knowledge Evolution & Prediction: An LSTM network updates the student's knowledge state over time, outputting a prediction for the student's success on future problems.
Architecture of the CTGKT model, illustrating the flow from multi-modal embeddings to knowledge state evolution and final prediction.

Datasets

The model was evaluated using a custom dataset from real-world programming competition practices:

  • Scale: 8,714 submission records across 1,089 distinct problems.
  • Content: Records include problem IDs, 37 annotated skills (e.g., constructive algorithms), official solutions, problem text, student code, and pass/fail results.
  • Evaluation: A 4:1 training-to-testing ratio was employed with five-fold cross-validation to ensure robustness.

Key Results and Insights

The CTGKT model demonstrates a significant performance leap over traditional KT methods. By moving beyond binary outcomes and analyzing the actual logic within the code, the model captures a more granular view of student proficiency.

Comparison of AUC metrics between CTGKT and several state-of-the-art knowledge tracing models.

As shown in the results, CTGKT achieved an AUC of 83.42%, outperforming GKT (76.04%) and DKT (71.36%). Ablation studies further confirmed that the inclusion of "official solutions" (tutorials) and "student code" is critical; removing these features caused the AUC to drop to 77.52%. This highlights that student code is the most informative individual feature, but the synergy between code, solutions, and descriptions provides the best predictive power.

Conclusion and Future Work

CTGKT represents a step forward in automated programming education by treating code as a first-class citizen in knowledge tracing. While the results are promising, future research will focus on scaling the model to larger datasets (e.g., LeetCode), exploring the impact of different learning contexts (daily practice vs. competition), and optimizing the computational efficiency of the underlying transformer models for real-time deployment.

Summary updated

BibTeX
@misc{huang2024programming,
  author = {Yongfeng Huang and Rongfang Wang},
  title = {{Programming Knowledge Tracing based on Problem Solution Embedding}},
  year = {2024},
  doi = {10.4108/eai.29-3-2024.2347724},
}
Figure