KASER: Knowledge-Aligned Student Error Simulator for Open-Ended Coding Tasks

Zhangqi Duan, Nigel Fernandez, Andrew Lan


Abstract
Open-ended tasks, such as coding problems that are common in computer science education, provide detailed insights into student knowledge. However, training large language models (LLMs) to simulate and predict possible student errors in their responses to these problems can be challenging: they often suffer from mode collapse and fail to fully capture the diversity in syntax, style, and solution approach in student responses. In this work, we present KASER (Knowledge-Aligned Student Error Simulator), a novel approach that aligns errors with student knowledge. We propose a training method based on reinforcement learning using a hybrid reward that reflects three aspects of student code prediction: i) code similarity to the ground-truth, ii) error matching, and iii) code prediction diversity. On two real-world datasets, we perform two levels of evaluation and show that: At the per-student-problem pair level, our method outperforms baselines on code and error prediction; at the per-problem level, our method outperforms baselines on error coverage and simulated code diversity.
Anthology ID:
2026.acl-long.1858
Volume:
Proceedings of the 64th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers)
Month:
July
Year:
2026
Address:
San Diego, California, United States
Editors:
Maria Liakata, Viviane P. Moreira, Jiajun Zhang, David Jurgens
Venue:
ACL
SIG:
Publisher:
Association for Computational Linguistics
Note:
Pages:
39988–40006
Language:
URL:
https://preview.aclanthology.org/ingest-acl/2026.acl-long.1858/
DOI:
Bibkey:
Cite (ACL):
Zhangqi Duan, Nigel Fernandez, and Andrew Lan. 2026. KASER: Knowledge-Aligned Student Error Simulator for Open-Ended Coding Tasks. In Proceedings of the 64th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 39988–40006, San Diego, California, United States. Association for Computational Linguistics.
Cite (Informal):
KASER: Knowledge-Aligned Student Error Simulator for Open-Ended Coding Tasks (Duan et al., ACL 2026)
Copy Citation:
PDF:
https://preview.aclanthology.org/ingest-acl/2026.acl-long.1858.pdf
Checklist:
 2026.acl-long.1858.checklist.pdf