mlsanityData to 7 Oct 2026

Can LLMs Write Correct TLA+ Specifications? Evaluating Natural-Language-to-TLA+ Generation

arXiv 2606.05792 ↗First posted 4 Jun 2026cs.AI cs.LG cs.LOcited by 1

Not on the map. Why?

Abstract (arXiv)

TLA+ has supported industrial verification at companies such as Amazon and Microsoft, yet writing correct TLA+ specifications from natural language still requires time and expertise, which limits adoption. LLMs show promise, but no prior study measures whether they produce semantically correct TLA+ specifications from natural language. This paper presents the first systematic evaluation of LLM-based TLA+ specification synthesis from natural language. Our study evaluates 30 LLMs across eight families on a curated dataset of 205 TLA+ specifications: 25 open-weight models across four prompting strategies (2,600 runs) and 5 proprietary models under few-shot prompting (130 runs), all validated by the SANY parser and TLC model checker. LLMs achieve up to 26.6% syntactic correctness but only 8.6% semantic correctness, with successes exclusive to progressive prompting. Results show that model size does not predict quality, e.g., DeepSeek r1:8b outperforms its 70B variant across all strategies, which suggests the importance of reasoning alignment for formal languages. Code-specialized models consistently underperform due to negative transfer from mainstream language training. We identify five recurring hallucination categories, all traceable to specific training data biases. These results suggest that current LLMs do not generate reliable TLA+ specifications without expert oversight. We release the evaluation framework, code, and dataset to support reproducibility and future research.

Key facts. Cited by 1 paper in the map (data through 7 Oct 2026). Builds on 16 of its 29 references that are in the map. First posted on arXiv 4 Jun 2026.

Builds on

16 of 29 references.

References · 16

  1. 2024The Llama 3 Herd of Modelscited by 14,192
  2. 2022Chain-of-Thought Prompting Elicits Reasoning in Large Language Modelscited by 12,302
  3. 2025Qwen3 Technical Reportcited by 8,195
  4. 2025DeepSeek-R1: Incentivizing Reasoning Capability in LLMs via Reinforcement Learningcited by 6,146
  5. 2021Program Synthesis with Large Language Modelscited by 3,509
  6. 2025OpenAI GPT-5 System Cardcited by 910
  7. 2024Gemma: Open Models Based on Gemini Research and Technologycited by 889
  8. 2024GSM-Symbolic: Understanding the Limitations of Mathematical Reasoning in Large Language Modelscited by 533
  9. 2025Phi-4-Mini Technical Report: Compact yet Powerful Multimodal Language Models via Mixture-of-LoRAscited by 491
  10. 2023Cognitive Mirage: A Review of Hallucinations in Large Language Modelscited by 83
  11. 2024We Have a Package for You! A Comprehensive Analysis of Package Hallucinations by Code Generating LLMscited by 61
  12. 2024SpecGen: Automated Generation of Formal Program Specifications via Large Language Modelscited by 51
4 more
  1. 2022Formal Specifications from Natural Languagecited by 33
  2. 2025Leveraging LLMs for Formal Software Requirements -- Challenges and Prospectscited by 5
  3. 2024Validating Traces of Distributed Programs Against TLA+ Specificationscited by 4
  4. 2025SysMoBench: Evaluating AI on Formally Modeling Complex Real-World Systemscited by 2

Built on by

Cited by year (2026 to 7 Oct)

Citing papers per year: 2026: 1.

1 paper.

Similar, not cited

Close in wording, no citation either way

  1. 2024How Reliable are LLMs as Knowledge Bases? Re-thinking Facutality and Consistency
  2. 2025LMR-BENCH: Evaluating LLM Agent's Ability on Reproducing Language Modeling Research
  3. 2026Automatic Translation of Unstructured Requirements into Linear Temporal Logic through Large Language Models ↗
  4. 2026LLM4RTL: Tool-Assisted LLM for RTL Generation
  5. 2023L2CEval: Evaluating Language-to-Code Generation Capabilities of Large Language Models
  6. 2025Can LLMs Reason About Program Semantics? A Comprehensive Evaluation of LLMs on Formal Specification Inference
  7. 2026TLA-Prover: Verifiable TLA+ Specification Synthesis via Preference-Optimized Low-Rank Adaptation
  8. 2024Strategies for Improving NL-to-FOL Translation with LLMs: Data Generation, Incremental Fine-Tuning, and Verification