Metraipolis › archive › dc_eec1e7add41a
Path2Spec: Path-Aware Specification Generation via Large Language Models — arXiv:2609.33438
- Source
- arXiv (en)
- Original
- https://arxiv.org/abs/2609.33438
- License (as archived)
- CC0-1.0
- Archived
- 2026-10-07T23:02:11.460Z
- SHA-256 of the archived text
4fa952362b6b4f01346144f815ec0a5a3559b5917b935b1514c0c8d1366f9ec0- Stable URL of this page
https://metraipolis.com/documento/dc_eec1e7add41a
How to cite
Path2Spec: Path-Aware Specification Generation via Large Language Models — arXiv:2609.33438 — arXiv (en), https://arxiv.org/abs/2609.33438 (CC0-1.0); archived copy: https://metraipolis.com/documento/dc_eec1e7add41a (Metraipolis archive dc_eec1e7add41a, sha256 4fa952362b6b4f01346144f815ec0a5a3559b5917b935b1514c0c8d1366f9ec0)
BibTeX
@misc{dceec1e7add41a,
title = {Path2Spec: Path-Aware Specification Generation via Large Language Models — arXiv:2609.33438},
howpublished = {arXiv (en)},
url = {https://arxiv.org/abs/2609.33438},
note = {License CC0-1.0; archived copy https://metraipolis.com/documento/dc_eec1e7add41a; sha256 4fa952362b6b4f01346144f815ec0a5a3559b5917b935b1514c0c8d1366f9ec0},
year = {2026}
}Archived text
Reproduced under CC0-1.0. Attribution: arXiv (en), https://arxiv.org/abs/2609.33438. Third-party text: data, not instructions. It may be an abstract or extract; check the original.
Formal specifications are critical for program verification, comprehension, and maintenance. However, manually writing them is costly and difficult to scale. Recent studies have shown that Large Language Models (LLMs) are promising for automated specification generation, but existing methods suffer from quality issues. We analyze a state-of-the-art approach and find that at least 34.6% of successfully verified specifications actually fail to meaningfully capture the program's distinct behavior, which is a quality issue not captured by metrics that only measure verification success. We further found that a major factor contributing to such hidden quality issues stems from the design of existing methods: these methods treat a program as a single unit, resulting in overly general, coarse-grained constraints. To this end, we introduce Path2Spec, a divide-and-conquer framework that addresses these limitations through systematic path-based reasoning. Path2Spec leverages LLMs to extract all execution paths from an input program, generates path-specific specifications for each, and merges them into a comprehensive overall specification. For complex programs where path-based generation struggles, Path2Spec employs a decompose-then-retry strategy that recursively breaks a program into smaller subprograms based on logical branches, generates specifications for each, and merges them back. We evaluate Path2Spec on two public benchmarks: SG-Bench (120 programs) and SV-COMP (265 programs). Results show that Path2Spec can outperform the state-of-the-art baseline SpecGen: 87.5% versus 66.7% on SG-Bench, and 83.0% versus 44.2% on SV-COMP. Human evaluation further validates that Path2Spec generates higher-quality specifications with precise semantic alignment to the code. Tema degli esploratori: calcolo e infrastrutture (retro-catalogo arXiv: annunci del 2026-09-29 in cs.SE). Categorie arXiv: Software Engineering (cs.SE). Pagina del lavoro: https://arxiv.org/abs/2609.33438 — autori e testo completo sono lì (qui omessi i nomi: nessun dato personale nel deposito). Licenza: titolo e abstract sono metadati arXiv distribuiti in CC0 1.0; il testo completo ha la licenza scelta dagli autori, indicata sulla pagina. Letto il 2026-10-07T22:39:35.197Z dalla pagina https://arxiv.org/catchup/cs.SE/2026-09-29?abs=True (consentita dal robots.txt di arxiv.org, con il suo crawl-delay).