Research map / Large language models / Agents, code and math
Can LLMs Reason About Program Semantics? A Comprehensive Evaluation of LLMs on Formal Specification Inference
Thanh Le-Cong, Bach Le, Toby Murray
University of Melbourne
Read the paperPlace an idea next to itCheck your own paper ↗
AI-extracted. The measured effects below were read by AI from the paper's full text (no summary yet). Numbers and claims can be wrong or missing context, so check the paper before you cite or build on it.
This paper tried a common change: Chain-of-thought prompting
add chain-of-thought prompting on top of few-shot · FormalBench-Base · success rate (%): DeepSeek-V3 15.5 -> 16.2; GPT-4o 13.4 -> 13.4; Claude 14.7 -> 14.2 Mixed
What 2,675 accepted papers report for this change
- 1,683 improved
- 270 no clear effect
- 109 mixed
- 613 hurt
- AudioChat: Unified Audio Storytelling, Editing, and Understanding with Transfusion Forcing ICML 2026 · add structured chain-of-thought reasoning to the diffusion LLM · StoryGen-Eval editing · delta multiFLAM: 27.8 -> 11.7Improved
- Vision Language Models Cannot Reason About Physical Transformation ICML 2026 · add CoT prompt instead of Direct prompt · Number & Length · accuracy: F(3, 333) = 18.28Hurt
- VideoSEG-O3: A Multi-turn Reinforcement Learning Framework for Reasoning Video Object Segmentation ICML 2026 · Add CoT cold-start stage on top of SFT · Long-RVOS · J&F: 47.12 -> 51.82Improved
See this change in detailMatched by the wording of each paper's own result, read by AI from the full text. Papers report gains more often than failures, so this shows what gets published, not the chance a change works.
Measured effects reported in the paper
| What was changed | Where | Measured | Effect |
|---|---|---|---|
| add few-shot prompt with JML syntax instructions (ablation) | DeepSeek-V3-671B · FormalBench-Base | success rate (%): 8.4 -> 15.5 | Improved |
| add few-shot prompt (ablation) | LLMs · FormalBench-Base | completeness rate (%): e.g. GPT-4o 80.4 -> 77.6 | Hurt |
| add least-to-most prompting on top of few-shot (ablation) | DeepSeek-V3-671B · FormalBench-Base | success rate (%): 15.5 -> 16.6 | Improved |
| add least-to-most prompting on top of few-shot (ablation) | GPT-4o · FormalBench-Base | success rate (%): 13.4 -> 15.0 | Improved |
| add least-to-most prompting on top of few-shot (ablation) | CodeQwen-2.5-32B · FormalBench-Base | success rate (%): 11.4 -> 12.0 | Improved |
| add chain-of-thought prompting on top of few-shot (ablation) | DeepSeek-V3-671B / GPT-4o / Claude-3.5-Sonnet · FormalBench-Base | success rate (%): DeepSeek-V3 15.5 -> 16.2; GPT-4o 13.4 -> 13.4; Claude 14.7 -> 14.2 | Mixed |
| add chain-of-thought prompting on top of few-shot (ablation) | GPT-4o · FormalBench-Base | failure rate (%): 56.4 -> 61.5 | Hurt |
| activate high reasoning mode (ablation) | o3-mini · FormalBench-Base | completeness rate (%): 83.5 -> 97.2 | Improved |
| activate high reasoning mode (ablation) | o3-mini · FormalBench-Base | success rate (%): 10.0 -> 10.6 | No clear effect |
| apply semantic-preserving transformations to programs | DeepSeek-V3 / Claude-3.5-Sonnet / GPT-4o · FormalBench-Diverse-N | success rate (%): DeepSeek-V3 9.3 -> 7.8; Claude 10.0 -> 8.3; GPT-4o 11.9 -> 10.9 | Hurt |
| use programs with loops instead of sequential/branching | LLMs · FormalBench-Base | success rate (%): success below 10%, failure above 50% for loop programs | Hurt |
| add failure-specific self-repair prompts (ablation) | Claude-3.5-Sonnet / GPT-4o / DeepSeek-V3 · FormalBench-Base | success rate (%): 16% -> 20% | Improved |
Open problems this paper states
- “Study covers only Java and the Java Modeling Language, not other programming languages.” → Tested on Python or a few languages, so other languages are untested. (an open problem in code generation benchmarks)
Open problems in code generation benchmarks
Do code benchmarks and methods hold beyond Python, small test sets and leaked data?
- Tested on Python or a few languages, so other languages are untested. · 25 papers state it
- Benchmarks are small, with a few dozen to a few hundred problems. · 14 papers state it
- Iterative or multi-step methods cost more tokens, latency and compute. · 12 papers state it
Closest papers by meaning
- Evaluating Program Semantics Reasoning with Type Inference in System F (NeurIPS 2025 · similarity 0.92)
- CoRe: Benchmarking LLMs’ Code Reasoning Capabilities through Static Analysis Tasks (NeurIPS 2025 · similarity 0.92)
- SemCoder: Training Code Language Models with Comprehensive Semantics Reasoning (NeurIPS 2024 · similarity 0.90)
- Lemur: Integrating Large Language Models in Automated Program Verification (ICLR 2024 · similarity 0.89)
- Grammars of Formal Uncertainty: When to Trust LLMs in Automated Reasoning Tasks (NeurIPS 2025 · similarity 0.88)
- Verified Code Transpilation with LLMs (NeurIPS 2024 · similarity 0.88)
Writing a paper in this area? scime draft is a free LaTeX editor with AI included, real-time co-authors and a check of your references and venue rules before you submit. It also imports OpenAI Prism projects.