Can LLMs Formally Reason as Abstract Interpreters for Program Analysis?
By: Jacqueline L. Mitchell , Brian Hyeongseok Kim , Chenyu Zhou and more
Potential Business Impact:
Helps computers check computer code for mistakes.
LLMs have demonstrated impressive capabilities in code generation and comprehension, but their potential in being able to perform program analysis in a formal, automatic manner remains under-explored. To that end, we systematically investigate whether LLMs can reason about programs using a program analysis framework called abstract interpretation. We prompt LLMs to follow two different strategies, denoted as Compositional and Fixed Point Equation, to formally reason in the style of abstract interpretation, which has never been done before to the best of our knowledge. We validate our approach using state-of-the-art LLMs on 22 challenging benchmark programs from the Software Verification Competition (SV-COMP) 2019 dataset, widely used in program analysis. Our results show that our strategies are able to elicit abstract interpretation-based reasoning in the tested models, but LLMs are susceptible to logical errors, especially while interpreting complex program structures, as well as general hallucinations. This highlights key areas for improvement in the formal reasoning capabilities of LLMs.
Similar Papers
Can LLMs Reason About Program Semantics? A Comprehensive Evaluation of LLMs on Formal Specification Inference
Programming Languages
Tests if computers can understand code logic.
Evaluating Intermediate Reasoning of Code-Assisted Large Language Models for Mathematics
Computation and Language
Helps computers solve math problems more logically.
Interpretability Framework for LLMs in Undergraduate Calculus
Computers and Society
Checks math answers by understanding how they're solved.