Predicting Program Exit Code with LLMs and Programming Language Semantics. Marinov, L., Thimmaiah, A., Srinivasa, J., Li, J. J., & Gligoric, M. September, 2026. Version Number: 1
Paper doi abstract bibtex Large language models (LLMs) have shown proficiency in various software engineering tasks, such as code generation and translation. However, a key limitation in their performance may be their (lack of) understanding of programminglanguage semantics. Even when explicit semantics are given, it remains unclear whether LLMs apply those rules or lean on priors learned during pre-training instead. We study if LLMs lean on priors or given semantics with a novel task–Program Executability Prediction (PrEx)–that asks models to predict whether a program is semantically valid or invalid (and, if invalid, which formal rule it violates) given the program’s syntax and operational semantics. Because PrEx requires both valid and invalid programs, we build a dataset with systematically generated invalid transformations derived from valid programs. We evaluate open-source coding LLMs under two semantic formalisms and two semantic shifts across HumanWritten, LLM-Translated, and Fuzzer-Generated program splits. Our findings show that LLMs lean on pre-training priors rather than systematically applying the given rules, performing especially poorly on modified semantics and degrading further as program complexity increases. PrEx is available at https://github.com/EngineeringSoftware/prex.
@misc{marinov_predicting_2026,
title = {Predicting {Program} {Exit} {Code} with {LLMs} and {Programming} {Language} {Semantics}},
copyright = {Creative Commons Attribution 4.0 International},
url = {https://arxiv.org/abs/2609.00579},
doi = {10.48550/ARXIV.2609.00579},
abstract = {Large language models (LLMs) have shown proficiency in various software engineering tasks, such as code generation and translation. However, a key limitation in their performance may be their (lack of) understanding of programminglanguage semantics. Even when explicit semantics are given, it remains unclear whether LLMs apply those rules or lean on priors learned during pre-training instead. We study if LLMs lean on priors or given semantics with a novel task–Program Executability Prediction (PrEx)–that asks models to predict whether a program is semantically valid or invalid (and, if invalid, which formal rule it violates) given the program’s syntax and operational semantics. Because PrEx requires both valid and invalid programs, we build a dataset with systematically generated invalid transformations derived from valid programs. We evaluate open-source coding LLMs under two semantic formalisms and two semantic shifts across HumanWritten, LLM-Translated, and Fuzzer-Generated program splits. Our findings show that LLMs lean on pre-training priors rather than systematically applying the given rules, performing especially poorly on modified semantics and degrading further as program complexity increases. PrEx is available at https://github.com/EngineeringSoftware/prex.},
language = {en},
urldate = {2026-09-16},
publisher = {arXiv},
author = {Marinov, Lara and Thimmaiah, Aditya and Srinivasa, Jayanth and Li, Junyi Jessy and Gligoric, Milos},
month = sep,
year = {2026},
note = {Version Number: 1},
keywords = {Artificial Intelligence (cs.AI), Computation and Language (cs.CL), F.3.2; I.2.6, FOS: Computer and information sciences, Programming Languages (cs.PL), Software Engineering (cs.SE)},
}
Downloads: 0
{"_id":"qnhsANk4d2ShLeJT7","bibbaseid":"marinov-thimmaiah-srinivasa-li-gligoric-predictingprogramexitcodewithllmsandprogramminglanguagesemantics-2026","author_short":["Marinov, L.","Thimmaiah, A.","Srinivasa, J.","Li, J. J.","Gligoric, M."],"bibdata":{"bibtype":"misc","type":"misc","title":"Predicting Program Exit Code with LLMs and Programming Language Semantics","copyright":"Creative Commons Attribution 4.0 International","url":"https://arxiv.org/abs/2609.00579","doi":"10.48550/ARXIV.2609.00579","abstract":"Large language models (LLMs) have shown proficiency in various software engineering tasks, such as code generation and translation. However, a key limitation in their performance may be their (lack of) understanding of programminglanguage semantics. Even when explicit semantics are given, it remains unclear whether LLMs apply those rules or lean on priors learned during pre-training instead. We study if LLMs lean on priors or given semantics with a novel task–Program Executability Prediction (PrEx)–that asks models to predict whether a program is semantically valid or invalid (and, if invalid, which formal rule it violates) given the program’s syntax and operational semantics. Because PrEx requires both valid and invalid programs, we build a dataset with systematically generated invalid transformations derived from valid programs. We evaluate open-source coding LLMs under two semantic formalisms and two semantic shifts across HumanWritten, LLM-Translated, and Fuzzer-Generated program splits. Our findings show that LLMs lean on pre-training priors rather than systematically applying the given rules, performing especially poorly on modified semantics and degrading further as program complexity increases. PrEx is available at https://github.com/EngineeringSoftware/prex.","language":"en","urldate":"2026-09-16","publisher":"arXiv","author":[{"propositions":[],"lastnames":["Marinov"],"firstnames":["Lara"],"suffixes":[]},{"propositions":[],"lastnames":["Thimmaiah"],"firstnames":["Aditya"],"suffixes":[]},{"propositions":[],"lastnames":["Srinivasa"],"firstnames":["Jayanth"],"suffixes":[]},{"propositions":[],"lastnames":["Li"],"firstnames":["Junyi","Jessy"],"suffixes":[]},{"propositions":[],"lastnames":["Gligoric"],"firstnames":["Milos"],"suffixes":[]}],"month":"September","year":"2026","note":"Version Number: 1","keywords":"Artificial Intelligence (cs.AI), Computation and Language (cs.CL), F.3.2; I.2.6, FOS: Computer and information sciences, Programming Languages (cs.PL), Software Engineering (cs.SE)","bibtex":"@misc{marinov_predicting_2026,\n\ttitle = {Predicting {Program} {Exit} {Code} with {LLMs} and {Programming} {Language} {Semantics}},\n\tcopyright = {Creative Commons Attribution 4.0 International},\n\turl = {https://arxiv.org/abs/2609.00579},\n\tdoi = {10.48550/ARXIV.2609.00579},\n\tabstract = {Large language models (LLMs) have shown proficiency in various software engineering tasks, such as code generation and translation. However, a key limitation in their performance may be their (lack of) understanding of programminglanguage semantics. Even when explicit semantics are given, it remains unclear whether LLMs apply those rules or lean on priors learned during pre-training instead. We study if LLMs lean on priors or given semantics with a novel task–Program Executability Prediction (PrEx)–that asks models to predict whether a program is semantically valid or invalid (and, if invalid, which formal rule it violates) given the program’s syntax and operational semantics. Because PrEx requires both valid and invalid programs, we build a dataset with systematically generated invalid transformations derived from valid programs. We evaluate open-source coding LLMs under two semantic formalisms and two semantic shifts across HumanWritten, LLM-Translated, and Fuzzer-Generated program splits. Our findings show that LLMs lean on pre-training priors rather than systematically applying the given rules, performing especially poorly on modified semantics and degrading further as program complexity increases. PrEx is available at https://github.com/EngineeringSoftware/prex.},\n\tlanguage = {en},\n\turldate = {2026-09-16},\n\tpublisher = {arXiv},\n\tauthor = {Marinov, Lara and Thimmaiah, Aditya and Srinivasa, Jayanth and Li, Junyi Jessy and Gligoric, Milos},\n\tmonth = sep,\n\tyear = {2026},\n\tnote = {Version Number: 1},\n\tkeywords = {Artificial Intelligence (cs.AI), Computation and Language (cs.CL), F.3.2; I.2.6, FOS: Computer and information sciences, Programming Languages (cs.PL), Software Engineering (cs.SE)},\n}\n\n\n\n\n\n\n\n","author_short":["Marinov, L.","Thimmaiah, A.","Srinivasa, J.","Li, J. J.","Gligoric, M."],"key":"marinov_predicting_2026","id":"marinov_predicting_2026","bibbaseid":"marinov-thimmaiah-srinivasa-li-gligoric-predictingprogramexitcodewithllmsandprogramminglanguagesemantics-2026","role":"author","urls":{"Paper":"https://arxiv.org/abs/2609.00579"},"keyword":["Artificial Intelligence (cs.AI)","Computation and Language (cs.CL)","F.3.2; I.2.6","FOS: Computer and information sciences","Programming Languages (cs.PL)","Software Engineering (cs.SE)"],"metadata":{"authorlinks":{}},"downloads":0},"bibtype":"misc","biburl":"https://bibbase.org/zotero-group/pratikmhatre/5933976","dataSources":["yJr5AAtJ5Sz3Q4WT4"],"keywords":["artificial intelligence (cs.ai)","computation and language (cs.cl)","f.3.2; i.2.6","fos: computer and information sciences","programming languages (cs.pl)","software engineering (cs.se)"],"search_terms":["predicting","program","exit","code","llms","programming","language","semantics","marinov","thimmaiah","srinivasa","li","gligoric"],"title":"Predicting Program Exit Code with LLMs and Programming Language Semantics","year":2026}