Mamba4KT: An Efficient and Effective Mamba-based Knowledge Tracing Model

Wei Zhang (张伟), Yang Cao, Wei ZhangarXiv 2024 · DOI

Abstract

Knowledge Tracing (KT) is essential for personalized education, yet existing models struggle with the trade-off between capturing long-term dependencies and maintaining computational efficiency. We present Mamba4KT, the first KT model utilizing the Mamba (Selective State Space Model) architecture. Mamba4KT achieves state-of-the-art accuracy while providing linear scaling in sequence length, resulting in significantly faster training and inference times with a drastically reduced memory footprint compared to Transformer and RNN-based alternatives.

Introduction

Knowledge Tracing (KT) involves modeling a student's mastery of concepts over time to predict future performance. As digital learning platforms scale, they generate massive interaction datasets, posing significant challenges for current state-of-the-art (SOTA) models. Attention-based models (e.g., SAINT, AKT) excel at capturing long-term dependencies but suffer from quadratic complexity ($O(L^2)$), leading to high memory consumption. Conversely, RNN-based models (e.g., DKT, LPKT) are more memory-efficient but struggle with long-range dependencies and lack parallelization. Mamba4KT addresses these limitations by providing an accurate, efficient, and interpretable framework.

Methodology

The core of Mamba4KT is the integration of the Selective State Space Model (SSM) architecture, specifically the Mamba block, which replaces traditional attention mechanisms.

The Mamba4KT architecture featuring Rasch model-based embeddings and the Mamba encoder stack.

Mamba Block and Selective Mechanism

Unlike standard time-invariant SSMs, Mamba employs a selective mechanism (S6) that allows the model to dynamically propagate or forget information based on the input. This enables the model to achieve the modeling power of Transformers with the linear scaling ($O(L)$) typical of RNNs.

Rasch Model-Based Embeddings

To better represent student interactions, Mamba4KT incorporates Rasch embeddings. These embeddings account for both the intrinsic difficulty of a question and the variation of questions within a specific knowledge concept, moving beyond simple question IDs.

Model Structure

The architecture consists of $N$ stacked Mamba blocks followed by Feed-Forward Networks (FFN) and Layer Normalization. This hybrid structure enhances the model's learning capacity while maintaining efficiency.

Experimental Setup

Mamba4KT was evaluated on three public benchmarks:

  • ASSISTments 2012: ~2.7 million interactions.
  • ASSISTments 2017: Characterized by long sequences (avg. 552 interactions/student).
  • Eedi: ~1.4 million interactions from the 2020 NeurIPS Education Challenge.

Results and Discussion

Mamba4KT demonstrates a significant breakthrough in the efficiency-accuracy trade-off.

Performance and Efficiency

The model achieved the highest AUC (0.8033) on the Eedi dataset and remained highly competitive on ASSISTments datasets. Crucially, on ASSISTments 2012, Mamba4KT was approximately 6.5x faster to train than LPKT and required only 2.0 GB of GPU memory, compared to 9.3 GB for AKT.

Scalability

The linear complexity of Mamba4KT is most evident when handling long sequences. As sequence lengths increase, the resource consumption of Mamba4KT remains nearly flat, whereas Attention and RNN models see exponential or significant linear growth in memory and time.

Scalability comparison showing memory usage and time vs. sequence length for Mamba4KT, AKT, and LPKT.

Interpretability

The authors developed a framework to extract "influence weights" from the Mamba structure. Analysis revealed that different channels within the Mamba block specialize in capturing either short-range patterns or global, long-term trends, providing transparency similar to attention maps.

Conclusion

Mamba4KT successfully breaks the efficiency-accuracy trade-off in Knowledge Tracing. By leveraging the Mamba architecture, it provides a scalable solution for large-scale educational platforms. Future work will explore integrating complex features like inter-concept relationships and further optimizing the model for edge deployment in classrooms.

Summary updated

BibTeX
@misc{2024mamba,
  author = {Wei Zhang (张伟) and Yang Cao and Wei Zhang},
  title = {{Mamba4KT: An Efficient and Effective Mamba-based Knowledge Tracing Model}},
  year = {2024},
  eprint = {2405.16542},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2405.16542},
}
Figure