Next Article in Journal
LCVR-Net: Dual-Attention Visibility Restoration for Traffic Surveillance Under Dust and Fog Degradation
Previous Article in Journal
Aerodynamic Benefits of Efficient Side-Pacer Arrangements in Elite Marathon Drafting
Previous Article in Special Issue
Hybrid Semantic–Syntactic NLP Framework for Intelligent Grading of Short Answers and Cloze Questions
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

From Black-Box Grading to Pedagogically Aligned AI Assessment: A Hybrid LLM–RAG Framework for Explainable and Scalable Automated Code Evaluation

by
Pablo Manuel Vigara Gallego
*,
Ascension Lopez Vargas
,
Angel Garcia Beltran
and
Javier Rodriguez Vidal
Unidad Docente de Informática Industrial, Universidad Politécnica de Madrid, 28006 Madrid, Spain
*
Author to whom correspondence should be addressed.
Appl. Sci. 2026, 16(18), 9268; https://doi.org/10.3390/app16189268 (registering DOI)
Submission received: 20 June 2026 / Revised: 16 July 2026 / Accepted: 27 July 2026 / Published: 18 September 2026
(This article belongs to the Special Issue Applications of Artificial Intelligence in Innovative Education)

Featured Application

The proposed hybrid LLM–RAG framework is deployed in EvaluaTeC, a real-world platform used to automatically grade and provide pedagogically aligned feedback on programming assignments, validated on 1287 student submissions across engineering courses at Universidad Politécnica de Madrid.

Abstract

Automated assessment of programming assignments remains a major challenge in higher education, particularly in large-scale courses where timely, consistent, and pedagogically meaningful feedback is difficult to provide, while Large Language Models (LLMs) have shown strong capabilities in code understanding and feedback generation, their use as standalone evaluators is fundamentally limited by inconsistency, lack of transparency, and weak alignment with instructional objectives. This paper argues that these limitations are not intrinsic to LLMs, but rather arise from their deployment as isolated components. In response, we propose a system-centric approach to AI-assisted assessment, introducing a hybrid framework that integrates LLMs within a structured, context-aware, and pedagogically aligned evaluation pipeline. The framework combines (i) explicit rubric-based decomposition of evaluation criteria, (ii) pedagogically guided prompting, and (iii) Retrieval-Augmented Generation (RAG) grounded in course-specific materials. Together, these components transform the evaluation process from a black-box prediction task into a traceable and reproducible decision process. The proposed approach is implemented in a real-world educational platform, EvaluaTeC, and evaluated on a dataset of 1287 programming submissions from 429 students. Experimental results show that the hybrid framework improves agreement with consolidated instructor reference grades (r=0.9059 vs. 0.7207 baseline), reduces evaluation error (MAE = 0.5134), and exhibited lower output variability in the recorded aggregate statistics, while maintaining practical latency and cost. Beyond numerical improvements, the system approximates key statistical properties of human grading and generates structured, pedagogically aligned feedback. These findings demonstrate that reliable AI-assisted assessment emerges from the integration of LLMs within structured and context-aware systems, rather than from model capabilities alone. This work contributes a principled framework for explainable and scalable automated assessment, advancing the design of trustworthy AI systems in education. This shift reframes automated assessment as a systems problem rather than a purely model-centric task.
Keywords: automated code assessment; AI-assisted learning; Retrieval-Augmented Generation (RAG); Explainable AI (XAI) automated code assessment; AI-assisted learning; Retrieval-Augmented Generation (RAG); Explainable AI (XAI)

Share and Cite

MDPI and ACS Style

Vigara Gallego, P.M.; Vargas, A.L.; Beltran, A.G.; Vidal, J.R. From Black-Box Grading to Pedagogically Aligned AI Assessment: A Hybrid LLM–RAG Framework for Explainable and Scalable Automated Code Evaluation. Appl. Sci. 2026, 16, 9268. https://doi.org/10.3390/app16189268

AMA Style

Vigara Gallego PM, Vargas AL, Beltran AG, Vidal JR. From Black-Box Grading to Pedagogically Aligned AI Assessment: A Hybrid LLM–RAG Framework for Explainable and Scalable Automated Code Evaluation. Applied Sciences. 2026; 16(18):9268. https://doi.org/10.3390/app16189268

Chicago/Turabian Style

Vigara Gallego, Pablo Manuel, Ascension Lopez Vargas, Angel Garcia Beltran, and Javier Rodriguez Vidal. 2026. "From Black-Box Grading to Pedagogically Aligned AI Assessment: A Hybrid LLM–RAG Framework for Explainable and Scalable Automated Code Evaluation" Applied Sciences 16, no. 18: 9268. https://doi.org/10.3390/app16189268

APA Style

Vigara Gallego, P. M., Vargas, A. L., Beltran, A. G., & Vidal, J. R. (2026). From Black-Box Grading to Pedagogically Aligned AI Assessment: A Hybrid LLM–RAG Framework for Explainable and Scalable Automated Code Evaluation. Applied Sciences, 16(18), 9268. https://doi.org/10.3390/app16189268

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop