On the Effectiveness of Large Language Models in Writing Alloy Formulas
Not on the map. Why?
Abstract (arXiv)
Declarative specifications have a vital role to play in developing safe and dependable software systems. Writing specifications correctly, however, remains particularly challenging. This paper presents a controlled experiment on using large language models (LLMs) to write declarative formulas in the well-known language Alloy. Our use of LLMs is three-fold. One, we employ LLMs to write complete Alloy formulas from given natural language descriptions (in English). Two, we employ LLMs to create alternative but equivalent formulas in Alloy with respect to given Alloy formulas. Three, we employ LLMs to complete sketches of Alloy formulas and populate the holes in the sketches by synthesizing Alloy expressions and operators so that the completed formulas accurately represent the desired properties (that are given in natural language). We conduct the experimental evaluation using 11 well-studied subject specifications and employ two popular LLMs, namely ChatGPT and DeepSeek. The experimental results show that the LLMs generally perform well in synthesizing complete Alloy formulas from input properties given in natural language or in Alloy, and are able to enumerate multiple unique solutions. Moreover, the LLMs are also successful at completing given sketches of Alloy formulas with respect to natural language descriptions of desired properties (without requiring test cases). We believe LLMs offer a very exciting advance in our ability to write specifications, and can help make specifications take a pivotal role in software development and enhance our ability to build robust software.
Key facts. Cited by 7 papers in the map (data through 7 Oct 2026). Builds on 22 of its 83 references that are in the map. First posted on arXiv 21 Feb 2025.
Builds on
22 of 83 references.
References · 22
- 2023A Survey of Large Language Modelscited by 2,537
- 2024Agentless: Demystifying LLM-based Software Engineering Agentscited by 400
- 2023Using an LLM to Help With Code Understandingcited by 222
- 2023CodePlan: Repository-level Coding using LLMs and Planningcited by 139
- 2023Baldur: Whole-Proof Generation and Repair with Large Language Modelscited by 118
- 2024Code-Aware Prompting: A study of Coverage Guided Test Generation in Regression Setting using LLMcited by 63
- 2021TOGA: A Neural Method for Test Oracle Generationcited by 57
- 2023Can Large Language Models Transform Natural Language Intent into Formal Method Postconditions?cited by 53
- 2023A Quantitative and Qualitative Evaluation of LLM-Based Explainable Fault Localizationcited by 50
- 2023Make LLM a Testing Expert: Bringing Human-like Interaction to Mobile GUI Testing via Functionality-aware Decisionscited by 41
- 2023Ranking LLM-Generated Loop Invariants for Program Verificationcited by 33
- 2024LLMParser: An Exploratory Study on Using Large Language Models for Log Parsingcited by 32
10 more
- 2023LILAC: Log Parsing using LLMs with Adaptive Parsing Cachecited by 30
- 2024Unprecedented Code Change Automation: The Fusion of LLMs and Transformation by Examplecited by 15
- 2024Rocks Coding, Not Development--A Human-Centric, Experimental Evaluation of LLM-Supported SE Taskscited by 13
- 2024Generating executable oracles to check conformance of client code to requirements of JDK Javadocs using LLMscited by 6
- 2023Uncovering the Causes of Emotions in Software Developer Communication Using Zero-shot LLMscited by 5
- 2024An Empirical Evaluation of Pre-trained Large Language Models for Repairing Declarative Formal Specificationscited by 5
- 2015JSKETCH: Sketching for Javacited by 3
- 2014CD2Alloy: Class Diagrams Analysis Using Alloy Revisitedcited by 1
- 2014CDDiff: Semantic Differencing for Class Diagramscited by 1
- 2023Automated Repair of Declarative Software Specifications in the Era of Large Language Modelscited by 1
Built on by
Citing papers per year: 2025: 4; 2026: 3.
7 papers.
- 2025CASCADE: LLM-Powered JavaScript Deobfuscator at Googlecited by 5
- 2025PAT-Agent: Autoformalization for Model Checkingcited by 3
- 2026Event-B Agent: Towards LLM Agent for Formal Model Synthesis and Repaircited by 3
- 2025OBsmith: LLM-Powered JavaScript Obfuscator Testingcited by 2
- 2025APRIL: API Synthesis with Automatic Prompt Optimization and Reinforcement Learningcited by 0
- 2026Sketch-and-Verify: Structured Inference-Time Scaling via Program Sketchingcited by 0
- 2026Semantic Voting: Execution-Grounded Consensus for LLM Code Generationcited by 0
- 2026Event-B Agent: Towards LLM Agent for Formal Model Synthesis and Repair17 May 2026
- 2026Semantic Voting: Execution-Grounded Consensus for LLM Code Generation9 May 2026
- 2026Sketch-and-Verify: Structured Inference-Time Scaling via Program Sketching9 May 2026
- 2025OBsmith: LLM-Powered JavaScript Obfuscator Testing11 Oct 2025
- 2025PAT-Agent: Autoformalization for Model Checking28 Sep 2025
- 2025APRIL: API Synthesis with Automatic Prompt Optimization and Reinforcement Learning29 Aug 2025
- 2025CASCADE: LLM-Powered JavaScript Deobfuscator at Google23 Jul 2025