Manuscript Offprint
arXiv:2610.41215Beyond Response Scoring: An AI-aware Cognitive Supervision Framework for Automated Mathematical Short Answer Grading
Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.
Abstract
Transformer-based language models have achieved remarkable success in automated short answer grading (ASAG). However, current methods in ASAG struggle to comprehend, reason about and evaluate complex mathematical answers involving symbols and formulas. These score-only methods fail to generalize across diverse responses and skill states associated with identical scores. Moreover, they ignore the potential upward bias introduced by generative Artificial Intelligence (AI) usage in assessing students' performance and knowledge mastery. To address these limitations, we propose AICG (AI-aware Cognitive-supervised Grading), a two-branch multi-task framework. The first branch combines RoBERTa-based regression, ordinal, and classification heads for individual-answer grading. The second branch uses an expert-designed Q-matrix to associate responses with assessed skills and jointly predicts G-DINA-derived skill mastery and learning gain. Through the shared encoder, these skill-level targets provide cognitive supervision for answer grading beyond score labels. AICG further uses a Gen-AI detector, trained through supervised contrastive pretraining followed by linear classification, to estimate assistance probabilities and convert them into reliability weights, attenuating unreliable cognitive evidence during learning assessment. We conduct experiments on 49,402 instructor-graded responses spanning 19 academic semesters. Relative to RoBERTa regression, AICG reduces mean absolute error (MAE) by 50.3% and improves quadratic weighted kappa (QWK) from 0.798 to 0.927. Ablations identify Q-matrix-guided cognitive supervision as the primary source of improvement, while AI-aware weighting further reduces overall MAE by 4.2% over the unweighted cognitive model and consistently improves MAE and QWK across the four most recent post-Gen-AI semesters.
Introduction
Automated grading of mathematical short answers sits at the intersection of natural language understanding, symbolic reasoning, and cognitive assessment: responses interleave prose and derivations, while partial credit depends on demonstrated reasoning rather than only the final answer. With generative AI, the same fluent, high-scoring response may reflect genuine mastery or a borrowed solution, increasing the importance of accurate and reliable grading. Existing work approaches this problem from two complementary directions: individual-answer grading, which maps each response to a score, and Q-matrix-based skill modeling, which grounds assessment in an explicit cognitive structure. Both have made substantial progress, but neither addresses their complementary limitations or the reliability threat introduced by generative AI.
Individual-answer grading. In automated short-answer grading (ASAG), pretrained language models and LLMs encode response semantics with substantially less manual feature engineering (Burrows, Gurevych, and Stein 2015; Latif and Zhai 2024; Ferreira Mello et al. 2025; Chu et al. 2025). However, mathematical responses interleave natural-language explanations, symbolic formulas, and incomplete derivations, while partial credit may depend on multiple reasoning principles. Current language models remain unreliable in domain-specific symbolic and compositional reasoning (Latif and Zhai 2024; Jiang and Bosch 2024; Ferreira Mello et al. 2025) and may misinterpret valid intermediate or mathematically equivalent work. More fundamentally, supervision is compressed into a scalar label: identical scores can represent different reasoning and skill states, limiting generalization to unseen solution patterns. Figure 1 illustrates this difficulty: the student correctly applies conditional independence twice but stops before Bayes' rule; the score of 0.60 records the earned credit but not the underlying reasoning pattern.
Q-matrix-based skill modeling. A complementary perspective explicitly represents the cognitive structure of assessment. A Q-matrix associates items with skills, while cognitive-diagnosis models such as G-DINA infer mastery from response patterns (de la Torre 2011). Student and question representations complement answer features (Zhang, Lin, and Chi 2020), and neural cognitive-diagnosis models demonstrate the value of explicit skill structure (Wang et al. 2020; Liu et al. 2024; Qian et al. 2024; Gu et al. 2025). Figure 1 illustrates this value: the missing Bayes step indicates weak Bayesian reasoning, while the Q-matrix links this evidence across items assessing the same skill. However, these models rely on binary item-response records and leave the semantic evidence in free-text solutions unused. Generative AI further complicates assessment because an assisted answer may earn its assigned grade while overstating independent mastery. Although recent detectors identify machine-generated text (Hans et al. 2024; Bao et al. 2024), hard filtering remains vulnerable to rewriting and distribution shift and may disproportionately affect non-native writ-
| Question. Given , suppose and are conditionally independent given and . Let , , and . Determine . Reference AnswerPrinciple/WeightDefinition of Conditional Independent Events (0.3).Definition of Conditional Independent Events (0.3).Bayes's Rule (0.4). Student AnswerTotal score: 0.60Definition of Conditional Independent Events: 1conditionally independent events: --> Definition of Conditional Independent Events: 1Bayes's Rule: 0I don't know how to do the restWeighted score: . |
Figure 1: Alignment between weighted reference principles and partial-credit evidence. Blue, green, and red boxes denote reference steps, demonstrated principles, and the missing application of Bayes's rule, respectively.
ers (Sadasivan et al. 2025; Liang et al. 2023), making binary removal unsuitable.
We propose AICG (AI-aware Cognitive-supervised Grading), a two-branch multi-task framework. The first branch applies regression, ordinal, and classification heads to a shared RoBERTa representation (Liu et al. 2019), capturing complementary continuous, ordered, and categorical grading signals. The second branch uses the Q-matrix to aggregate skill-relevant responses and predicts G-DINA-derived pretest mastery, posttest mastery, and learning gain. Joint optimization transfers this cognitive supervision to the shared response encoder without feeding predicted grades into the cognitive branch. AICG further trains a Gen-AI detector through supervised contrastive pretraining (Khosla et al. 2020) followed by linear classification. The estimated assistance probabilities are converted into soft reliability weights applied only to cognitive evidence, preserving the grading treatment of each response. Our contributions are threefold:
-
AICG is the first Transformer-based ASAG framework to jointly optimize answer grading with Q-matrix-aligned mastery and learning-gain supervision.
-
We introduce AI-aware reliability weighting that attenuates potentially assisted cognitive evidence without discarding responses or altering their grades.
-
AICG outperforms five strong baselines in a ten-year expanding-window evaluation while maintaining robust cross-semester generalization.
Problem Formulation
Let denote the student set, with indexing a student; let denote the assessment phases, with indexing a phase; and let denote the cognitive-skill set, with indexing a skill and . For student in phase , denotes the observed-response set, with indexing a response.
For response from student , denotes the textual input and the normalized instructor-assigned score. The input concatenates the question identifier, student answer, and principle metadata using separator tokens. The Q-matrix vector associates the response with assessed skills: indicates whether the corresponding item assesses skill . The assessment phase and Q-matrix vector remain structured inputs rather than being appended to the response text.
At the response level, denotes the predicted continuous score. The ground-truth and predicted ordered categories are denoted by and , respectively. The ground-truth category is derived from using boundaries 0.125, 0.375, 0.625, and 0.875.
At the student-skill level, denotes the reliability-adjusted G-DINA mastery target, and its prediction. The reliability-adjusted learning-gain target is the difference between the corresponding posttest and pretest mastery targets, while denotes its prediction. AICG is supervised by and , which are derived from AI-aware, Q-matrix-aligned response evidence.
Gen-AI Detector
An AI-assisted response may provide unreliable evidence of independent mastery. We therefore train the Gen-AI Detector separately to estimate continuous AI-assistance probabilities.
AI-Assisted Response Construction. Complete LLM rewriting can introduce stylistic artifacts that encourage shortcut learning. We instead mask 30%–50% of each authentic response and use an offline DeepSeek model to reconstruct the masked tokens, preserving 50%–70% of the student text. Original responses are labeled human-written; partially completed and fully generated correct responses form the AI-assisted class. Each source response and its variants remain in the same partition to prevent leakage. Classes are matched by item, score category, and length, and generator transfer is evaluated through leave-one-generator-out splits. Further details are provided in Appendix.

Figure 2: Overview of AICG. The Gen-AI Detector supplies AI-assistance probabilities only to the Q-Matrix-Based Cognitive Supervision branch. The shared RoBERTa encoder supports parallel cognitive-supervision and individual-response-grading branches. Solid and dashed arrows denote prediction and supervision flows, respectively.
Supervised Contrastive Pretraining. For response , represents the textual input to the Gen-AI Detector, and represents its source label, with for human-written text and for partially assisted or fully generated text. Training uses balanced mini-batches with equal numbers of responses from both classes.
The Gen-AI detector employs a RoBERTa encoder RoBERTa, where [CLS] denotes the final hidden state of the sequence-initial classification token. The learnable projection matrix and bias are represented by and , respectively. The projected representation is calculated as:
The normalized contrastive embedding is denoted by , and denotes the Euclidean norm. It is computed as:
Let denote the response indices in a balanced mini-batch. For anchor , contains the non-anchor responses sharing label ; indexes a response in , and indexes a non-anchor response in . With temperature , the supervised contrastive objective encourages within-class compactness and between-class separation. It is formulated as:
Probability Estimation. After contrastive pretraining, the Gen-AI Detector encoder and projection layer are frozen. A two-class linear classifier, parameterized by and , is trained on the frozen representations using cross-entropy loss.
Probability calibration uses the group-disjoint validation set , whose size is . A candidate temperature is represented by , and is the value selected by minimizing the average negative log-likelihood. The subscript selects the probability assigned to the ground-truth source label of response . The optimal temperature is calculated as:
The calibrated AI-assistance probability for response is denoted by . Because represents partially assisted or fully generated text, this probability is computed as the class-1 output:
For the grading dataset, denotes the calibrated AI-assistance probability of response from student . Calibration is evaluated using expected calibration error and the Brier score. Grading-test responses are excluded from Gen-AI Detector training and temperature estimation.
Individual-Response Grading
As shown in Figure 2, AICG employs a RoBERTa encoder shared with the cognitive branch but separate from the GenAI Detector. For input , the encoder produces , the dropout-regularized final hidden state of the sequence-initial [CLS] token, where is the hidden dimension. Regression, ordinal, and categorical heads operate independently on . The regression head uses a sigmoid function to produce the continuous score . The ordinal head produces , where denotes the logit for threshold . The categorical head produces for the five grade categories.
For category , denotes its training weight. We set and assign to response from student . The minibatch contains student-response pairs, and its total weight is .
The regression loss uses SmoothL1 , which is quadratic below and linear otherwise. Its category-weighted average is calculated as:
For threshold , the ordinal target is , where denotes the indicator function. The positive and negative training counts are and , respectively, and the positive-class weight is . Using binary cross-entropy with logits , the ordinal loss is calculated as:
The categorical probabilities are , where denotes the probability of category . With focal parameter , the category-weighted classification loss is defined as:
The three losses form the answer-level scoring objective. The categorical head provides auxiliary supervision, whereas the final discrete grade is decoded from the ordinal head and is calculated as:
Q-Matrix-Based Cognitive Supervision
Q-Matrix-Guided Skill Selection. The cognitive branch connects response embeddings to student-level skill targets without using predicted grades. The Q-matrix-selected responses for student s, skill k, and phase t form the set , which is defined as . The corresponding observation mask is defined as . Only responses associated with skill k contribute to its representation. When , the entry is excluded from pooling, cognitive losses, evaluation, and reporting; any stored zero serves only as a batching placeholder.
AI-Aware Weighting. Q-matrix relevance does not ensure that a response reflects independent student knowledge. The cognitive-evidence reliability of response from student is represented by , where is the minimum reliability. Using the previously defined AI-assistance probability , the reliability is calculated as:
This monotonic weighting attenuates responses with high estimated AI involvement without imposing a hard detection threshold. The lower bound preserves limited evidence from responses that may still contain student-authored reasoning.
Reliability-Weighted Cognitive Targets. AICG incorporates response reliability into G-DINA inference (de la Torre 2011). A latent mastery profile is represented by , where is its th component and indicates mastery of skill . The G-DINA item parameters are denoted by . The function represents the probability of a correct response to the item associated with response under profile . Its skill interactions are constrained by the previously defined Q-matrix vector .
The normalized score is treated as fractional item-response evidence. The reliability-weighted G-DINA log-likelihood for student s in phase t under profile is represented by . It is computed by weighting each fractional Bernoulli contribution as:
The mastery-profile prior is represented by , while indexes alternative profiles in the posterior normalizer. The previously defined reliability-adjusted mastery target is computed as the posterior expectation of :
Accordingly, the reliability-adjusted learning-gain target is calculated as . G-DINA parameters and targets are estimated separately within each historical development window; evaluation semesters are excluded from target construction.
Reliability-Weighted Skill Evidence. The same reliability values weight the response embeddings used by the cognitive branch. For an observed student-skill-phase tuple, represents the AI-aware skill evidence. It is calculated by averaging the reliability-scaled embeddings selected by the Q-matrix as:
The denominator is the number of selected responses rather than their total reliability. Consequently, the representation magnitude decreases when all available evidence is unreliable.
Pretest, Posttest, and Learning-Gain Modeling. Each skill has a learnable embedding . The phase-specific functions and are shared across skills and implemented as linear-tanh-dropout-linear-sigmoid networks. The notation selects the corresponding function for phase . The previously defined mastery prediction combines the AI-aware skill representation with its skill embedding and is calculated as:
The previously defined gain prediction is calculated as . Gain is observed only when skill k appears in both phases. The corresponding mask is defined as .
For phase , the observed student-skill pairs form . The mastery loss is the mean squared error over these observed pairs and is calculated as:
Accordingly, and denote Equation (15) evaluated for the pretest and posttest phases, respectively.
The gain-observation set is defined as . The gain loss is the mean squared error over skills observed in both phases and is formulated as:
The Full Cognitive variant replaces and with their unweighted counterparts and .
Multi-Task Learning
The coefficients , , and weight the grading losses, while , , and weight the cognitive losses. The complete AICG objective is defined as:
We set and . The grading objectives remain primary, while the cognitive objectives provide auxiliary supervision to the shared encoder. All coefficients are fixed across semesters and random seeds.
Experiments
Data and Evaluation Protocol
AICG is evaluated on 49,402 instructor-graded mathematical responses from 3,861 student-semester records across 19 observed semesters (F14–F24); F17 has no observations. Each assessment contains eight pretest and eight aligned posttest items. An expert Q-matrix maps these items to ten skills, and G-DINA estimates pretest mastery, posttest mastery, and learning gain for auxiliary supervision. We distinguish the pre-Gen-AI period (F14–S22) from the post-Gen-AI period (F22–F24).
Gen-AI Detection. The Gen-AI Detector is developed using S18–S22 data. We sample 14,044 responses from 26,039 authentic answers and construct one AI-assisted counterpart per response, yielding 28,088 balanced examples. Source-response groups remain intact across training (24,375), validation (2,709), and held-out testing (1,004). Cross-semester generalization is evaluated on 11,458 labeled human and synthetically assisted responses from F14–S17. The trained GenAI Detector then assigns continuous AI-assistance probabilities to F22–F24 responses. At a threshold of .5, it identifies 2,896 of 13,874 responses (20.87%) as potentially assisted, with semester-level rates ranging from 13.40% to 23.85%.
Grading. Each post-Gen-AI semester is evaluated using an expanding window containing only earlier semesters. Historical students are split 90/10 for training and validation, and the evaluation semester is excluded from optimization and model selection.
Baselines, Metrics, and Implementation
Baselines. We compare five ASAG baselines: BERT, a supervised Transformer grader (Zhu, Wu, and Zhang 2022); RoBERTa, a score-only model using AICG's backbone (Liu et al. 2019); ASQ-DBN, which combines answer, student, and question representations (Zhang, Lin, and Chi 2020); GPT-4o Scoring, a fixed-prompt grader without parameter updates (OpenAI 2024; Ferreira Mello et al. 2025); and GradeOpt, a rubric-aware multi-agent grader (Chu et al. 2025). All baselines use the same expanding-window splits. GradeOpt optimizes its guidelines using historical development data only, and no baseline receives Q-matrix targets, cognitive labels, or AI-aware weights.
Evaluation Metrics. For grading, we report mean absolute error (MAE), accuracy within absolute tolerances of .05, .10, and .20, exact accuracy, Macro-F1, and quadratic weighted kappa (QWK). Scores are bounded to [0, 1] and mapped to five ordered categories using cut points .125, .375, .625, and .875. For Gen-AI detection, we report accuracy, precision, recall, and F1. Results are reported as mean and sample standard deviation over five random seeds for trainable models and five independent runs for prompt-based graders. Dataset splits, configurations, prompts, and implementation details are provided in Appendix.
Results
Gen-AI Detection
Pre-Gen-AI period (F14-S22): Table 1 shows that our Gen-AI detector's performance is robust on both the within-
Table 1: Gen-AI detector performance. F17 is excluded because no data were collected in that semester.
| Evaluation | N | Acc. | Prec. | Recall | F1 |
|---|---|---|---|---|---|
| Within-semester Testing (S18-S22) | 1,004 | .959 | .955 | .964 | .960 |
| Cross-semester Testing (F14-S17) | 11,458 | .951 | .959 | .942 | .950 |
semester and the downstream cross-semester testing data where we have synthetic data with ground truth.
Post-Gen-AI period (F22-F24): Applying the Gen-AI Detector identifies 2,896 of 13,874 responses, 20.87%, from F22–F24 as potentially AI-assisted. More specifically, it varies from 13.40% to 23.85% across different semesters. These calibrated assistance probabilities serve as reliability signals for AI-aware cognitive-target construction and Q-matrix-guided skill-evidence aggregation.
Overall Performance
Table 2 shows that AICG achieves the best result on every evaluation metric against all five baselines. Compared with GradeOpt, the strongest external baseline, AICG reduces MAE by 44.9%, improves QWK from .842 to .927, and increases tolerance-based and exact accuracy by 8.7%–15.7% percentage points. Relative to RoBERTa, the strongest fully trained answer-only baseline, AICG reduces MAE by 50.3%, improves QWK from .798 to .927, and increases tolerance-based and exact accuracy by 11.6%–19.6%.
These results demonstrate the effectiveness of integrating individual-answer scoring with cognitive supervision. Although ordinal and categorical objectives improve the RoBERTa baseline, the largest gains arise from Q-matrix-guided mastery and learning-gain supervision, which exposes skill-level distinctions compressed by scalar scores and helps the shared encoder represent diverse reasoning patterns. AI-aware reliability weighting further improves the strongest unweighted cognitive model by attenuating potentially assisted cognitive evidence while preserving its contribution to answer grading.
Ablation Study
Table 2 progressively introduces AICG's components. RoBERTa uses only answer-level regression and serves as the base configuration.
RoBERTa+O adds ordinal supervision, reducing MAE from .0873 to .0842 and improving QWK from .798 to .813 by explicitly modeling score-category order. Full Scoring further adds categorical supervision, reducing MAE to .0823 and improving QWK to .831 by learning category-specific partial-credit boundaries. Full Scoring + Gain introduces learning-gain supervision without mastery states, reducing MAE to .0715 and improving QWK to .871 by capturing longitudinal changes unavailable from individual answer scores. Full Scoring + State instead adds pretest and posttest mastery supervision, reducing MAE to .0527 and improving QWK to .906. Its larger improvement indicates that mastery states provide more direct and stable targets than gain, which is derived from their difference. Full Scoring + Full Cognitive combines State and Gain using unweighted targets and skill pooling, reducing MAE to .0453 and improving QWK to .924. Mastery identifies the student's cognitive state at each phase, while gain constrains its change across assessments. Finally, AICG applies AI-aware reliability weights to both G-DINA-derived targets and Q-matrix-selected response embeddings, achieving .0434 MAE and .927 QWK by attenuating cognitive evidence that may not reflect independent mastery.
Cross-Semester Robustness. Table 3 reports the component ablations at the beginning and end of the expanding-window evaluation. Their ordering remains stable across F22 and F24: scoring-only models perform worst, State outperforms Gain, and Full Cognitive provides the strongest unweighted model. This consistency shows that cognitive supervision remains effective as the historical training window and semester-specific response distributions change.
AICG achieves the lowest MAE and highest exact accuracy in F22, although Full Cognitive retains small advantages on several agreement metrics. By F24, AICG performs best on every reported evaluation metric. This progression reflects the role of AI-aware reliability weighting: its effect is limited when AI-assisted responses are uncommon but becomes more pronounced as they introduce more unreliable cognitive evidence.
Effect of AI-Aware Weighting. Table 4 isolates AI-aware weighting by comparing AICG with FullCog, which treats all responses as equally reliable. AICG reduces MAE in every semester, from 0.8% in F22 to 3.6–6.6% in later semesters, and improves QWK in four of five semesters. The smaller F22 gain and more consistent later gains suggest that reliability weighting becomes more beneficial as AI-assisted responses increase.
AI-assisted responses may earn valid grades while providing unreliable evidence of independent mastery. AICG addresses this mismatch by down-weighting likely AI-assisted responses during skill-specific pooling without modifying their grading targets, thereby reducing noise in cognitive supervision rather than penalizing AI use. Although the current aggregate gain is moderate because these responses remain a minority, this protection becomes increasingly important as generative AI adoption grows.
Related Work
Automated Short Answer Grading. ASAG has evolved from rule-based and feature-engineering approaches (Burrows, Gurevych, and Stein 2015) to pretrained Transformers that encode response semantics with minimal task-specific design (Latif and Zhai 2024). We include BERT (Zhu, Wu, and Zhang 2022) as a classical supervised ASAG encoder and RoBERTa (Liu et al. 2019) as a score-only, same-backbone baseline. Recent work evaluates LLMs as zero-shot or few-shot graders (Ferreira Mello et al. 2025; Chu et al. 2025; Chamieh, Zesch, and Giebermann 2024; Jiang and Bosch 2024; Cong et al. 2026). We include GPT-4o Scoring (OpenAI 2024; Ferreira Mello et al. 2025) as a prompted grader and GradeOpt (Chu et al. 2025) as a rubric-optimization baseline. However, these methods remain unreliable in mathematics, where scores depend on symbolic
Table 2: Overall grading performance across F22–F24. Values are mean (standard deviation) over five repetitions. Best completed results are shown in bold.
| Method | MAE↓ | ±.05↑ | ±.10↑ | ±.20↑ | Exact↑ | Macro-F1↑ | QWK↑ |
|---|---|---|---|---|---|---|---|
| RoBERTa (Liu et al. 2019) | .0873 (.002) | .709 (.007) | .752 (.006) | .832 (.005) | .751 (.009) | .564 (.012) | .798 (.004) |
| GPT-4o Scoring (Ferreira Mello et al. 2025) | .1140 (.002) | .606 (.010) | .662 (.008) | .776 (.006) | .636 (.013) | .439 (.011) | .674 (.006) |
| BERT (Zhu, Wu, and Zhang 2022) | .0981 (.003) | .675 (.009) | .727 (.007) | .806 (.007) | .704 (.008) | .477 (.009) | .753 (.005) |
| ASQ-DBN (Zhang, Lin, and Chi 2020) | .0946 (.003) | .682 (.009) | .734 (.008) | .814 (.006) | .721 (.010) | .516 (.011) | .769 (.005) |
| GradeOpt (Chu et al. 2025) | .0788 (.003) | .748 (.008) | .796 (.007) | .861 (.006) | .786 (.009) | .612 (.010) | .842 (.005) |
| RoBERTa+O | .0842 (.002) | .724 (.004) | .763 (.006) | .844 (.003) | .783 (.006) | .611 (.007) | .813 (.003) |
| Full Scoring | .0823 (.001) | .728 (.004) | .769 (.007) | .851 (.005) | .784 (.004) | .626 (.006) | .831 (.002) |
| Full Scoring + Gain | .0715 (.002) | .784 (.006) | .823 (.006) | .886 (.005) | .842 (.006) | .683 (.008) | .871 (.003) |
| Full Scoring + State | .0527 (.002) | .874 (.005) | .897 (.006) | .932 (.004) | .912 (.005) | .742 (.007) | .906 (.003) |
| Full Scoring + Full Cognitive | .0453 (.001) | .903 (.004) | .921 (.007) | .945 (.005) | .930 (.004) | .768 (.006) | .924 (.002) |
| AICG | .0434 (.002) | .905 (.005) | .924 (.006) | .948 (.004) | .934 (.005) | .774 (.006) | .927 (.002) |
Table 3: Ablation results at the beginning and end of the expanding-window evaluation. Values are means over five seeds.
| Sem. | Method | MAE↓ | ±.10↑ | Exact↑ | Macro-F1↑ | QWK↑ |
|---|---|---|---|---|---|---|
| F22 | RoBERTa | .0904 | .744 | .739 | .553 | .791 |
| RoBERTa+O | .0882 | .759 | .772 | .602 | .806 | |
| Full Scoring | .0873 | .763 | .776 | .615 | .826 | |
| + Gain | .0759 | .817 | .835 | .674 | .866 | |
| + State | .0578 | .889 | .906 | .732 | .900 | |
| + Full Cognitive | .0497 | .918 | .929 | .761 | .922 | |
| AICG | .0493 | .917 | .931 | .758 | .918 | |
| F24 | RoBERTa | .0782 | .778 | .782 | .592 | .817 |
| RoBERTa+O | .0756 | .792 | .812 | .638 | .837 | |
| Full Scoring | .0731 | .802 | .816 | .651 | .849 | |
| + Gain | .0632 | .846 | .867 | .710 | .891 | |
| + State | .0468 | .914 | .925 | .758 | .918 | |
| + Full Cognitive | .0402 | .934 | .941 | .783 | .934 | |
| AICG | .0379 | .939 | .946 | .790 | .940 |
correctness, intermediate derivations, and specific reasoning principles (Chamieh, Zesch, and Giebermann 2024). Unlike rubric-matching methods, AICG grounds grading in a Q-matrix and derives cognitive targets from psychometric models.
Q-Matrix-Based Skill Modeling. Cognitive diagnosis models infer latent skill mastery from response patterns. G-DINA (de la Torre 2011) associates items with multiple skills through a Q-matrix and models their mastery interactions. Neural extensions, including NeuralCD (Wang et al. 2020), ORCDF (Qian et al. 2024), and inductive variants (Liu et al. 2024), improve representation capacity but operate on item-response records rather than free-text answers. Zhang, Lin, and Chi 2020 combine student and question embeddings with answer text, showing that these representations complement response encoding. We reproduce their answer–student–question model as the ASQ-DBN baseline. AICG instead uses G-DINA-derived mastery and learning-gain targets to supervise a free-text response encoder.
AI-Generated Text Detection. Machine-generated-text detection includes zero-shot methods such as Binoculars and Fast-DetectGPT (Hans et al. 2024; Bao et al. 2024), but performance can degrade under paraphrasing and distribution
Table 4: Semester-level effect of AI-aware weighting. FullCog denotes Full Scoring + Full Cognitive.
| AISem. | Usage | MAE↓ | QWK↑ | ||
|---|---|---|---|---|---|
| FullCog | AICG | FullCog | AICG | ||
| F22 | 13.40% | .0497 | .0493 | .922 | .918 |
| S23 | 23.15% | .0507 | .0489 | .914 | .922 |
| F23 | 23.56% | .0516 | .0482 | .924 | .926 |
| S24 | 20.41% | .0358 | .0336 | .923 | .929 |
| F24 | 23.85% | .0402 | .0379 | .934 | .940 |
shift (Sadasivan et al. 2025). Detectors may also disproportionately flag non-native English writing (Liang et al. 2023). Existing methods typically produce binary labels for misconduct detection. AICG instead uses a supervised contrastive Gen-AI Detector to produce continuous probabilities and convert them into soft reliability weights. This approach preserves each response's grading contribution while attenuating potentially assisted cognitive evidence.
Conclusion
We presented AICG, a cognitive reliability-aware multi-task framework for automated mathematical short-answer grading. By jointly optimizing answer-level scoring with Q-matrix-guided G-DINA mastery and learning-gain supervision, AICG learns representations that reflect student cognition rather than scalar labels. An auxiliary Gen-AI Detector, trained through supervised contrastive pretraining, converts assistance probabilities into soft weights on cognitive evidence, limiting inflated mastery estimates while preserving grading. Across 49,402 instructor-graded responses over ten academic years, AICG reduces MAE by 50.3% and improves QWK from .798 to .927 relative to RoBERTa regression. Ablations identify cognitive supervision as the primary source of improvement, with AI-aware weighting providing additional post-Gen-AI gains. Future work will learn Q-matrices from response text, improve detector robustness across LLMs, evaluate cross-course and multi-institution generalization, and use mastery and learning-gain profiles for personalized feedback.
References
Bao, G.; Zhao, Y.; Teng, Z.; Yang, L.; and Zhang, Y. 2024. Fast-DetectGPT: Efficient Zero-Shot Detection of Machine-Generated Text via Conditional Probability Curvature. In Proceedings of the Twelfth International Conference on Learning Representations.
Burrows, S.; Gurevych, I.; and Stein, B. 2015. The Eras and Trends of Automatic Short Answer Grading. International Journal of Artificial Intelligence in Education, 25(1): 60–117.
Chamieh, I.; Zesch, T.; and Giebermann, K. 2024. LLMs in Short Answer Scoring: Limitations and Promise of Zero-Shot and Few-Shot Approaches. In Proceedings of the 19th Workshop on Innovative Use of NLP for Building Educational Applications (BEA 2024), 309–315. Association for Computational Linguistics.
Chu, Y.; Li, H.; Yang, K.; Shomer, H.; Copur-Gencturk, Y.; Kaldaras, L.; Haudek, K.; Krajcik, J.; Shin, N.; Liu, H.; and Tang, J. 2025. A LLM-Powered Automatic Grading Framework with Human-Level Guidelines Optimization. In Proceedings of the 18th International Conference on Educational Data Mining, 31–41.
Cong, L.; Hammerla, L.; Hahn, S.; Gombert, S.; Drachsler, H.; and Kroehne, U. 2026. Automatic Short Answer Grading with LLMs: From Memorization to Reasoning. In Proceedings of the 16th International Conference on Learning Analytics and Knowledge, 75–84. Association for Computing Machinery.
de la Torre, J. 2011. The Generalized DINA Model Framework. Psychometrika, 76(2): 179–199.
Ferreira Mello, R.; Pereira Junior, C.; Rodrigues, L.; Pereira, F. D.; Cabral, L.; Costa, N.; Ramalho, G.; and Găsević, D. 2025. Automatic Short Answer Grading in the LLM Era: Does GPT-4 with Prompt Engineering Beat Traditional Models? In Proceedings of the 15th International Conference on Learning Analytics and Knowledge, 93–103. Association for Computing Machinery.
Gu, H.; Luo, G.; Dong, X.; Li, S.; and Zhou, D. 2025. Revisiting Cognition in Neural Cognitive Diagnosis. In Proceedings of the 31st ACM SIGKDD Conference on Knowledge Discovery and Data Mining, 402–412. Association for Computing Machinery.
Hans, A.; Schwarzschild, A.; Cherepanova, V.; Kazemi, H.; Saha, A.; Goldblum, M.; Geiping, J.; and Goldstein, T. 2024. Spotting LLMs with Binoculars: Zero-Shot Detection of Machine-Generated Text. In Proceedings of the 41st International Conference on Machine Learning, volume 235 of Proceedings of Machine Learning Research, 17519–17537. PMLR.
Jiang, L.; and Bosch, N. 2024. Short Answer Scoring with GPT-4. In Proceedings of the 11th ACM Conference on Learning at Scale, 438–442. Association for Computing Machinery.
Khosla, P.; Teterwak, P.; Wang, C.; Sarna, A.; Tian, Y.; Isola, P.; Maschinot, A.; Liu, C.; and Krishnan, D. 2020. Supervised Contrastive Learning. In Advances in Neural Information Processing Systems, volume 33, 18661–18673.
Latif, E.; and Zhai, X. 2024. Fine-Tuning ChatGPT for Automatic Scoring. Computers and Education: Artificial Intelligence, 6: 100210.
Liang, W.; Yuksekgonul, M.; Mao, Y.; Wu, E.; and Zou, J. 2023. GPT Detectors Are Biased Against Non-Native English Writers. Patterns, 4(7): 100779.
Liu, S.; Shen, J.; Qian, H.; and Zhou, A. 2024. Inductive Cognitive Diagnosis for Fast Student Learning in Web-Based Intelligent Education Systems. In Proceedings of the ACM Web Conference 2024, 4260–4271. Association for Computing Machinery.
Liu, Y.; Ott, M.; Goyal, N.; Du, J.; Joshi, M.; Chen, D.; Levy, O.; Lewis, M.; Zettlemoyer, L.; and Stoyanov, V. 2019. RoBERTa: A Robustly Optimized BERT Pretraining Approach. arXiv preprint arXiv:1907.11692.
OpenAI. 2024. Hello GPT-4o. OpenAI.
Qian, H.; Liu, S.; Li, M.; Li, B.; Liu, Z.; and Zhou, A. 2024. ORCDF: An Oversmoothing-Resistant Cognitive Diagnosis Framework for Student Learning in Online Education Systems. In Proceedings of the 30th ACM SIGKDD Conference on Knowledge Discovery and Data Mining, 2455–2466. Association for Computing Machinery.
Sadasivan, V. S.; Kumar, A.; Balasubramanian, S.; Wang, W.; and Feizi, S. 2025. Can AI-Generated Text Be Reliably Detected? Stress Testing AI Text Detectors Under Various Attacks. Transactions on Machine Learning Research.
Wang, F.; Liu, Q.; Chen, E.; Huang, Z.; Chen, Y.; and Yin, Y. 2020. Neural Cognitive Diagnosis for Intelligent Education Systems. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 34, 6153–6161.
Zhang, Y.; Lin, C.; and Chi, M. 2020. Going Deeper: Automatic Short-Answer Grading by Combining Student and Question Models. User Modeling and User-Adapted Interaction, 30(1): 51–80.
Zhu, X.; Wu, H.; and Zhang, L. 2022. Automatic Short-Answer Grading via BERT-Based Deep Neural Networks. IEEE Transactions on Learning Technologies, 15(3): 364–375.
Additional Data & Methodology & Experimental Details
Dataset Composition – Data
Table 5 summarizes the composition of 49,402 responses from 3,861 student-semester records. The pre-Gen-AI period (F14–S22) is aggregated, whereas the post-Gen-AI semesters (F22–F24) are reported separately with their pretest and posttest response counts and estimated AI-assistance rates.
Expanding-Window Evaluation Splits – Data
Table 6 summarizes the expanding-window splits. For each test semester, AICG is trained and validated using only earlier semesters, while the target semester is reserved exclusively for evaluation.
Q-Matrix and G-DINA Target Construction – Data
Q-matrix. The assessment contains eight pretest items and eight aligned isomorphic or closest-match posttest items. The expert-designed Q-matrix maps these items to ten probability principles: Addition Theorem for Three Events (A3), Total Probability Theorem (TPT), Definition of Conditional Probability (CP), Addition Theorem for Two Events (A2), De Morgan's Law (DMT), Complement Theorem (CT), Bayes' Rule (BR), Definition of Independent Events (IE), Definition of Mutually Exclusive Events (MET), and Definition of Conditionally Independent Events (CIE). Table 7 reports the complete item–principle mapping.
Gen-AI Detector Data Construction – Methodology
AI-Assisted Response Construction. Complete LLM rewriting often creates conspicuous differences in length, fluency, and style, encouraging shortcut learning. We instead construct partially assisted responses that preserve most of the original student text.
For an authentic human response , let denote its number of tokens and its token sequence, where denotes the original token at position . Let denote a binary masking vector, where indicates a masked position and an original token. The masking ratio is defined as:
The mask is sampled such that . Let denote the resulting masked sequence. An offline DeepSeek model reconstructs only its masked positions, where denotes the token generated for position .
Let denote the resulting partially AI-assisted response, where denotes its token at position . A generated token is used at a masked position, whereas the original token is retained otherwise. The resulting token is defined as:
This procedure preserves 50–70% of the original response, retaining student-specific linguistic and mathematical characteristics while reducing obvious stylistic distinctions. Original responses are labeled human-written, whereas partially completed and fully generated correct responses form the AI-assisted class.
Detector Controls. Source human responses and their synthetic counterparts share a group identifier and cannot cross data partitions. Detector inputs are matched by item, score stratum, and length bin to reduce correctness- and length-based shortcuts. The calibration temperature is fitted on the validation set and then fixed. Generator transfer is evaluated by withholding one generator family from detector development.
AI-Aware Mastery-Target Weighting – Methodology
The standard G-DINA model produces an unweighted mastery target for student s, principle k, and phase t. For AICG, each response r is assigned the reliability weight
where is the calibrated AI-assistance probability. Let denote the G-DINA log-likelihood contribution of response r under mastery profile and item parameters . The reliability-weighted log-likelihood is
The corresponding weighted posterior is
and the AI-aware mastery target is its posterior marginal:
Finally, the reliability-adjusted learning-gain target is
Full Cognitive uses the corresponding unweighted targets obtained by setting all response weights to one. AI assistance therefore modifies only the reliability of cognitive evidence; it does not alter the instructor-assigned response-level grading labels.
AICG Hyperparameter Settings – Experiments
Table 8 reports implementation settings not specified in the main paper. The Gen-AI Detector and multi-task grading components both use roberta-base. Hyperparameters are fixed across all evaluation semesters and random seeds. Mixed-precision training is used during supervised contrastive pretraining. The linear classifier is trained with standard cross-entropy while the pretrained encoder and projection layer remain frozen. Multi-task Grading is trained end to end with a linear learning-rate schedule following a warmup period covering the first 10% of optimization steps.
Table 5: Composition of the longitudinal ASAG dataset.
| Semester | Students | Pre Answers | Post Answers | Total Answers | AI Answers | AI Percentage |
|---|---|---|---|---|---|---|
| Pre-Gen-AI | 2,530 | 19,076 | 16,452 | 35,528 | 0 | 0.00% |
| F22 | 277 | 2,020 | 1,084 | 3,104 | 416 | 13.40% |
| S23 | 170 | 1,347 | 735 | 2,082 | 482 | 23.15% |
| F23 | 376 | 2,946 | 1,531 | 4,477 | 1,055 | 23.56% |
| S24 | 218 | 890 | 898 | 1,788 | 365 | 20.41% |
| F24 | 290 | 1,206 | 1,217 | 2,423 | 578 | 23.85% |
| Post-Gen-AI | 1,331 | 8,409 | 5,465 | 13,874 | 2,896 | 20.87% |
| Overall | 3,861 | 27,485 | 21,917 | 49,402 | 2,896 | - |
Table 6: Expanding-window evaluation splits.
| Test Semester | Historical Training Window |
|---|---|
| F22 | F14–S22 |
| S23 | F14–F22 |
| F23 | F14–S23 |
| S24 | F14–F23 |
| F24 | F14–S24 |
G-DINA Configuration and Estimation. Pretest and posttest mastery profiles are estimated separately using a fractional-response extension of the G-DINA model. Each normalized instructor-assigned score is used directly as fractional item-response evidence rather than being converted into binary outcomes or ordered response categories. For a mastery profile , the contribution of response is
where is the G-DINA success probability.
Pretest and posttest parameters are estimated separately through marginal maximum likelihood using the expectation-maximization algorithm under an independent attribute distribution. We use three random initializations, constrain success probabilities to , and retain the solution with the highest observed-data likelihood. Convergence requires the maximum absolute changes in both item success probabilities and attribute mixing proportions to fall below between consecutive iterations, with a maximum of 1,000 EM iterations.
For AICG, each fractional-response contribution is further scaled by the reliability weight , as defined in Equation (11). The resulting posterior mastery probabilities are computed using Equation (12). Full Cognitive uses the same estimation procedure with for every response. All G-DINA parameters and mastery targets are estimated separately within each expanding window using historical data only; the target evaluation semester is excluded from both parameter estimation and target construction.
Baseline Configurations – Experiments
Common Evaluation Protocol. All baselines use the same expanding-window splits, preprocessing pipeline, grade boundaries, and evaluation metrics as AICG. Transformer baselines receive the same textual input as AICG, consisting of the question identifier, student response, and principle metadata. ASQ-DBN follows its original answer, student, and question feature construction, while prompt-based baselines receive the same available information in textual form. No baseline uses Q-matrix targets, cognitive labels, AI-assistance probabilities, or reliability weights. Trainable baselines are evaluated with random seeds 42, 52, 62, 72, and 82, whereas prompt-based baselines use five independent runs. Model selection uses only the historical validation partition associated with each evaluation semester.
RoBERTa. RoBERTa is the score-only counterpart of AICG and uses roberta-base with a sigmoid regression head (Liu et al. 2019). To isolate the contribution of cognitive and multi-objective supervision, it uses the same tokenization, maximum sequence length of 512, student-record batching, and regression objective as AICG. Specifically, the model is trained with category-weighted Smooth L1 loss using and category weights . Optimization uses AdamW with a learning rate of , weight decay of 0.01, dropout of 0.10, a linear warmup over the first 10% of optimization steps, with gradient clipping at 1.0. Training lasts for eight epochs. Continuous predictions are bounded to , and discrete grades are obtained using the common boundaries 0.125, 0.375, 0.625, and 0.875.
BERT. BERT replaces the RoBERTa encoder with bert-base-uncased while retaining the same input, regression head, loss, optimization settings, training epochs, and validation procedure (Zhu, Wu, and Zhang 2022). This controlled adaptation isolates the influence of the pretrained encoder without introducing additional architectural or supervision differences. Its continuous and discrete predictions are evaluated using the same procedures as those of RoBERTa.
ASQ-DBN. ASQ-DBN follows the answer-student-question modeling principle of Zhang, Lin, and Chi 2020. The answer representation is constructed using TF-IDF word unigrams and bigrams with a maximum vocabulary of 10,000 terms, fitted only on the historical training data. Student features comprise the mean, standard deviation, and number of scores observed strictly before the evaluation semester; unseen students receive the historical population statistics
Table 7: Expert Q-matrix for the pretest and aligned posttest items.
| Phase | Item | CT | MET | IE | DMT | A2 | A3 | CIE | CP | TPT | BR |
|---|---|---|---|---|---|---|---|---|---|---|---|
| Pre | 60 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 |
| Pre | 63 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 |
| Pre | 64 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 |
| Pre | 65 | 1 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 |
| Pre | 66 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 |
| Pre | 67 | 0 | 1 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 0 |
| Pre | 69 | 1 | 1 | 0 | 1 | 1 | 1 | 0 | 0 | 0 | 0 |
| Pre | 205 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 |
| Post | 90 | 0 | 1 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 0 |
| Post | 91 | 1 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 |
| Post | 93 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 |
| Post | 95 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 |
| Post | 96 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 |
| Post | 99 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 |
| Post | 101 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 |
| Post | 106 | 1 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 |
Table 8: Implementation settings for each component of AICG.
| Component | Setting | Final Value |
|---|---|---|
| Gen-AI Detector: contrastive pretraining | BackboneMaximum sequence lengthProjection dimensionBalanced mini-batch sizeOptimizerLearning rateTraining epochsGradient-norm threshold | roberta-base512 tokens76864 (32 per class)AdamW101.0 |
| Gen-AI Detector: linear classification | Frozen componentsClassifierMaximum sequence lengthMini-batch sizeOptimizerLearning rateTraining epochs | Encoder and projection layer768-to-2 linear layer256 tokens64Adam5 |
| Multi-task Grading | BackboneMaximum sequence lengthMini-batch sizeOptimizerLearning rateWeight decayTraining epochsDropout probabilityLearning-rate scheduleWarmup proportionGradient-norm threshold | roberta-base512 tokensOne student recordAdamW0.0180.10Linear decay0.101.0 |
| AICG evaluation | Random seeds | 42, 52, 62, 72, and 82 |
and an additional missing-history indicator. Question features include a one-hot question identifier and the historical mean, standard deviation, and number of responses for that question. No score from the evaluation semester is used to construct student or question features.
The concatenated answer, student, and question features are processed by a deep belief network with hidden dimen-
sions 512 and 128. Each layer is initialized through 20 epochs of contrastive-divergence pretraining, after which the complete network is fine-tuned using Adam with a learning rate of , batch size 64, dropout of 0.20, and weight decay of . Fine-tuning runs for at most 50 epochs with early stopping after five epochs without validation improvement. A five-class softmax layer produces grade probabilities. The discrete prediction is the highest-probability category, while its continuous counterpart is calculated as the expected normalized category score, .
GPT-4o Scoring. GPT-4o Scoring uses the fixed model snapshot gpt-4o-2024-08-06 without parameter updates (OpenAI 2024; Ferreira Mello et al. 2025). Each request contains the question identifier, principle descriptions and weights, student response, and definitions of the five ordered grade categories. The model is instructed to return only one category in 0, 1, 2, 3, 4. We use temperature 0, top-, and a maximum output length of 16 tokens. The first valid standalone category is parsed from the output. An invalid output triggers one deterministic repair request using the same model and prompt context.
The predicted category is used directly for exact accuracy, Macro-F1, and QWK. For continuous evaluation, category is mapped to . Five independent API runs are conducted using the same model snapshot and fixed prompt. Neither in-context examples nor responses from the evaluation semester are used.
GradeOpt. GradeOpt follows the Grader-Reflector-Refiner framework of Chu et al. 2025. A separate grading guideline is optimized for each question using only the historical training and validation data. The initial guideline contains the available principle metadata, principle weights, and five-category grade definitions. GPT-4o is used for the Grader, Reflector, and Refiner. The Grader uses temperature 0, while the Reflector and Refiner use temperature 0.5.
Following the original configuration, guideline optimization uses an outer batch size of 64, an inner batch size of 8, five outer iterations, three inner iterations, and a UCB beam size of 4. Each optimization batch contains equal proportions of high-error and randomly sampled historical examples. Cohen's kappa on the historical validation set serves as the guideline-selection criterion. Inner or outer optimization terminates when no improvement is observed for two consecutive iterations.
To preserve temporal isolation, the optimized guideline is frozen before evaluation and GradeOpt's test-time adaptation is disabled. Thus, no response or label from the evaluation semester is provided to the Grader, Reflector, or Refiner during guideline optimization. The final grader outputs one category in 0, 1, 2, 3, 4, which is mapped to for continuous evaluation. Five independent optimization and evaluation runs are reported.