Open-Ended Knowledge Tracing

Naiming Liu, Zichao Wang, Richard G. Baraniuk, Andrew S. LanarXiv 2022 · DOI

Introduction

Traditional Knowledge Tracing (KT) models are designed to estimate a student's mastery of specific skills by predicting the probability of a correct response to future questions. However, these models typically rely on binary outcomes (correct/incorrect), ignoring the rich semantic information contained within open-ended responses, such as computer code. This "binary bias" treats all incorrect answers as equal, failing to distinguish between a minor syntax error and a fundamental logical misconception.

This paper introduces Open-Ended Knowledge Tracing (OKT), a framework that leverages generative AI to predict the exact content of a student's response. By modeling the student's evolving knowledge state as a control signal for code generation, OKT can anticipate specific coding styles and misconceptions before a submission is even made.

Methods

The OKT architecture consists of three primary components: Knowledge Representation, Knowledge Estimation, and Response Generation.

The OKT architecture consists of three modules: Knowledge Representation, Knowledge Estimation, and Response Generation.
  1. Knowledge Representation (KR): The model uses a pre-trained GPT-2 encoder for question prompts and an Abstract Syntax Tree Neural Network (ASTNN) for student code. ASTNN is particularly effective as it captures the structural logic of the code rather than treating it as simple text.
  2. Knowledge Estimation (KE): This module tracks the student's latent knowledge state over time. While various KT models were tested, an LSTM-based approach proved highly effective in maintaining the temporal mastery level.
  3. Response Generation (RG): The core innovation involves "injecting" the student's current knowledge state into a fine-tuned GPT-2 model. This state acts as a control signal, guiding the generator to produce code that reflects the student's specific level of understanding and likely errors.

Datasets and Training

The study utilized the CSEDM (Computer Science Education Data Mining) Data Challenge dataset, which includes longitudinal code submissions from 246 students across 50 programming questions. To provide a baseline understanding of programming logic, the generative component was pre-trained on the Funcom dataset, containing 2.1 million Java code snippets.

Key Insights: Mapping the Topology of Errors

A significant finding of this work is the model's ability to capture "Buggy Rules"—consistent patterns of incorrect logic. By visualizing the latent knowledge space using t-SNE, the authors demonstrated that the model naturally clusters students based on shared misconceptions.

Visualization of the learned knowledge state space, showing clusters corresponding to correct solutions and specific types of errors.

This visualization confirms that the model is not merely memorizing code but is learning a structured representation of the student's conceptual understanding. Furthermore, because the model processes the text of question prompts, it exhibits zero-shot generalization capabilities, allowing it to predict responses to novel questions.

Results

The OKT model achieved a CodeBLEU score of up to 0.726, indicating high structural and semantic similarity between predicted and actual student code. Qualitatively, the model accurately predicted specific student behaviors, such as the omission of return statements or the preference for specific loop structures. Multi-task learning—training the model to predict both code content and binary correctness—was found to further enhance performance and robustness.

Limitations and Future Work

While promising, OKT requires substantial volumes of student-generated code, which may limit its application in data-scarce environments. Additionally, the computational overhead of generating full code snippets poses challenges for real-time deployment in large-scale courses. Future research aims to involve instructors in labeling the identified "error clusters" to translate latent states into actionable pedagogical interventions.

Summary updated

BibTeX
@misc{liu2022open,
  author = {Naiming Liu and Zichao Wang and Richard G. Baraniuk and Andrew S. Lan},
  title = {{Open-Ended Knowledge Tracing}},
  year = {2022},
  eprint = {2203.03716},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2203.03716},
}
Figure