[edit]
The Reliability Gap: A Multi-Dimensional Technical Audit of Memory Safety and Logical Integrity in LLM-Generated C Code
Proceedings of the The 39th Canadian Conference on Artificial Intelligence, PMLR 318:968-974, 2026.
Abstract
The integration of Large Language Models (LLMs) into C programming education offers a scalable solution to the systemic enrollment crisis in computer science. However, the non-deterministic nature of these probabilistic engines introduces a critical reliability gap, particularly in C programming - a domain characterized by manual memory management and a high risk of Undefined Behavior (UB). This study presents a multi-dimensional technical audit - integrating static structural analysis with dynamic runtime integrity checks - of four 2026 frontier models: GPT-OSS 120B, Llama 3.3 70B, Moonshot Kimi K2, and Qwen 3 32B. Utilizing an automated evaluation pipeline, 1195 code generations across a gradient of complexity (Pointers, Dynamic Memory, and Data Structures) were subjected to static analysis and dynamic runtime instrumentation. Experimental results reveal a significant "Technical Reliability Gap": while models achieve high Compilation Success Rates (CSR), dynamic analysis identified a frequent incidence of "Definitely Lost" heap memory and "logical hangs". We further identify a correlation between architectural paradigm and safety, finding that sparse Mixture-of-Experts (MoE) architectures exhibit lower Static Error Density (SED) and higher logic density than dense counterparts. We conclude by offering a framework for trust calibration based on these technical breaking points, assisting educators in mitigating the "oracle hazards" of AI-mediated instruction.