mlsanityData to 7 Oct 2026

Can Large Language Models Transform Natural Language Intent into Formal Method Postconditions?

arXiv 2310.01831 ↗First posted 3 Oct 2023cs.SE cs.AI cs.PLcited by 53

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

  1. 2022Training language models to follow instructions with human feedbackcited by 15,712
  2. 2021Evaluating Large Language Models Trained on Codecited by 8,053
  3. 2022Emergent Abilities of Large Language Modelscited by 2,483
  4. 2023Is Your Code Generated by ChatGPT Really Correct? Rigorous Evaluation of Large Language Models for Code Generationcited by 1,332
  5. 2022CodeGen: An Open Large Language Model for Code with Multi-Turn Program Synthesiscited by 876
  6. 2022The Stack: 3 TB of permissively licensed source codecited by 354
  7. 2022Can language models learn from explanations in context?cited by 248
  8. 2020Unit Test Case Generation with Transformers and Focal Contextcited by 118
  9. 2021TOGA: A Neural Method for Test Oracle Generationcited by 57
  10. 2020Generating Accurate Assert Statements for Unit Test Cases using Pretrained Transformerscited by 30
  11. 2023Can Large Language Models Write Good Property-Based Tests?cited by 30
  12. 2019CLN2INV: Learning Loop Invariants with Continuous Logic Networkscited by 20
4 more
  1. 2022Using Transfer Learning for Code-Related Taskscited by 18
  2. 2020Learning Nonlinear Loop Invariants with Gated Continuous Logic Networks (Extended Version)cited by 17
  3. 2023Towards Generating Functionally Correct Code Edits from Natural Language Issue Descriptionscited by 14
  4. 2021EvoSpex: An Evolutionary Algorithm for Learning Postconditionscited by 6

Built on by

Cited by year (2026 to 7 Oct)

Citing papers per year: 2024: 9; 2025: 21; 2026: 23.

53 papers.

Sort:

By area:

  1. 2024SpecRover: Code Intent Extraction via LLMscited by 71
  2. 2024Automated Proof Generation for Rust Code via Self-Evolutioncited by 31
  3. 2025VERINA: Benchmarking Verifiable Code Generationcited by 30
  4. 2024Rango: Adaptive Retrieval-Augmented Proving for Automated Software Verificationcited by 25
  5. 2025Agent READMEs: An Empirical Study of Context Files for Agentic Codingcited by 21
  6. 2024Evaluating LLM-driven User-Intent Formalization for Verification-Aware Languagescited by 16
  7. 2024LOGIC-LM++: Multi-Step Refinement for Symbolic Formulationscited by 14
  8. 2025ClassInvGen: Class Invariant Synthesis using Large Language Modelscited by 11
  9. 2024Cobblestone: A Divide-and-Conquer Approach for Automating Formal Verificationcited by 8
  10. 2025Hallucination to Consensus: Multi-Agent LLMs for End-to-End JUnit Test Generationcited by 8
  11. 2025Towards Formal Verification of LLM-Generated Code from Natural Language Promptscited by 8
  12. 2026Intent Formalization: A Grand Challenge for Reliable Coding in the Age of AI Agentscited by 8
38 more
  1. 2025On the Effectiveness of Large Language Models in Writing Alloy Formulascited by 7
  2. 2025Beyond Postconditions: Can Large Language Models infer Formal Contracts for Automatic Software Verification?cited by 5
  3. 2025Agentic Verification of Software Systemscited by 5
  4. 2025Nexus: Execution-Grounded Multi-Agent Test Oracle Synthesiscited by 4
  5. 2025QuadSentinel: Sequent Safety for Machine-Checkable Control in Multi-agent Systemscited by 4
  6. 2024QEDCartographer: Automating Formal Verification Using Reward-Free Reinforcement Learningcited by 3
  7. 2025Can LLMs Enable Verification in Mainstream Programming?cited by 3
  8. 2025Program Skeletons for Automated Program Translationcited by 3
  9. 2025Curiosity by Design: An LLM-based Coding Assistant Asking Clarification Questionscited by 3
  10. 2026Inductive Deductive Synthesis: Enabling AI to Generate Formally Verified Systemscited by 3
  11. 2024Generative transformations and patterns in LLM-native approaches for software verification and falsificationcited by 2
  12. 2025Effective LLM Code Refinement via Property-Oriented and Structurally Minimal Feedbackcited by 2
  13. 2025ReqInOne: A Large Language Model-Based Agent for Software Requirements Specification Generationcited by 2
  14. 2025Large Language Models for Software Testing: A Research Roadmapcited by 2
  15. 2026SpecMind: Cognitively Inspired, Interactive Multi-Turn Framework for Postcondition Inferencecited by 2
  16. 2026Automated Lemma Discovery in Agentic Program Verificationcited by 2
  17. 2026Spec-Harness: Measuring and Improving Behavioral Adequacy of LLM-Synthesized Formal Specificationscited by 2
  18. 2026CodeSpecBench: Benchmarking LLMs for Executable Behavioral Specification Generationcited by 2
  19. 2024Assured Automatic Programming via Large Language Modelscited by 1
  20. 2025Using (Not-so) Large Language Models to Generate Simulation Models in a Formal DSL: A Study on Reaction Networkscited by 1
  21. 2025ASP-Assisted Symbolic Regression: Uncovering Hidden Physics in Fluid Mechanicscited by 1
  22. 2026Intent-aligned Formal Specification Synthesis via Traceable Refinementcited by 1
  23. 2026Teaching Code LLMs to Reason with Intermediate Formal Specificationscited by 1
  24. 2025LLMs and Fuzzing in Tandem: A New Approach to Automatically Generating Weakest Preconditionscited by 0
  25. 2025APRIL: API Synthesis with Automatic Prompt Optimization and Reinforcement Learningcited by 0
  26. 2025A Neurosymbolic Approach to Loop Invariant Generation via Weakest Precondition Reasoningcited by 0
  27. 2026From Helpful to Trustworthy: LLM Agents for Pair Programmingcited by 0
  28. 2026LLM-Guided Safety Agent for Edge Robotics with an ISO-Compliant Perception-Compute-Control Architecturecited by 0
  29. 2026Natural Language based Specification and Verificationcited by 0
  30. 2026Agentic Interpretation: Lattice-Structured Evidence for LLM-Based Program Analysiscited by 0
  31. 2026Agentic Separation Logic Specification Synthesiscited by 0
  32. 2026WIRE: Profiling Witnessed Within-Policy Instruction Collisions in LLM Agentscited by 0
  33. 2026Provably Secure Agent Guardrailcited by 0
  34. 2026Code-Augur: Agentic Vulnerability Detection via Specification Inferencecited by 0
  35. 2026An Empirical Study of LLM-Generated Specifications for VeriFastcited by 0
  36. 2026Multi-Large Language Model Orchestrated Severity Assessment of Clinical Records (MOSAIC)cited by 0
  37. 2026Diversifying to Verify: When Task-Equivalent Programs Differ in Verifiabilitycited by 0
  38. 2026Grounding AI Agents in Contracts: An Empirical Evaluation of Spec-Driven Test Generationcited by 0

50 most cited of 53 All 53 (JSON)