Debiased Cognitive Diagnosis: A Contrastive Counterfactual Modeling Method via Variational Autoencoder
Proceedings of the Fortieth AAAI Conference on Artificial Intelligence (AAAI), 2026
AAAI 2026
🏆 Oral
Abstract
Cognitive diagnosis (CD), inferring student knowledge mastery based on historical response records, is crucial for personalized educational services such as adaptive practice and learning path planning. Existing CD models were built based on the assumption that student's response data is integral, overlooking the nonrandom missingness of data caused by student answering exercises selectively. This missingness generally leads to biased and incomplete observations, where confounders, such as selection bias and exposure bias, significantly undermine the accuracy of student knowledge modeling. To address missingness, we propose a Debiased Cognitive Diagnosis (DBCD) framework through the perspective of counterfactual modeling to remove exogenous confounders from the response data. Specifically, the proposed DBCD achieves debiasing for CD by applying the idea of contrastive learning to constrain the model's prediction distributions on both factual and counterfactual data. For a student, the factual data is his/her original response records, while the counterfactual data is generated by sampling the same number of exercises from all exercises of each concept through a similarity-based counterfactual sampling strategy. Considering the difficulty of directly removing the exogenous confounders for student, we devise a β-Variational Autoencoder to model their exogenous confounders within the latent representations of knowledge proficiency by leveraging exercise priors and student response patterns. Then, the learned representations are further combined with the vanilla student's ability embedding via a gating mechanism-based fusion for final diagnosis prediction of the model. Extensive experiments on real-world educational datasets demonstrate that the proposed DBCD effectively mitigates confounders and even outperforms existing methods, thereby validating the feasibility and effectiveness of the DBCD framework.
Contributions
- Points out that nonrandom missingness of response data (selection bias, exposure bias) systematically biases existing cognitive diagnosis models.
- Proposes DBCD, a debiased cognitive diagnosis framework built on counterfactual modeling to remove exogenous confounders.
- Introduces contrastive counterfactual modeling with a variational autoencoder to constrain the debiasing process.
Method

DBCD treats the biased observations as outcomes contaminated by confounders and constructs counterfactual representations of student responses; a contrastive learning objective over a variational autoencoder separates the genuine knowledge state from the missingness-induced bias, yielding unbiased knowledge mastery estimates.
Experimental Results

Compared algorithms: The CVIB variant of DBCD and three strong neural CDMs (KaNCD, KSCD, HyperCD).
Datasets: ASSIST09 and JUNYI under Full/Random/Uniform item-difficulty conditions.
Metrics: ACC, AUC, and RMSE.
Overall results: DBCD achieves the best results in almost all settings, confirming that removing non-random missingness bias leads to more reliable diagnosis.
BibTeX
@inproceedings{yang2026debiased, title = {Debiased Cognitive Diagnosis: A Contrastive Counterfactual Modeling Method via Variational Autoencoder}, author = {Yang, Shangshang and Duan, Xuewen and Yu, Xiaoshan and Wang, Ziwen and Ma, Haiping and Zhang, Xingyi}, booktitle = {Proceedings of the Fortieth AAAI Conference on Artificial Intelligence}, year = {2026}, }