Exploring Code Analysis: Zero-Shot Insights on Syntax and Semantics with LLMs
Not on the map. Why?
Abstract (arXiv)
Code analysis is fundamental in Software Engineering, supporting debugging, optimization, and security assessment. Human developers approach it through syntax parsing, static semantics inference, and dynamic reasoning. Traditional tools are effective but limited by language specificity and weak cross-language generalization. Large language models (LLMs) are promising for code tasks, yet their capabilities for fundamental code analysis remain underexplored. We structure our study around three aspects aligned with human practices: syntax parsing, static semantics inference, and dynamic reasoning. We evaluate 21 state-of-the-art LLMs across nine tasks in four languages (C, Java, Python, Solidity), including AST generation, CFG construction, data dependency, taint analysis, and flaky test reasoning. We apply a three-layer evaluation protocol (automated metrics, expert adjudication, consistency validation) to 3,124 code samples, achieving high inter-rater reliability (Cohen's kappa = 0.844-0.936) and strong human-machine agreement (Gwet's AC1 = 0.500-0.727, F1 = 0.791-0.882). While the best LLMs excel in syntax parsing (AST 90%+, expression matching 84-100%) and show promise in static analysis, their dynamic reasoning remains limited (<70%) with high data-shift sensitivity (per-project F1 varying 0-1.0). This hierarchy holds across model families and scales, suggesting fundamental rather than transient limitations. These findings show how LLMs complement traditional analyzers: they offer cross-language generalization but non-deterministic outputs needing validation, while traditional tools give deterministic guarantees but need language-specific configuration. We contribute a validated evaluation framework with comparison against traditional analyzers (Tree-sitter, Soot, Joern) and task-specific applicability tiers. Benchmark: https://github.com/mathieu0905/llm_code_analysis.git
Key facts. Cited by 19 papers in the map (data through 14 Oct 2026). Builds on 16 of its 32 references that are in the map. First posted on arXiv 20 May 2023.
Builds on
16 of 32 references.
References · 16
- 2021Pre-train, Prompt, and Predict: A Systematic Survey of Prompting Methods in Natural Language Processingcited by 2,234
- 2023Is Your Code Generated by ChatGPT Really Correct? Rigorous Evaluation of Large Language Models for Code Generationcited by 1,391
- 2020CodeBERT: A Pre-Trained Model for Programming and Natural Languagescited by 1,310
- 2021CodeT5: Identifier-aware Unified Pre-trained Encoder-Decoder Models for Code Understanding and Generationcited by 906
- 2020A Primer in BERTology: What we know about how BERT workscited by 815
- 2022UniXcoder: Unified Cross-Modal Pre-training for Code Representationcited by 361
- 2020AutoPrompt: Eliciting Knowledge from Language Models with Automatically Generated Promptscited by 249
- 2023Keep the Conversation Going: Fixing 162 out of 337 bugs for 0.42 each using ChatGPTcited by 125
- 2022What Do They Capture? -- A Structural Analysis of Pre-Trained Language Models for Source Codecited by 50
- 2022SPT-Code: Sequence-to-Sequence Pre-Training for Learning Source Code Representationscited by 36
- 2022Dataflow Analysis-Inspired Deep Learning for Efficient Vulnerability Detectioncited by 19
- 2022AST-Probe: Recovering abstract syntax trees from hidden representations of pre-trained language modelscited by 16
4 more
- 2021GraphCode2Vec: Generic Code Embedding via Lexical and Program Dependence Analysescited by 11
- 2022Unveiling Code Pre-Trained Models: Investigating Syntax and Semantics Capacitiescited by 9
- 2022A Simple, Yet Effective Approach to Finding Biases in Code Generationcited by 8
- 2021Rich Specifications for Ethereum Smart Contract Verificationcited by 2
Built on by
Citing papers per year: 2024: 6; 2025: 10; 2026: 3.
19 papers.
Sort:
By area:
- 2025Trae Agent: An LLM-based Agent for Software Engineering with Test-time Scalingcited by 94
- 2024From LLMs to LLM-based Agents for Software Engineering: A Survey of Current, Challenges and Futurecited by 86
- 2024Agents in Software Engineering: Survey, Landscape, and Visioncited by 60
- 2024A Deep Dive Into Large Language Model Code Generation Mistakes: What and Why?cited by 10
- 2025CoCoNUT: Structural Code Understanding does not fall out of a treecited by 7
- 2024Make LLMs better zero-shot reasoners: Structure-orientated autonomous reasoningcited by 6
- 2025Generating Software Architecture Description from Source Code using Reverse Engineering and Large Language Modelcited by 5
- 2024Open-Source AI-based SE Tools: Opportunities and Challenges of Collaborative Software Learningcited by 4
- 2025Trust Me, I Know This Function: Hijacking LLM Static Analysis using Biascited by 3
- 2025Policy-Aware Generative AI for Safe, Auditable Data Access Governancecited by 3
- 2024ZS4C: Zero-Shot Synthesis of Compilable Code for Incomplete Code Snippets using LLMscited by 2
- 2025MLCPD: A Unified Multi-Language Code Parsing Dataset with Universal AST Schemacited by 2
7 more
- 2026SWE-QA: A Dataset and Benchmark for Complex Code Understandingcited by 2
- 2025Can Large Language Models Understand Intermediate Representations in Compilers?cited by 1
- 2025Investigating Execution-Aware Language Models for Code Optimizationcited by 1
- 2026(How) Do Large Language Models Understand High-Level Message Sequence Charts?cited by 1
- 2025Semantic Source Code Segmentation using Small and Large Language Modelscited by 0
- 2025On Generalization in Agentic Tool Calling: CoreThink Agentic Reasoner and MAVEN Datasetcited by 0
- 2026Towards Fully Automated Medical Imaging Code Generation via Validation-based Context Engineeringcited by 0
- 2026Towards Fully Automated Medical Imaging Code Generation via Validation-based Context Engineering29 Aug 2026
- 2026(How) Do Large Language Models Understand High-Level Message Sequence Charts?13 May 2026
- 2026SWE-QA: A Dataset and Benchmark for Complex Code Understanding27 Apr 2026
- 2025Generating Software Architecture Description from Source Code using Reverse Engineering and Large Language Model7 Nov 2025
- 2025Policy-Aware Generative AI for Safe, Auditable Data Access Governance27 Oct 2025
- 2025On Generalization in Agentic Tool Calling: CoreThink Agentic Reasoner and MAVEN Dataset27 Oct 2025
- 2025MLCPD: A Unified Multi-Language Code Parsing Dataset with Universal AST Schema18 Oct 2025
- 2025Trust Me, I Know This Function: Hijacking LLM Static Analysis using Bias24 Aug 2025
- 2025Trae Agent: An LLM-based Agent for Software Engineering with Test-time Scaling31 Jul 2025
- 2025Semantic Source Code Segmentation using Small and Large Language Models11 Jul 2025
- 2025Investigating Execution-Aware Language Models for Code Optimization11 Mar 2025
- 2025Can Large Language Models Understand Intermediate Representations in Compilers?7 Feb 2025
7 more
- 2025CoCoNUT: Structural Code Understanding does not fall out of a tree27 Jan 2025
- 2024A Deep Dive Into Large Language Model Code Generation Mistakes: What and Why?3 Nov 2024
- 2024Make LLMs better zero-shot reasoners: Structure-orientated autonomous reasoning18 Oct 2024
- 2024Agents in Software Engineering: Survey, Landscape, and Vision13 Sep 2024
- 2024From LLMs to LLM-based Agents for Software Engineering: A Survey of Current, Challenges and Future5 Aug 2024
- 2024Open-Source AI-based SE Tools: Opportunities and Challenges of Collaborative Software Learning9 Apr 2024
- 2024ZS4C: Zero-Shot Synthesis of Compilable Code for Incomplete Code Snippets using LLMs25 Jan 2024
- 2024A Deep Dive Into Large Language Model Code Generation Mistakes: What and Why?cited by 10
- 2025CoCoNUT: Structural Code Understanding does not fall out of a treecited by 7
- 2025Generating Software Architecture Description from Source Code using Reverse Engineering and Large Language Modelcited by 5
- 2024Open-Source AI-based SE Tools: Opportunities and Challenges of Collaborative Software Learningcited by 4
- 2025Trust Me, I Know This Function: Hijacking LLM Static Analysis using Biascited by 3
- 2025Policy-Aware Generative AI for Safe, Auditable Data Access Governancecited by 3
- 2024ZS4C: Zero-Shot Synthesis of Compilable Code for Incomplete Code Snippets using LLMscited by 2
- 2025MLCPD: A Unified Multi-Language Code Parsing Dataset with Universal AST Schemacited by 2
- 2026SWE-QA: A Dataset and Benchmark for Complex Code Understandingcited by 2
- 2025Can Large Language Models Understand Intermediate Representations in Compilers?cited by 1
- 2025Investigating Execution-Aware Language Models for Code Optimizationcited by 1
- 2026(How) Do Large Language Models Understand High-Level Message Sequence Charts?cited by 1
12 most cited of 14 All 14 (JSON)
- 2026Towards Fully Automated Medical Imaging Code Generation via Validation-based Context Engineering29 Aug 2026
- 2026(How) Do Large Language Models Understand High-Level Message Sequence Charts?13 May 2026
- 2026SWE-QA: A Dataset and Benchmark for Complex Code Understanding27 Apr 2026
- 2025Generating Software Architecture Description from Source Code using Reverse Engineering and Large Language Model7 Nov 2025
- 2025Policy-Aware Generative AI for Safe, Auditable Data Access Governance27 Oct 2025
- 2025MLCPD: A Unified Multi-Language Code Parsing Dataset with Universal AST Schema18 Oct 2025
- 2025Trust Me, I Know This Function: Hijacking LLM Static Analysis using Bias24 Aug 2025
- 2025Semantic Source Code Segmentation using Small and Large Language Models11 Jul 2025
- 2025Investigating Execution-Aware Language Models for Code Optimization11 Mar 2025
- 2025Can Large Language Models Understand Intermediate Representations in Compilers?7 Feb 2025
- 2025CoCoNUT: Structural Code Understanding does not fall out of a tree27 Jan 2025
- 2024A Deep Dive Into Large Language Model Code Generation Mistakes: What and Why?3 Nov 2024
12 newest of 14 All 14 (JSON)