Explainable Few-Shot Knowledge Tracing

Haoxuan Li, Jifan Yu, Yuanxin Ouyang, Zhuang Liu, Wenge Rong, Huizhu Liu, Juanzi Li, Zhang Xiong

Traditional knowledge tracing (KT) models often operate as "black boxes," requiring extensive longitudinal data to predict student performance. This paper introduces an "explainable few-shot knowledge tracing" framework leveraging Large Language Models (LLMs). By utilizing in-context learning, the framework predicts student success with minimal historical data and provides natural language explanations for its reasoning, bridging the gap between automated assessment and pedagogical practice.

The Challenge of Knowledge Tracing

Knowledge Tracing (KT) is essential for personalized education, modeling a student's evolving mastery of concepts to predict future performance. While deep learning models have achieved high predictive accuracy, they suffer from two primary limitations: high data dependency and a lack of interpretability. These models typically require large historical datasets for training and output binary predictions (correct/incorrect) without explaining the underlying cognitive state.

In contrast, human educators can often assess a student's proficiency from just a few examples and provide qualitative feedback. This research proposes a shift toward explainable few-shot KT, using the reasoning capabilities of LLMs to mimic human-like assessment.

Comparison between traditional knowledge tracing and the proposed explainable few-shot framework.

Methodology: The Cognition-Guided Framework

The authors propose a cognition-guided framework that utilizes the in-context learning capabilities of LLMs, eliminating the need for task-specific model training. The framework is structured into three core modules:

  1. Observation: This module selects a small, representative set of a student's past exercise records (few-shots), including question text and associated knowledge components.
  2. Cognition: The LLM analyzes the student's knowledge state—categorizing mastery levels (e.g., good, fair, fail)—and predicts performance on a target question.
  3. Interpretation: The model generates natural language explanations for both past performance (e.g., identifying careless errors) and future predictions based on the inferred knowledge state.
The cognition-guided framework for explainable few-shot knowledge tracing.

Experimental Setup and Datasets

The framework was evaluated using three public datasets: FrcSub (Fraction Subtraction), MoocRadar, and XES3G5M. To analyze the impact of semantic information, the data was presented in three modes:

  • Scant: Only exercise IDs and labels.
  • Sparse: Includes skill representations.
  • Moderate: Includes full textual descriptions of exercises.

Key Insights

  • Semantic Context is Crucial: Performance significantly improves in "Moderate" mode. LLMs leverage the semantic content of exercise text, whereas traditional models rely on abstract IDs.
  • Optimal Few-Shot Volume: While increasing the number of examples (up to 16) generally improves accuracy, excessive context can lead to "hallucinations" or confusion in the model's reasoning.
  • Selection Strategy: Randomly sampling historical records often outperformed chronological selection, particularly for students with extensive histories.
  • Explanation Quality: While LLMs excelled at generating structured, readable explanations (scoring >90% on completeness), human experts noted that they occasionally lacked the deep pedagogical intuition found in professional teaching.

Performance Results

On the MoocRadar dataset, frontier models like GLM-4 and GPT-4 matched or outperformed six established deep learning baselines (e.g., DKT, SAKT, SAINT) that were trained on the full dataset. Specifically, GLM-4 and GPT-4 showed improvements of up to 3.01% in Accuracy and 1.66% in F1 score over the best-performing traditional baselines. Notably, smaller models (e.g., ChatGLM3-6B) struggled with instruction following and reasoning, highlighting the necessity of large-scale emergent capabilities for this task.

Conclusion and Future Work

While promising, the approach faces challenges regarding API costs and context window limitations. Future research will explore Retrieval-Augmented Generation (RAG) to select pedagogically optimal few-shot examples and extend the framework to complex, open-ended tasks like essay grading or programming, where traditional KT models are less effective.

Summary updated

BibTeX
@inproceedings{li2025explainable,
  author = {Haoxuan Li and Jifan Yu and Yuanxin Ouyang and Zhuang Liu and Wenge Rong and Huizhu Liu and Juanzi Li and Zhang Xiong},
  title = {{Explainable Few-Shot Knowledge Tracing}},
  booktitle = {Frontiers of Digital Education},
  year = {2025},
  doi = {10.1007/s44366-025-0071-x},
}
Figure