Skip to main content
QUICK REVIEW

[Paper Review] pyBKT: An Accessible Python Library of Bayesian Knowledge Tracing Models

Anirudhan Badrinath, Frédéric Wang|arXiv (Cornell University)|May 2, 2021
Intelligent Tutoring Systems and Adaptive LearningComputer Science29 references15 citations
TL;DR

pyBKT is a high-performance, open-source Python library that implements Bayesian Knowledge Tracing (BKT) models and their modern variants, enabling efficient fitting, prediction, and cross-validation of knowledge tracing models. It achieves up to 30,000x speedup over prior MATLAB-based implementations and replicates key results from seminal papers with high accuracy, including AUC of 0.76 for standard BKT and 0.83 for BKT+Forgets on the ASSISTments dataset.

ABSTRACT

Bayesian Knowledge Tracing, a model used for cognitive mastery estimation, has been a hallmark of adaptive learning research and an integral component of deployed intelligent tutoring systems (ITS). In this paper, we provide a brief history of knowledge tracing model research and introduce pyBKT, an accessible and computationally efficient library of model extensions from the literature. The library provides data generation, fitting, prediction, and cross-validation routines, as well as a simple to use data helper interface to ingest typical tutor log dataset formats. We evaluate the runtime with various dataset sizes and compare to past implementations. Additionally, we conduct sanity checks of the model using experiments with simulated data to evaluate the accuracy of its EM parameter learning and use real-world data to validate its predictions, comparing pyBKT's supported model variants with results from the papers in which they were originally introduced. The library is open source and open license for the purpose of making knowledge tracing more accessible to communities of research and practice and to facilitate progress in the field through easier replication of past approaches.

Motivation & Objective

  • To address the lack of accessible, efficient, and extensible implementations of Bayesian Knowledge Tracing (BKT) and its variants in the research and educational software communities.
  • To provide a computationally efficient, modular, and user-friendly Python library that supports data ingestion, model fitting, prediction, and cross-validation for BKT models.
  • To enable accurate replication of past BKT model results using real-world datasets and to support the development and evaluation of new knowledge tracing approaches.
  • To improve the reproducibility and scientific progress in intelligent tutoring systems (ITS) research by offering a standardized, open-source implementation.

Proposed method

  • pyBKT implements BKT as a Hidden Markov Model (HMM) with observable nodes for student responses and hidden nodes for latent knowledge states, using Bayes' theorem to update mastery probabilities over time.
  • The library uses the Expectation-Maximization (EM) algorithm to estimate four core parameters: prior mastery (P(L₀)), learn rate (P(T)), guess probability (P(G)), and slip probability (P(S)).
  • It supports model extensions such as KT-IDEM (item-specific guess/slip), KT-PPS (student-specific priors), BKT+Forgets (time-dependent forgetting), and item-order/learning effect models.
  • The library provides a high-level Model class abstraction with one-line methods for model creation, initialization, fitting, prediction, evaluation, and cross-validation.
  • Data handling is streamlined via a simple data helper interface that ingests common tutor log formats, and model training is optimized for performance using efficient numerical computation in Python.
  • Runtime benchmarks show pyBKT is 3–4x faster than its predecessor xBKT and nearly 30,000x faster than the Bayes Net Toolbox (BNT) implementation.

Experimental results

Research questions

  • RQ1Can a modern, efficient, and accessible Python library replicate the performance of established BKT models and their variants on real-world educational datasets?
  • RQ2How does pyBKT’s runtime performance compare to prior BKT implementations such as xBKT and BNT?
  • RQ3To what extent can pyBKT reproduce canonical results from seminal BKT papers, such as those on BKT+Forgets and KT-IDEM?
  • RQ4Does pyBKT support the implementation of advanced BKT variants like KT-PPS and item-order effect models with comparable predictive accuracy to original implementations?
  • RQ5What are reasonable thresholds for student count and sequence length to ensure convergence and reliable mastery estimation in BKT models?

Key findings

  • pyBKT achieves an AUC of 0.76 on the ASSISTments 2009–2010 dataset using the standard BKT model, closely matching the 0.73 reported in Khajah et al. (2017), and improves to 0.83 with the BKT+Forgets variant, replicating the same result.
  • For the KT-IDEM model, pyBKT achieves an average AUC increase of 0.01932 over standard BKT on the top ten skills from the ASSISTments dataset, compared to 0.021 in the original study.
  • The KT-PPS model in pyBKT outperforms standard BKT on 27 out of 42 problem sets in the ASSISTments Groups of Learning Opportunities dataset, showing strong alignment with the original findings despite differences in parameter initialization.
  • pyBKT demonstrates a 3–4x speedup over xBKT and a nearly 30,000x speedup over the BNT MATLAB implementation, making it highly efficient for large-scale knowledge tracing applications.
  • Empirical analysis suggests that 50 students and a sequence length of 15 are sufficient to achieve stable convergence and reliable mastery estimation across diverse student response patterns.
  • The library successfully replicates key results from prior work, validating its implementation accuracy and supporting reproducibility in knowledge tracing research.

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.