Back to search

University of Alberta

Leveraging Prompt Engineering for Automated Grammatical Error Detection and Q-Matrix Coding for Cognitive Diagnostic Assessment

Abstract

dc:description.abstract

Automated grammatical error detection (GED) has emerged as a powerful tool to support second-language writing instruction. While most existing tools focus on surface-level correction, a few offer insights into the underlying grammatical skills learners struggle with. The purpose of this study is to develop, apply, and evaluate a grammar error detection and labelling system that integrates prompt-engineered large language models (LLMs) with Q-matrix-based cognitive diagnostic assessment (CDA) to identify grammatical skill patterns among English as a Second Language (ESL) learners.GPT-4o was prompted to annotate 132 student essays with structured error tags using a standardized codebook. These tagged outputs were compared to human-annotated essays using precision, recall, F1-score, and Cohen’s kappa metrics. The GPT-4o model performed with high consistency (Precision = 0.74, Recall = 0.78, F1 = 0.70, κ = 0.75), demonstrating strong alignment with instructor annotations. To diagnose learners’ grammatical skill gaps, a Q-matrix was constructed to map each error tag to one or more latent grammar skills. Analysis of the construct-level Q-matrix revealed nine distinct error patterns among student essays, reflecting variation in grammatical challenges across the sample. Vocabulary and sentence structure errors were the most frequent, while verb tense and coherence issues appeared less often. Clustering identified groups of learners with shared weaknesses, providing a basis for differentiated instruction. This integrated framework shows that combining prompt engineering with CDA offers a scalable method for generating individualized grammar feedback and supporting ESL teaching and learning. The methodology and architecture described can be adapted for use in other grammar instruction settings and second language education contexts.

Degree

thesis:*
Name thesis:degree_name
Master of Education
Level thesis:degree_level
Master's
Discipline thesis:degree_discipline
Measurement, Evaluation, and Data Science
Grantor
University of Alberta
Year dc:date.issued
2025

Author and committee

dc:creator, dc:contributor.*
Author dc:creator
  • Abroampah, Doris A.
Advisor dc:contributor.advisor
  • Gierl, Mark (Educational Psychology)

Subjects

dc:subject × 4

Rights

dc:rights
Statement dc:rights
  • This thesis is made available by the University of Alberta Library with permission of the copyright owner solely for non-commercial purposes. This thesis, or any portion thereof, may not otherwise be copied or reproduced without the written consent of the copyright owner, except to the extent permitted by Canadian copyright law.
Language dc:language.iso
en

Identifiers

dc:identifier.*
DOI dc:identifier.doi
https://doi.org/10.7939/83275

Chain of custody

source
Harvested from
University of Alberta
Base URL
era.library.ualberta.ca/oai
Last updated
2026-11-26
Source record
OAI-PMH GetRecord
citation

Abroampah, Doris A.. Leveraging Prompt Engineering for Automated Grammatical Error Detection and Q-Matrix Coding for Cognitive Diagnostic Assessment. Master's thesis, University of Alberta, 2025. https://doi.org/10.7939/83275