Skip to main content
QUICK REVIEW

[Paper Review] Code-DKT: A Code-based Knowledge Tracing Model for Programming Tasks

Yang Shi, Min Chi|arXiv (Cornell University)|Jun 7, 2022
Online Learning and AnalyticsComputer Science8 citations
TL;DR

This paper proposes Code-DKT, a knowledge tracing model that enhances Deep Knowledge Tracing (DKT) by integrating code-specific features extracted via attention mechanisms from student submissions. By leveraging code2vec to represent abstract syntax trees and learning path importance through performance feedback, Code-DKT improves AUC by 3.07–4.00% over DKT across five programming assignments, demonstrating that domain-specific code features significantly boost KT performance in programming education.

ABSTRACT

Knowledge tracing (KT) models are a popular approach for predicting students' future performance at practice problems using their prior attempts. Though many innovations have been made in KT, most models including the state-of-the-art Deep KT (DKT) mainly leverage each student's response either as correct or incorrect, ignoring its content. In this work, we propose Code-based Deep Knowledge Tracing (Code-DKT), a model that uses an attention mechanism to automatically extract and select domain-specific code features to extend DKT. We compared the effectiveness of Code-DKT against Bayesian and Deep Knowledge Tracing (BKT and DKT) on a dataset from a class of 50 students attempting to solve 5 introductory programming assignments. Our results show that Code-DKT consistently outperforms DKT by 3.07-4.00% AUC across the 5 assignments, a comparable improvement to other state-of-the-art domain-general KT models over DKT. Finally, we analyze problem-specific performance through a set of case studies for one assignment to demonstrate when and how code features improve Code-DKT's predictions.

Motivation & Objective

  • Address the limitation of existing knowledge tracing models that treat student responses only as correct or incorrect, ignoring content and code structure.
  • Explore whether and how domain-specific code features from student submissions can improve knowledge tracing performance in programming tasks.
  • Develop a model that integrates code representation with deep learning-based knowledge tracing to better capture student mastery of programming concepts.
  • Demonstrate the effectiveness of code features in improving prediction accuracy compared to both general KT models and naive code-feature extensions.

Proposed method

  • Represent student code submissions as abstract syntax trees (ASTs) and extract multiple code paths using the code2vec model.
  • Apply an attention mechanism to learn the importance of different code paths based on student performance on current and past submissions.
  • Integrate the learned code feature representations into the Deep Knowledge Tracing (DKT) framework to track student knowledge progression over time.
  • Train the model end-to-end using sequences of problem attempts, with loss backpropagated through both the DKT and attention components.
  • Use student response correctness and submission scores as supervision signals to guide attention weighting of code paths.
  • Compare Code-DKT against BKT, DKT, and two DKT variants extended with simple code features (e.g., presence of return statements).

Experimental results

Research questions

  • RQ1RQ1: Can code features extracted from student submissions improve knowledge tracing performance in programming tasks compared to domain-general models?
  • RQ2RQ2: How do code features affect model performance, and why do some code features improve performance while others do not?
  • RQ3RQ3: Under what conditions—such as problem type or concept familiarity—do code features most effectively improve prediction accuracy?

Key findings

  • Code-DKT improves AUC by 3.07–4.00 percentage points over DKT across all five programming assignments, demonstrating consistent and significant gains.
  • The improvement is comparable to that of state-of-the-art domain-general models like SAINT and SAKT over DKT, suggesting code features are as impactful as model architecture innovations.
  • Simple code features (e.g., presence of a return statement) do not improve DKT performance, indicating that naive feature integration is insufficient without attention-based weighting.
  • Code features are most effective on problems with shared learning concepts (e.g., loops, conditionals), where repeated practice enables better feature generalization.
  • Code features enhance predictions for both first attempts and subsequent attempts, suggesting they help detect early signs of concept mastery and progress toward correctness.
  • Case studies reveal that the model uses code structure to infer student proximity to a correct solution and to detect prior knowledge of programming constructs, especially in repeated attempts.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.