Abstract: Knowledge tracing (KT) is the problem of predicting students' future performance based on their historical interaction sequences. With the advanced capability of capturing contextual long-term dependency, attention mechanism becomes one of the essential components in many deep learning based KT (DLKT) models. In spite of the impressive performance achieved by these attentional DLKT models, many of them are often vulnerable to run the risk of overfitting, especially on small-scale educational datasets. Therefore, in this paper, we propose sparseKT, a simple yet effective framework to improve the robustness and generalization of the attention based DLKT approaches. Specifically, we incorporate a k-selection module to only pick items with the highest attention scores. We propose two sparsification heuristics: (1) soft-thresholding sparse attention and (2) top-K sparse attention. We show that our sparseKT is able to help attentional KT models get rid of irrelevant student interactions and have comparable predictive performance when compared to 11 state-of-the-art KT models on three publicly available real-world educational datasets.
Introduction
Knowledge Tracing (KT) is a fundamental task in personalized education, aiming to predict students' future performance based on their historical interaction sequences. While deep learning-based KT (DLKT) models, particularly those utilizing attention mechanisms, have shown impressive results by capturing long-term dependencies, they often suffer from overfitting. This is particularly prevalent in educational datasets, which are typically smaller than those in NLP or Computer Vision.
Standard attention mechanisms assign non-zero weights to all past interactions via the softmax function. In an educational context, this introduces noise; for instance, a student's performance on a distant, unrelated topic (like a vocabulary quiz) should not heavily influence the prediction for a current, distinct task (like a geometry problem). By attending to these "noisy" interactions, models become less robust and fail to generalize well to new students or questions.
Methodology
To address the noise issue, we propose sparseKT, a framework designed to improve the robustness and generalization of attentional KT models. Built upon the Self-Attentive Knowledge Tracing (SAKT) architecture, sparseKT introduces two key enhancements:
- Enhanced Interaction Representations: To move beyond treating all questions within a Knowledge Component (KC) as identical, we incorporate a question-specific discrimination factor ($m_q$) and a variation vector ($v^c$) to capture the nuances of individual questions.
- k-Sparse Attention: This core module filters out low-importance interactions by masking them. We explore two heuristics:
- Top-k Sparse Attention: The model explicitly selects only the $k$ interactions with the highest attention scores.
- Soft-thresholding Sparse Attention: The model orders interactions by score and keeps picking them until their cumulative attention sum reaches a predefined threshold $k$.
By setting irrelevant scores to negative infinity before the final normalization, the model effectively "ignores" the noise, focusing only on the most influential historical data.
Experiments
We evaluated sparseKT on three diverse, real-world educational datasets:
- ASSISTments2015 (AS2015): A classic benchmark of middle school math interactions (~682k interactions).
- NeurIPS2020 Education Challenge (NIPS34): A large-scale dataset from a diagnostic question platform (~1.4M interactions).
- Peking Online Judge (POJ): A dataset focused on programming exercises, involving complex logic (~987k interactions).
Results and Discussion
Our results demonstrate that sparsity acts as an effective regularizer in educational contexts. By limiting the model's focus to the most relevant interactions, we prevent the model from learning spurious patterns in noisy data.
As shown in the results table, sparseKT consistently ranks among the top performers in terms of AUC and accuracy, outperforming 11 state-of-the-art baselines including DKT, SAINT, and AKT. Specifically, sparseKT achieved significant improvements over the base SAKT model, with AUC gains of 0.97%, 4.79%, and 1.38% across the three datasets. We observed that the "soft-thresholding" approach generally yields slightly better results, suggesting that a flexible selection of interactions is more effective than a fixed hard limit.
Furthermore, we found that performance follows a bell curve relative to the value of $k$. If $k$ is too small, the model lacks context; if $k$ is too large, noise overwhelms the signal. For the AS2015 dataset, the optimal $k$ was found to be approximately 7. The resulting sparse attention weights also provide pedagogical insights, such as revealing asymmetric relationships between different learning topics (e.g., "Multiplication" heavily influences "Factors," but the reverse is much weaker).
Conclusion
The sparseKT framework offers a simple yet effective way to enhance the robustness of attention-based KT models. By focusing on the most influential historical interactions, the model achieves better generalization and more reliable performance across major educational benchmarks. Future work will explore dynamic $k$-selection to automatically adapt the number of relevant interactions for each student and context, further reducing the need for manual hyperparameter tuning.
Summary updated