Can Large Language Models Transform Natural Language Intent into Formal Method Postconditions?
Not on the map. Why?
Abstract (arXiv)
Informal natural language that describes code functionality, such as code comments or function documentation, may contain substantial information about a programs intent. However, there is typically no guarantee that a programs implementation and natural language documentation are aligned. In the case of a conflict, leveraging information in code-adjacent natural language has the potential to enhance fault localization, debugging, and code trustworthiness. In practice, however, this information is often underutilized due to the inherent ambiguity of natural language which makes natural language intent challenging to check programmatically. The emergent abilities of Large Language Models (LLMs) have the potential to facilitate the translation of natural language intent to programmatically checkable assertions. However, it is unclear if LLMs can correctly translate informal natural language specifications into formal specifications that match programmer intent. Additionally, it is unclear if such translation could be useful in practice. In this paper, we describe nl2postcond, the problem of leveraging LLMs for transforming informal natural language to formal method postconditions, expressed as program assertions. We introduce and validate metrics to measure and compare different nl2postcond approaches, using the correctness and discriminative power of generated postconditions. We then use qualitative and quantitative methods to assess the quality of nl2postcond postconditions, finding that they are generally correct and able to discriminate incorrect code. Finally, we find that nl2postcond via LLMs has the potential to be helpful in practice; nl2postcond generated postconditions were able to catch 64 real-world historical bugs from Defects4J.
Key facts. Cited by 53 papers in the map (data through 7 Oct 2026). Builds on 16 of its 58 references that are in the map. First posted on arXiv 3 Oct 2023.
Builds on
16 of 58 references.
References · 16
- 2022Training language models to follow instructions with human feedbackcited by 15,712
- 2021Evaluating Large Language Models Trained on Codecited by 8,053
- 2022Emergent Abilities of Large Language Modelscited by 2,483
- 2023Is Your Code Generated by ChatGPT Really Correct? Rigorous Evaluation of Large Language Models for Code Generationcited by 1,332
- 2022CodeGen: An Open Large Language Model for Code with Multi-Turn Program Synthesiscited by 876
- 2022The Stack: 3 TB of permissively licensed source codecited by 354
- 2022Can language models learn from explanations in context?cited by 248
- 2020Unit Test Case Generation with Transformers and Focal Contextcited by 118
- 2021TOGA: A Neural Method for Test Oracle Generationcited by 57
- 2020Generating Accurate Assert Statements for Unit Test Cases using Pretrained Transformerscited by 30
- 2023Can Large Language Models Write Good Property-Based Tests?cited by 30
- 2019CLN2INV: Learning Loop Invariants with Continuous Logic Networkscited by 20
4 more
- 2022Using Transfer Learning for Code-Related Taskscited by 18
- 2020Learning Nonlinear Loop Invariants with Gated Continuous Logic Networks (Extended Version)cited by 17
- 2023Towards Generating Functionally Correct Code Edits from Natural Language Issue Descriptionscited by 14
- 2021EvoSpex: An Evolutionary Algorithm for Learning Postconditionscited by 6
Built on by
Citing papers per year: 2024: 9; 2025: 21; 2026: 23.
53 papers.
Sort:
By area:
- 2024SpecRover: Code Intent Extraction via LLMscited by 71
- 2024Automated Proof Generation for Rust Code via Self-Evolutioncited by 31
- 2025VERINA: Benchmarking Verifiable Code Generationcited by 30
- 2024Rango: Adaptive Retrieval-Augmented Proving for Automated Software Verificationcited by 25
- 2025Agent READMEs: An Empirical Study of Context Files for Agentic Codingcited by 21
- 2024Evaluating LLM-driven User-Intent Formalization for Verification-Aware Languagescited by 16
- 2024LOGIC-LM++: Multi-Step Refinement for Symbolic Formulationscited by 14
- 2025ClassInvGen: Class Invariant Synthesis using Large Language Modelscited by 11
- 2024Cobblestone: A Divide-and-Conquer Approach for Automating Formal Verificationcited by 8
- 2025Hallucination to Consensus: Multi-Agent LLMs for End-to-End JUnit Test Generationcited by 8
- 2025Towards Formal Verification of LLM-Generated Code from Natural Language Promptscited by 8
- 2026Intent Formalization: A Grand Challenge for Reliable Coding in the Age of AI Agentscited by 8
38 more
- 2025On the Effectiveness of Large Language Models in Writing Alloy Formulascited by 7
- 2025Beyond Postconditions: Can Large Language Models infer Formal Contracts for Automatic Software Verification?cited by 5
- 2025Agentic Verification of Software Systemscited by 5
- 2025Nexus: Execution-Grounded Multi-Agent Test Oracle Synthesiscited by 4
- 2025QuadSentinel: Sequent Safety for Machine-Checkable Control in Multi-agent Systemscited by 4
- 2024QEDCartographer: Automating Formal Verification Using Reward-Free Reinforcement Learningcited by 3
- 2025Can LLMs Enable Verification in Mainstream Programming?cited by 3
- 2025Program Skeletons for Automated Program Translationcited by 3
- 2025Curiosity by Design: An LLM-based Coding Assistant Asking Clarification Questionscited by 3
- 2026Inductive Deductive Synthesis: Enabling AI to Generate Formally Verified Systemscited by 3
- 2024Generative transformations and patterns in LLM-native approaches for software verification and falsificationcited by 2
- 2025Effective LLM Code Refinement via Property-Oriented and Structurally Minimal Feedbackcited by 2
- 2025ReqInOne: A Large Language Model-Based Agent for Software Requirements Specification Generationcited by 2
- 2025Large Language Models for Software Testing: A Research Roadmapcited by 2
- 2026SpecMind: Cognitively Inspired, Interactive Multi-Turn Framework for Postcondition Inferencecited by 2
- 2026Automated Lemma Discovery in Agentic Program Verificationcited by 2
- 2026Spec-Harness: Measuring and Improving Behavioral Adequacy of LLM-Synthesized Formal Specificationscited by 2
- 2026CodeSpecBench: Benchmarking LLMs for Executable Behavioral Specification Generationcited by 2
- 2024Assured Automatic Programming via Large Language Modelscited by 1
- 2025Using (Not-so) Large Language Models to Generate Simulation Models in a Formal DSL: A Study on Reaction Networkscited by 1
- 2025ASP-Assisted Symbolic Regression: Uncovering Hidden Physics in Fluid Mechanicscited by 1
- 2026Intent-aligned Formal Specification Synthesis via Traceable Refinementcited by 1
- 2026Teaching Code LLMs to Reason with Intermediate Formal Specificationscited by 1
- 2025LLMs and Fuzzing in Tandem: A New Approach to Automatically Generating Weakest Preconditionscited by 0
- 2025APRIL: API Synthesis with Automatic Prompt Optimization and Reinforcement Learningcited by 0
- 2025A Neurosymbolic Approach to Loop Invariant Generation via Weakest Precondition Reasoningcited by 0
- 2026From Helpful to Trustworthy: LLM Agents for Pair Programmingcited by 0
- 2026LLM-Guided Safety Agent for Edge Robotics with an ISO-Compliant Perception-Compute-Control Architecturecited by 0
- 2026Natural Language based Specification and Verificationcited by 0
- 2026Agentic Interpretation: Lattice-Structured Evidence for LLM-Based Program Analysiscited by 0
- 2026Agentic Separation Logic Specification Synthesiscited by 0
- 2026WIRE: Profiling Witnessed Within-Policy Instruction Collisions in LLM Agentscited by 0
- 2026Provably Secure Agent Guardrailcited by 0
- 2026Code-Augur: Agentic Vulnerability Detection via Specification Inferencecited by 0
- 2026An Empirical Study of LLM-Generated Specifications for VeriFastcited by 0
- 2026Multi-Large Language Model Orchestrated Severity Assessment of Clinical Records (MOSAIC)cited by 0
- 2026Diversifying to Verify: When Task-Equivalent Programs Differ in Verifiabilitycited by 0
- 2026Grounding AI Agents in Contracts: An Empirical Evaluation of Spec-Driven Test Generationcited by 0
50 most cited of 53 All 53 (JSON)
- 2026From Verification Failures to Reusable Guidance for Coding Agents30 Sep 2026
- 2026SkillSpec: Intent-Masked Specification Reasoning for Agent Skill Correctness5 Sep 2026
- 2026Automated Synthesis of Cloud Emulators24 Aug 2026
- 2026Grounding AI Agents in Contracts: An Empirical Evaluation of Spec-Driven Test Generation17 Aug 2026
- 2026Diversifying to Verify: When Task-Equivalent Programs Differ in Verifiability10 Jul 2026
- 2026Multi-Large Language Model Orchestrated Severity Assessment of Clinical Records (MOSAIC)6 Jul 2026
- 2026Teaching Code LLMs to Reason with Intermediate Formal Specifications5 Jul 2026
- 2026An Empirical Study of LLM-Generated Specifications for VeriFast25 Jun 2026
- 2026Code-Augur: Agentic Vulnerability Detection via Specification Inference17 Jun 2026
- 2026Provably Secure Agent Guardrail28 May 2026
- 2026WIRE: Profiling Witnessed Within-Policy Instruction Collisions in LLM Agents27 May 2026
- 2026Agentic Separation Logic Specification Synthesis26 May 2026
38 more
- 2026Inductive Deductive Synthesis: Enabling AI to Generate Formally Verified Systems22 May 2026
- 2026Agentic Interpretation: Lattice-Structured Evidence for LLM-Based Program Analysis12 May 2026
- 2026Natural Language based Specification and Verification11 May 2026
- 2026LLM-Guided Safety Agent for Edge Robotics with an ISO-Compliant Perception-Compute-Control Architecture22 Apr 2026
- 2026CodeSpecBench: Benchmarking LLMs for Executable Behavioral Specification Generation14 Apr 2026
- 2026Intent-aligned Formal Specification Synthesis via Traceable Refinement12 Apr 2026
- 2026From Helpful to Trustworthy: LLM Agents for Pair Programming11 Apr 2026
- 2026Spec-Harness: Measuring and Improving Behavioral Adequacy of LLM-Synthesized Formal Specifications31 Mar 2026
- 2026Automated Lemma Discovery in Agentic Program Verification23 Mar 2026
- 2026Intent Formalization: A Grand Challenge for Reliable Coding in the Age of AI Agents17 Mar 2026
- 2026SpecMind: Cognitively Inspired, Interactive Multi-Turn Framework for Postcondition Inference24 Feb 2026
- 2025QuadSentinel: Sequent Safety for Machine-Checkable Control in Multi-agent Systems18 Dec 2025
- 2025A Neurosymbolic Approach to Loop Invariant Generation via Weakest Precondition Reasoning17 Dec 2025
- 2025Agentic Verification of Software Systems21 Nov 2025
- 2025Agent READMEs: An Empirical Study of Context Files for Agentic Coding17 Nov 2025
- 2025Nexus: Execution-Grounded Multi-Agent Test Oracle Synthesis30 Oct 2025
- 2025Beyond Postconditions: Can Large Language Models infer Formal Contracts for Automatic Software Verification?14 Oct 2025
- 2025Large Language Models for Software Testing: A Research Roadmap29 Sep 2025
- 2025APRIL: API Synthesis with Automatic Prompt Optimization and Reinforcement Learning29 Aug 2025
- 2025ReqInOne: A Large Language Model-Based Agent for Software Requirements Specification Generation13 Aug 2025
- 2025Curiosity by Design: An LLM-based Coding Assistant Asking Clarification Questions28 Jul 2025
- 2025ASP-Assisted Symbolic Regression: Uncovering Hidden Physics in Fluid Mechanics22 Jul 2025
- 2025Towards Formal Verification of LLM-Generated Code from Natural Language Prompts17 Jul 2025
- 2025LLMs and Fuzzing in Tandem: A New Approach to Automatically Generating Weakest Preconditions3 Jul 2025
- 2025Effective LLM Code Refinement via Property-Oriented and Structurally Minimal Feedback23 Jun 2025
- 2025Hallucination to Consensus: Multi-Agent LLMs for End-to-End JUnit Test Generation3 Jun 2025
- 2025VERINA: Benchmarking Verifiable Code Generation29 May 2025
- 2025Program Skeletons for Automated Program Translation10 Apr 2025
- 2025Can LLMs Enable Verification in Mainstream Programming?18 Mar 2025
- 2025Using (Not-so) Large Language Models to Generate Simulation Models in a Formal DSL: A Study on Reaction Networks3 Mar 2025
- 2025ClassInvGen: Class Invariant Synthesis using Large Language Models26 Feb 2025
- 2025On the Effectiveness of Large Language Models in Writing Alloy Formulas21 Feb 2025
- 2024Rango: Adaptive Retrieval-Augmented Proving for Automated Software Verification18 Dec 2024
- 2024Cobblestone: A Divide-and-Conquer Approach for Automating Formal Verification25 Oct 2024
- 2024Assured Automatic Programming via Large Language Models24 Oct 2024
- 2024Automated Proof Generation for Rust Code via Self-Evolution21 Oct 2024
- 2024QEDCartographer: Automating Formal Verification Using Reward-Free Reinforcement Learning17 Aug 2024
- 2024SpecRover: Code Intent Extraction via LLMs5 Aug 2024
50 newest of 53 All 53 (JSON)
- 2024SpecRover: Code Intent Extraction via LLMscited by 71
- 2025Agent READMEs: An Empirical Study of Context Files for Agentic Codingcited by 21
- 2025Hallucination to Consensus: Multi-Agent LLMs for End-to-End JUnit Test Generationcited by 8
- 2026Intent Formalization: A Grand Challenge for Reliable Coding in the Age of AI Agentscited by 8
- 2025Agentic Verification of Software Systemscited by 5
- 2025Nexus: Execution-Grounded Multi-Agent Test Oracle Synthesiscited by 4
- 2025QuadSentinel: Sequent Safety for Machine-Checkable Control in Multi-agent Systemscited by 4
- 2025ReqInOne: A Large Language Model-Based Agent for Software Requirements Specification Generationcited by 2
- 2026Automated Lemma Discovery in Agentic Program Verificationcited by 2
- 2026From Helpful to Trustworthy: LLM Agents for Pair Programmingcited by 0
- 2026LLM-Guided Safety Agent for Edge Robotics with an ISO-Compliant Perception-Compute-Control Architecturecited by 0
- 2026Agentic Interpretation: Lattice-Structured Evidence for LLM-Based Program Analysiscited by 0
12 most cited of 18 All 18 (JSON)
- 2026From Verification Failures to Reusable Guidance for Coding Agents30 Sep 2026
- 2026Grounding AI Agents in Contracts: An Empirical Evaluation of Spec-Driven Test Generation17 Aug 2026
- 2026Code-Augur: Agentic Vulnerability Detection via Specification Inference17 Jun 2026
- 2026Provably Secure Agent Guardrail28 May 2026
- 2026WIRE: Profiling Witnessed Within-Policy Instruction Collisions in LLM Agents27 May 2026
- 2026Agentic Separation Logic Specification Synthesis26 May 2026
- 2026Agentic Interpretation: Lattice-Structured Evidence for LLM-Based Program Analysis12 May 2026
- 2026LLM-Guided Safety Agent for Edge Robotics with an ISO-Compliant Perception-Compute-Control Architecture22 Apr 2026
- 2026From Helpful to Trustworthy: LLM Agents for Pair Programming11 Apr 2026
- 2026Automated Lemma Discovery in Agentic Program Verification23 Mar 2026
- 2026Intent Formalization: A Grand Challenge for Reliable Coding in the Age of AI Agents17 Mar 2026
- 2025QuadSentinel: Sequent Safety for Machine-Checkable Control in Multi-agent Systems18 Dec 2025
12 newest of 18 All 18 (JSON)
- 2024Automated Proof Generation for Rust Code via Self-Evolutioncited by 31
- 2025VERINA: Benchmarking Verifiable Code Generationcited by 30
- 2024Evaluating LLM-driven User-Intent Formalization for Verification-Aware Languagescited by 16
- 2025ClassInvGen: Class Invariant Synthesis using Large Language Modelscited by 11
- 2024Cobblestone: A Divide-and-Conquer Approach for Automating Formal Verificationcited by 8
- 2025Towards Formal Verification of LLM-Generated Code from Natural Language Promptscited by 8
- 2025On the Effectiveness of Large Language Models in Writing Alloy Formulascited by 7
- 2025Beyond Postconditions: Can Large Language Models infer Formal Contracts for Automatic Software Verification?cited by 5
- 2024QEDCartographer: Automating Formal Verification Using Reward-Free Reinforcement Learningcited by 3
- 2025Can LLMs Enable Verification in Mainstream Programming?cited by 3
- 2025Program Skeletons for Automated Program Translationcited by 3
- 2025Curiosity by Design: An LLM-based Coding Assistant Asking Clarification Questionscited by 3
12 most cited of 31 All 31 (JSON)
- 2026SkillSpec: Intent-Masked Specification Reasoning for Agent Skill Correctness5 Sep 2026
- 2026Automated Synthesis of Cloud Emulators24 Aug 2026
- 2026Diversifying to Verify: When Task-Equivalent Programs Differ in Verifiability10 Jul 2026
- 2026Multi-Large Language Model Orchestrated Severity Assessment of Clinical Records (MOSAIC)6 Jul 2026
- 2026An Empirical Study of LLM-Generated Specifications for VeriFast25 Jun 2026
- 2026Inductive Deductive Synthesis: Enabling AI to Generate Formally Verified Systems22 May 2026
- 2026Natural Language based Specification and Verification11 May 2026
- 2026CodeSpecBench: Benchmarking LLMs for Executable Behavioral Specification Generation14 Apr 2026
- 2026Intent-aligned Formal Specification Synthesis via Traceable Refinement12 Apr 2026
- 2026Spec-Harness: Measuring and Improving Behavioral Adequacy of LLM-Synthesized Formal Specifications31 Mar 2026
- 2026SpecMind: Cognitively Inspired, Interactive Multi-Turn Framework for Postcondition Inference24 Feb 2026
- 2025Beyond Postconditions: Can Large Language Models infer Formal Contracts for Automatic Software Verification?14 Oct 2025
12 newest of 31 All 31 (JSON)