Skip to content
AI.info

Research

KTCF: Actionable Recourse in Knowledge Tracing via Counterfactual Explanations for Education

Overview Research area: Explainable AI (XAI) for education, specifically counterfactual explanation generation for deep learning-based Knowledge Tracing (KT). Technical level: Intermediate — the paper

arXiv
2601.09156
Published
2026-01-14
Authors
Woojin Kim, Changkwon Lee, Hyeoncheol Kim

AI summary

Overview

Research area: Explainable AI (XAI) for education, specifically counterfactual explanation generation for deep learning-based Knowledge Tracing (KT).

Technical level: Intermediate — the paper assumes familiarity with knowledge tracing models, counterfactual explanations, and constrained optimization, but the problem framing and application scenario are explained in accessible educational terms.

Scope: The paper proposes KTCF, a method for generating actionable, KC-relationship-aware counterfactual explanations for KT models, plus a post-processing scheme that turns those explanations into ordered sequences of educational instructions, evaluated quantitatively and qualitatively on the XES3G5M dataset.

What This Paper Is About

Knowledge Tracing models predict whether a student will answer a future problem correctly, but existing XAI work for KT mainly shows what the model attended to or what psychometric parameters it learned — not why a prediction is low or how a student could change it. This paper asks how to generate counterfactual explanations that tell a student which of their previously incorrect knowledge concepts (KCs) they would need to correct in order for the KT model to predict mastery of a target KC. The goal is to convert those counterfactuals into a concrete, ordered sequence of study actions that reduces the student's overall study burden.

Key Contributions

  1. A counterfactual explanation generation method for KT (KTCF) that explicitly accounts for relationships between knowledge concepts, using an undirected KC relation graph and a shortest-path penalty (KC loss) so that suggested corrections stay pedagogically related to the target KC.

  2. A post-processing scheme that converts a counterfactual explanation into a sequence of educational instructions, formulated as a variant of the Traveling Salesman Path Problem solved with Dijkstra's algorithm and a greedy Hamiltonian path.

  3. A formal conceptualization and problem formulation of counterfactual explanations for KT in an educational context, including definitions of explanandum and explanans, and five proposed desired properties: Intervention Sparsity, Actionability, KC Level Granularity, KC Relationship Coherence, and Form of Discrete, Sequential Steps of Actions.

  4. An empirical and qualitative evaluation on a large-scale educational dataset showing superior and more robust performance than landmark counterfactual baselines, plus an ablation study on five counterfactual initialization strategies for binary response sequences.

Main Findings

  • Superior overall performance: KTCF outperformed the baselines across all evaluation metrics. KTCF-rn improved validity by 28.3% over Wachter-rand and 5.7% over DiCE-rand, and reduced sparsity by 26.0% and 34.0% respectively. The abstract summarizes improvements as ranging from 5.7% to 34% across metrics.

  • Complete actionability: KTCF produced only actionable counterfactuals, fully eliminating unactionable modifications. In Table 1, every KTCF variant reports Actionability and Actionability Rate of 0.000, while Wachter-rand reports 40.525 actionability (rate 0.617) and DiCE-rand reports 35.320 (rate 0.504).

  • Faster generation: KTCF-gs achieved 41.9% and 14.2% faster computation times compared to Wachter-rand and DiCE-rand, with a recorded generation time of 2.202 ± 1.52 seconds.

  • Baselines fail more often: Wachter and DiCE failed to generate valid counterfactuals for 27.5% and 12% of students, respectively, and suggested excessive and unactionable changes.

  • Best-performing variants: KTCF-rn and KTCF-gs were reported as the most balanced in validity, sparsity, actionability, and generation time. KTCF-rn reached 0.930 ± 0.26 validity with 49.845 ± 8.44 sparsity; KTCF-gs reached 0.920 ± 0.27 validity with 49.920 ± 7.74 sparsity.

  • Initialization strategy matters: Gaussian noise (-rn), soft relaxation (-sr), and Gumbel-Sigmoid relaxation (-gs) initializations yielded the best results. Hard random (-rand) and convex combination (-cc) initializations underperformed, with KTCF-cc showing the lowest validity among KTCF variants at 0.685 ± 0.47.

  • Robustness from the KC loss: KTCF was highly robust across hyperparameter values for λ_noise and λ_temp, whereas baselines were highly sensitive. Ablation indicated that the KC loss itself strengthens robustness, making performance consistent across all values of λ_kc.

  • Reduced study burden in the qualitative case: On instance #1,452 of the XES3G5M test dataset, KTCF produced 5 educational instructions with total path distance 30, reduced to 26 after post-processing. Wachter went from 77 to 66, and DiCE from 95 to 79. Average KC distance was larger for KTCF (Wachter : DiCE : KTCF = 4.71 : 4.64 : 5.2), but total study burden was lower (66 : 79 : 26) due to KTCF's superior sparsity.

  • Pedagogically coherent instructions: For the target KC "Distinguishing between leap and non-leap years," KTCF's instructions covered divisibility rules, calendar cycles, modulo operations, and basic integer arithmetic, while Wachter and DiCE included seemingly unrelated KCs such as "Treemap," "Counting units of decimals," "Magic square relationship," and "Simple statistics table."

  • KT model performance: The DKT model achieved 0.8415 accuracy and 0.8358 AUC on validation, and 0.8253 accuracy and 0.8226 AUC on test data under 5-fold cross-validation.

Methodology in Plain English

Setting up the problem. The researchers take a student's learning history — a sequence of knowledge concepts paired with correct/incorrect responses — and a trained KT model. They focus on a target KC at the end of the sequence where the student answered incorrectly and the model also predicted incorrect. The goal is to find a modified version of the student's earlier responses that would flip the model's prediction to correct.

Actionability masking. Only responses the student originally got wrong are allowed to change. The method builds a binary mask over those positions, so the optimization can never suggest that a student should have answered a question incorrectly.

Optimization. The counterfactual is found by stochastic optimization with Adam, minimizing a combined loss of three terms:

  • A prediction loss — binary cross entropy pushing the model's output toward the desired probability of 1.0.
  • A sparsity loss — the Hamming distance between the original and counterfactual response sequences, which keeps suggested changes minimal.
  • A KC loss — the sum of shortest-path distances, in a predefined undirected KC relation graph, between each modified KC and the target KC. This penalizes changes to concepts that are not closely related to the target.

After each gradient update, the counterfactual is projected back onto the actionable elements.

Turning explanations into instructions. Once the set of counterfactual KCs is identified, the method computes shortest-path distances between every pair of those KCs using Dijkstra's algorithm, builds a small complete graph with those distances as edge weights, and finds a greedy Hamiltonian path starting at the target KC. The path is then reversed and presented as the ordered sequence of study steps. The reported complexity of this post-processing is O(|V^CF|^2 (|V_kc| + |E|) log(|V_kc|)), which the authors note is small because KTCF is optimized for sparsity.

Experimental setup. Experiments used the XES3G5M dataset — 5,549,635 interaction sequences from 18,066 students on Mathematics — with its provided KC relationship information, forming a KC relation graph of 1,175 nodes and 1,304 edges. Evaluation used 200 randomly selected instances from students with more than 45% incorrect responses. The main KT architecture was DKT, using the pyKT library for preprocessing, training, and evaluation, on NVIDIA GeForce RTX 4090 devices. Hyperparameters were λ_spar = 0.1, λ_kc = 1e-3, N_iter = 200, τ = 1e-4, and λ_cc = 0.5.

Evaluation metrics. Six metrics were used — validity, sparsity, sparsity rate, actionability, actionability rate, and generation time — which the authors note cover four CO-12 properties: Continuity, Compactness, Context, and Contrastivity. Baselines were Wachter and DiCE. Prototype and Nearest Unlike Neighbor approaches were excluded because the authors regard each student's learning process as idiosyncratic.

Why This Matters

Impact on research. The paper positions counterfactual explanation as a bridge between XAI for KT and actual educational practice. It argues that existing KT explanation work answers "what" questions through attention heatmaps, psychometric parameter plots, and post-hoc feature relevance, leaving "why?" and "how?" largely unexplored. It also makes a case that counterfactual reasoning in KT has so far been used only to aid model prediction, not discussed under an XAI framing. The work contributes a formal conceptualization, a set of desired properties for educational counterfactuals, and evidence that soft-relaxation initialization helps with the categorical-feature challenge that binary student responses create.

Real-world applications:

  • Student-facing study guidance: turning a low mastery prediction into a short, ordered list of specific KCs to review, rather than a raw probability.
  • Teacher and tutor dashboards: surfacing which prior incorrect concepts are blocking a student's progress on a target skill, so intervention can be targeted.
  • Adaptive learning platforms: scheduling review content in an order that minimizes total study burden, since KTCF's instructions are generated to reduce path distance.
  • Regulatory and compliance contexts: the paper notes the EU AI Act classifies educational AI models as high-risk and requires model evaluation to identify and mitigate systemic risks, and that the U.S. Department of Education emphasizes protecting human decision-making — both of which motivate explanations that keep educators in the loop.

Industry relevance. The approach targets any deployed KT system where students, teachers, families, and caregivers need understandable guidance, not just accuracy metrics. Its emphasis on actionability, KC-level granularity, and KC relationship coherence maps directly to the constraints of real curricula, where recommending "Integer Addition" practice to a student working on "Algebraic Equations" would be useless even if it flipped a model's prediction.

Broader framing. The paper connects its approach to Bloom's Mastery Learning, in which initial instruction is followed by formative assessment and then targeted correction. It cites Bloom's finding that tutored students achieved 2 sigma above the conventional class average (teacher-student ratio 1:30), the "2 Sigma Problem," and suggests KT plus KTCF could plausibly serve as part of a scalable solution to that problem.

Future Directions

  • User study on learning outcomes. The authors state that future work will involve conducting a user study to assess KTCF's practical impact on student learning outcomes.
  • LLM-based instruction conversion. The paper proposes exploring the potential of large language models to convert counterfactual explanations into educational instructions, replacing or augmenting the current TSPP-based post-processing.
  • Handling initialization sensitivity. The authors acknowledge their method is sensitive to initialization due to the nature of the KT domain, and frame the work as opening new possibilities for handling categorical features in counterfactual explanations.
  • Educationally grounded XAI for KT. The paper closes by suggesting future XAI for KT work may benefit from educationally grounded conceptualization and stakeholder-centered method development, and that counterfactuals have potential to advance responsible and practical use of AI in education.

Target Audience

This paper is most useful for researchers working on explainable AI for education, knowledge tracing, or counterfactual explanation methods — particularly those interested in post-hoc, local, outcome-based explanations rather than attention- or psychometrics-based interpretability. It will also benefit learning platform engineers and educational data scientists who need to convert model predictions into concrete, actionable recommendations for students and teachers. Educators and policymakers interested in how XAI can address high-risk classification of educational AI systems and support human decision-making will find the framing and the Bloom's Mastery Learning connection relevant, though the methodology sections assume a machine learning background.

Authors’ abstract

Using Artificial Intelligence to improve teaching and learning benefits greater adaptivity and scalability in education. Knowledge Tracing (KT) is recognized for student modeling task due to its superior performance and application potential in education. To this end, we conceptualize and investigate counterfactual explanation as the connection from XAI for KT to education. Counterfactual explanations offer actionable recourse, are inherently causal and local, and easy for educational stakeholders to understand who are often non-experts. We propose KTCF, a counterfactual explanation generation method for KT that accounts for knowledge concept relationships, and a post-processing scheme that converts a counterfactual explanation into a sequence of educational instructions. We experiment on a large-scale educational dataset and show our KTCF method achieves superior and robust performance over existing methods, with improvements ranging from 5.7% to 34% across metrics. Additionally, we provide a qualitative evaluation of our post-processing scheme, demonstrating that the resulting educational instructions help in reducing large study burden. We show that counterfactuals have the potential to advance the responsible and practical use of AI in education. Future works on XAI for KT may benefit from educationally grounded conceptualization and developing stakeholder-centered methods.

Read the original paper