Abstract
The increasing complexity of software systems has driven significant advancements in program analysis, as traditional methods are unable to meet the demands of modern software development. To address these limitations, deep learning techniques, particularly Large Language Models (LLMs), have gained attention due to their context-aware capabilities in code comprehension. Recognizing the potential of LLMs, researchers have extensively explored their application in program analysis since their introduction. Despite existing surveys on LLM applications in cybersecurity, comprehensive reviews specifically addressing their role in program analysis remain scarce. In this survey, we systematically review the application of LLMs in program analysis, categorizing the existing work into static analysis, dynamic analysis, and hybrid approaches. Moreover, by examining and synthesizing recent studies, we identify future directions and challenges in the field. This survey aims to demonstrate the potential of LLMs in advancing program analysis practices and offer actionable insights for security researchers seeking to enhance detection frameworks or develop domain-specific models.
Introduction: The Complexity Wall
Traditional program analysis is increasingly struggling to keep pace with modern software complexity. Static analysis, which examines code without execution, is often plagued by high false-positive rates and a lack of semantic context. Conversely, dynamic analysis, which tests code during execution, faces "path explosion"—the computational impossibility of exploring every execution route.
While early deep learning models like RNNs or GNNs attempted to bridge these gaps, they lacked the long-range reasoning and multi-turn understanding necessary for complex software. Large Language Models (LLMs) have emerged as a solution, providing the "semantic intuition" that traditional tools lack by leveraging their massive pre-training on both natural language and source code.
A Taxonomy of LLM Integration
The landscape of LLM-assisted program analysis can be categorized into three primary pillars: static analysis, dynamic analysis, and hybrid approaches.
- LLM for Static Analysis: Models analyze Intermediate Representations (IRs) such as Abstract Syntax Trees (ASTs) and Control Flow Graphs (CFGs). LLMs are particularly effective at pruning false alarms from traditional analyzers and generating formal proofs or loop invariants.
- LLM for Dynamic Analysis: LLMs enhance Fuzzing (automated bug hunting) by generating "smart" inputs that adhere to complex protocols. They also automate Penetration Testing through agentic workflows where models act as autonomous security researchers.
- LLM for Hybrid Approaches: These methods combine static context with dynamic validation. For instance, static analysis provides the necessary context for LLM-driven unit test generation, which is then verified through dynamic execution.
Key Insights and Applications
A major trend is the shift toward Agentic Frameworks, where multiple LLMs assume specialized roles (e.g., "Tester," "Developer," and "Critic") to iteratively refine vulnerability reports or code fixes.
The "Semantic Pruner" and Vulnerability Detection
One of the most impactful uses of LLMs is acting as a filter for traditional tools. LLMs excel at distinguishing between true vulnerabilities and harmless false positives by understanding the semantic intent of the code.
As shown in the framework above, LLMs assist across the entire pipeline—from contextual understanding in pre-processing to reducing false positives in the detection model and generating remediation recommendations in the final reports.
Beyond Simple Prompting
The field is moving toward Neuro-symbolic integration. This involves a feedback loop where an LLM generates a hypothesis (such as a Z3 constraint), a formal solver checks its validity, and any error messages are fed back to the LLM for refinement. Additionally, LLMs are proving invaluable in reverse engineering, where they can "guess" meaningful variable names and function purposes in stripped binary code.
Performance and Benchmarks
The survey highlights significant performance gains across various domains:
- Productivity: Frameworks like PentestGPT have improved task completion rates in penetration testing by 228.6% compared to GPT-3.5 baselines.
- Accuracy: Malware detection using models like GPT-4 has reached accuracy levels as high as 99% on specific JavaScript and Android datasets.
- Vulnerability Detection: Tools like LLbezpeky achieved over 90% success in identifying vulnerabilities within the Ghera benchmark by combining LLMs with static analysis.
Challenges and Future Directions
Despite their potential, several hurdles remain:
- The Hallucination Tax: Non-deterministic outputs and "hallucinations" are critical risks in security contexts, where a false sense of security can be disastrous.
- Technical Limitations: LLMs still struggle with exact data types during decompilation and may oversimplify complex patches.
- Scalability: Analyzing large-scale codebases (millions of lines) remains prohibitively expensive due to token limits and API costs.
The future of the field points toward Autonomous Security Researchers, aiming to replicate the full end-to-end workflow of human experts—from initial bug discovery to exploit generation and final patching.
Summary updated