Adaptive Self-Prompting in Agentic LLM Frameworks for Code Fault Detection
Software · 16.04.2026 · 5 (2) · 16
DOI: 10.3390/software5020016 ↗Kurz gefasst
Fachartikel in der Zeitschrift Software, online erschienen am 16.04.2026. Verfasst von Maher Muhtadi und 2 weiteren Autor:innen. Die Arbeit nennt 50 Literaturangaben. Der Volltext ist frei zugänglich (Open Access, CC BY 4.0). Gefördert von: Natural Sciences and Engineering Research Council of Canada.
Abstract (Originalsprache)
Large language models (LLMs) have demonstrated strong capability for code understanding and vulnerability detection. However, most existing approaches rely on static prompting and treat the model as a passive predictor, limiting adaptability under uncertainty, particularly in embedded and cyber-physical systems (CPS). This paper introduces adaptive self-prompting as a core mechanism for agentic LLM-based fault detection in C-language embedded code. We propose two complementary frameworks: Agentic Retrieval-Augmented Generation (A-RAG), which performs confidence-triggered, reasoning-conditioned retrieval from CWE and SEI CERT knowledge bases at inference time, and Agentic Supervised Fine-Tuning (A-SFT), which internalizes improvements through a self-evaluation sweep that refines instructions and training exemplars during fine-tuning. Experiments are conducted on a unified dataset constructed from the Toyota ITC benchmark and a curated subset of Big-Vul aligned to embedded code-relevant CWE categories. Results show that adaptive self-prompting substantially improves predictive performance and error calibration compared to static Retrieval-Augmented Generation (RAG), conventional fine-tuning, and encoder-based baselines, achieving up to 86.3% F1 score while significantly reducing high-confidence misclassifications. These findings demonstrate that confidence-aware reflection and adaptive reasoning enhance both robustness and safety in LLM-based fault detection for embedded and CPS software.
Förderung
- Natural Sciences and Engineering Research Council of Canada
Zitieren
APA
Muhtadi, M., Mahmoud, Q. H., & Azim, A. (2026). Adaptive Self-Prompting in Agentic LLM Frameworks for Code Fault Detection. Software, 5(2), 16. https://doi.org/10.3390/software5020016
Vancouver
Muhtadi M, Mahmoud QH, Azim A. Adaptive Self-Prompting in Agentic LLM Frameworks for Code Fault Detection. Software. 2026;5(2):16. doi:10.3390/software5020016
BibTeX
@article{Muhtadi2026,
author = {Muhtadi, Maher and Mahmoud, Qusay H. and Azim, Akramul},
title = {Adaptive Self-Prompting in Agentic LLM Frameworks for Code Fault Detection},
journal = {Software},
year = {2026},
volume = {5},
number = {2},
pages = {16},
doi = {10.3390/software5020016}
}
EUVIMED