摘要
Context: SMT-LIB is the most widely adopted standard language for SMT - Satisfiability Module Theories, a fundamental problem in automated reasoning. Translating natural language (NL) into SMT-LIB formulas is a critical step toward making formal verification more accessible and automatable. Recent advances in large language models (LLMs) provide a promising foundation for NL-to-formal translation, yet applying LLMs to SMT-LIB remains challenging due to the intricate logical structures and strict syntactic requirements of SMT-LIB assertions. Objective: This paper aims to leverage large language models to address the NL-to-SMT translation problem by designing an LLM-based two-stage framework that combines prompting with model finetuning. Methods: We propose an LLM-based two-stage framework for NL-to-SMT translation. First, we construct a dataset of over 5000 NL–SMT pairs by applying few-shot prompting with LLMs to SMT assertions extracted from SMT-LIB benchmarks. In the translation stage, to bridge the gap between natural language and SMT-LIB, each NL input is transformed into a structured intermediate representation that reflects its underlying syntactic and logical structure through syntax-aware prompting. Then, a finetuned language model converts this intermediate representation into the corresponding SMT assertion. Results: Experimental results demonstrate that the proposed LLM-based two-stage framework significantly outperforms direct end-to-end LLM prompting, achieving up to 90.56% accuracy through the combination of GPT-4o prompting and a finetuned T5-large model. Conclusions: This work demonstrates that an LLM-based two-stage framework effectively addresses the challenges of translating natural language into SMT-LIB assertions. By combining LLM-driven syntax-aware prompting with LLM finetuning, the proposed approach improves translation accuracy over end-to-end LLM prompting. The results also suggest that this LLM-centered decomposition may benefit other NL-to-formal translation tasks.
| 源语言 | 英语 |
|---|---|
| 期刊论文编号 | 108229 |
| 期刊 | Information and Software Technology |
| 卷 | 198 |
| DOI | |
| 出版状态 | 已出版 - 10月 2026 |
学术指纹
探究 'NL2SMT — A LLM based SMT-LIB generation framework' 的科研主题。它们共同构成独一无二的学术指纹。引用此
- APA
- Author
- BIBTEX
- Harvard
- Standard
- RIS
- Vancouver