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

Programming Knowledge Tracing: A Comprehensive Dataset and A New Model

Renyu Zhu, Dongxiang Zhang, Chengcheng Han, Ming Gao, Xuesong Lu, Weining Qian, Aoying Zhou

TL;DR

This paper introduces BePKT, the most comprehensive dataset to date for programming knowledge tracing, and PDKT, a novel deep learning model designed to predict student performance. By leveraging a two-stage code pre-training framework (PLCodeBERT) and a double-sequence RNN that accounts for the human "forgetting curve," the authors achieve state-of-the-art results in predicting whether a student will solve a programming problem correctly.

What Problem Does This Paper Address?

Knowledge Tracing (KT) is the task of modeling a student's mastery of concepts over time to predict their future performance. While KT has seen success in subjects like math, Programming Knowledge Tracing (PKT) presents unique challenges.

First, existing datasets often lack "context"—they might track if a student got a problem right or wrong, but they rarely include the actual code submitted, the problem descriptions, or the underlying knowledge concepts (e.g., "dynamic programming" vs. "loops"). Second, beginner code is messy. Unlike professional code found on GitHub, student submissions are often riddled with syntax errors. This makes standard "syntax-tree" based code analysis tools fail, as they require code that actually compiles to work.

Methods

The authors propose a framework called PDKT (Programming Deep Knowledge Tracing), which consists of three main components:

  1. Bipartite Problem Embedding: They treat problems and knowledge concepts as nodes in a bipartite graph. Using a Graph Attention Network (GAT), the model learns the relationships between specific problems and the abstract concepts they test.
  2. PLCodeBERT (Two-Stage Pre-training): To handle "broken" student code, they developed a specialized version of CodeBERT.
  3. Stage 1: Unsupervised pre-training on a massive dataset of 1.2 million student submissions from Codeforces.
  4. Stage 2: Supervised classification on their own dataset to predict submission outcomes (e.g., "Compile Error," "Time Limit Exceeded," or "Correct"). This allows the model to extract meaningful features even from code that doesn't run.
  5. Double-Sequence Modeling (DSM): The model uses two parallel RNNs—one to track the sequence of problems attempted and another to track the sequence of code submitted. These are fused using Exponential Decay Attention, a mechanism inspired by the Ebbinghaus Forgetting Curve, which gives more weight to recent learning activities while acknowledging that older knowledge fades.

Datasets

The primary contribution is the BePKT (Behavior-based Programming Knowledge Tracing) dataset:

  • Source: Harvested from a university Online Judge (OJ) system over two years.
  • Scale: 906 users, 1,054 problems, and 106 knowledge concepts.
  • Content: Includes problem text, knowledge labels, difficulty levels, user-submitted code, and system logs (like "viewing problem" or "submitting code").
  • Comparison: Unlike previous datasets (like BlackBox or Code.org), BePKT is the only one to provide the full "trinity" of user code, problem text, and knowledge concepts.

The authors also used the POJ dataset to evaluate their code embedding model on a secondary task: code clone detection.

Key Insights and Ideas

  • Errors are Features: In most programming tasks, a "Compile Error" is a failure. In PKT, the type of error a student makes is a rich signal of their current understanding. PDKT treats these errors as labels to help the model learn better code representations.
  • Student Code $\neq$ Professional Code: The authors found that models pre-trained on high-quality GitHub code (like standard CodeBERT) perform poorly on student work. Pre-training on "noisy" student data is essential for accuracy in an educational context.
  • The Recency Effect: By incorporating an exponential decay in the attention mechanism, the model mathematically mirrors the human tendency to forget, which significantly improved prediction accuracy compared to standard attention.

Key Results

  • State-of-the-Art Performance: PDKT achieved an AUC of 0.7745 on the BePKT dataset, outperforming established models like DKT (0.7197) and AKT (0.7128).
  • Plug-and-Play Improvements: Adding the authors' PLCodeBERT embeddings to existing models (like AKT) boosted their performance by over 3%, proving that better code representation is a "rising tide that lifts all boats."
  • Code Clone Detection: On the POJ dataset, PLCodeBERT achieved a MAP@R of 88.63, outperforming other heavyweights like GraphCodeBERT and CLSEBERT.

Limitations and Future Work

While comprehensive, the authors note that they have not yet fully exploited "click event" data (e.g., how long a student spent viewing a problem before submitting). They suggest that future iterations of the model could incorporate these behavioral "dwell times" to better estimate student effort and frustration levels. Additionally, they plan to continue expanding the BePKT dataset with more student trajectories to improve the model's robustness.

Summary updated

BibTeX
@inproceedings{zhu2022programming,
  author = {Renyu Zhu and Dongxiang Zhang and Chengcheng Han and Ming Gao and Xuesong Lu and Weining Qian and Aoying Zhou},
  title = {{Programming Knowledge Tracing: A Comprehensive Dataset and A New Model}},
  booktitle = {Workshops @ ICDM},
  year = {2022},
  url = {https://openreview.net/forum?id=-fbcYQ4Hspi},
}
Figure