# Pattern-based Knowledge Component Extraction from Student Code Using Representation Learning

arXiv: https://arxiv.org/abs/2508.09281 · HTML: https://mlsanity.com/paper/2508.09281/

## Key facts

- Cited by 4 papers in the map (data through 14 Oct 2026).
- Builds on 8 of its 42 references that are in the map.
- First posted on arXiv 12 Aug 2025.

## Builds on (most cited first, 8 of 8)

- [CodeT5: Identifier-aware Unified Pre-trained Encoder-Decoder Models for Code Understanding and Generation](https://mlsanity.com/paper/2109.00859/) (2021)
- [Deep Knowledge Tracing](https://mlsanity.com/paper/1506.05908/) (2015)
- [EdNet: A Large-Scale Hierarchical Dataset in Education](https://mlsanity.com/paper/1912.03072/) (2019)
- [Knowledge Tracing: A Survey](https://mlsanity.com/paper/2201.06953/) (2022)
- [Code-DKT: A Code-based Knowledge Tracing Model for Programming Tasks](https://mlsanity.com/paper/2206.03545/) (2022)
- [pyBKT: An Accessible Python Library of Bayesian Knowledge Tracing Models](https://mlsanity.com/paper/2105.00385/) (2021)
- [Automated Generation and Tagging of Knowledge Components from Multiple-Choice Questions](https://mlsanity.com/paper/2405.20526/) (2024)
- [Automated Identification of Logical Errors in Programs: Advancing Scalable Analysis of Student Misconceptions](https://mlsanity.com/paper/2505.10913/) (2025)

## Built on by (most cited first, 4 of 4)

- [Personalized Worked Example Generation from Student Code Submissions Using Pattern-based Knowledge Components](https://mlsanity.com/paper/2604.24758/) (2026)
- [Automated Program Repair of Uncompilable Student Code](https://mlsanity.com/paper/2510.06187/) (2025)
- [Using LLMs for Knowledge Component-level Correctness Labeling in Open-ended Coding Problems](https://mlsanity.com/paper/2602.17542/) (2026)
- [Automated Recommendation of Programming Learning Content Using Pattern-based Knowledge Components](https://mlsanity.com/paper/2607.05409/) (2026)

## Abstract (arXiv)

Personalized instruction aims to provide learners with support that adapts to their individual knowledge and progress toward learning objectives. Discovering and tracing Knowledge Components (KCs) is an important step in building accurate models of student learning. However, KC discovery in computer science education is challenging due to the open-ended nature of programming, wide variability in student solutions, and intertwined use of programming structures in code. We address these challenges with a pattern-based KC discovery method that uses a data-driven approach to define KCs as recurring structural patterns in student code that reveal persistent patterns of struggle and mastery in students' solutions. We then evaluate the discovered KCs using expert evaluation and statistical student modeling to demonstrate their effectiveness in capturing student learning and struggles. We propose a framework for modeling students' learning by deriving pattern-based KCs from student code through a three-stage process. First, an attention-based code representation model identifies Abstract Syntax Tree subtrees most relevant to code correctness. Second, a Variational Autoencoder abstracts these subtrees into a smooth latent space, capturing structural similarity across student submissions. Third, the resulting representations are clustered into pattern-based KCs. To assess the effectiveness of pattern-based KCs for modeling students' learning, we adapt the Deep Knowledge Tracing model to incorporate these KCs, demonstrating significant improvements in predictive performance over baseline KT methods. Additionally, the learning curve analysis showed alignment between the derived KCs and learning theory.
