KerSpecGen: Co-piloting formal Kernel specification synthesis with refined knowledge graphs and large language models
PLOS One · 2025
DOI: 10.1371/journal.pone.0338821 ↗Kurz gefasst
Fachartikel in der Zeitschrift PLOS One, 2025. Verfasst von Zi Wang und 4 weiteren Autor:innen. Beteiligte Einrichtung: School of Cyber Science and Technology, Beihang University, Beijing, China. Hauptthemen laut MEDLINE: Software, Language. Die Arbeit nennt 47 Literaturangaben. Der Volltext ist frei zugänglich (Open Access, CC BY 4.0).
Abstract (Originalsprache)
Formal verification ensures software correctness but faces challenges in kernel specification writing, which is labor-intensive, expertise-dependent, and limited to specific targets. For complex microkernels like seL4, these issues significantly reduce the practicality of formal methods. To address this, we propose KerSpecGen, a Large Language Model (LLM) based framework for synthesizing formal kernel specifications, which leverages knowledge graphs to bridge requirement descriptions and specification properties. KerSpecGen’s core design includes three key components: 1) constructing a refined knowledge graph to represent progressive specification relationships (with deduplication, property judgment, and source annotation to improve accuracy); 2) building a custom dataset to fine-tune a model that converts specification properties into code; 3) designing LLM-oriented synthesis templates to transform generated code into complete candidate specification programs. Evaluation on our KerSpecProperty benchmark (30 seL4 function modules, 624 properties) shows KerSpecGen outperforms the Few-shot method by an average of 7.06 percentage points in BLEU-4. Specifically, for the Llama-3.1-405B model, KerSpecGen achieves better specification quality than the Few-shot method in 23 out of 30 functional modules. To our knowledge, this is the first work to generate formal specifications for complex microkernels. KerSpecGen yields high-quality reference specifications. While requiring minor adjustments for direct execution, it substantially reduces the burden of writing specifications from scratch.
Schlagwörter
MeSH-Schlagwörter (MEDLINE)
Autor:innen und Institutionen
- School of Cyber Science and Technology, Beihang University, Beijing, China.
- School of Software, Beihang University, Beijing, China.
- School of Computer Science and Engineering, Beihang University, Beijing, China.
ORCID-Profile: Zi Wang, Hongqiang Wang
Zitieren
APA
Wang, Z., Zhu, X., Wang, H., Yu, Y., & Lan, Y. (2025). KerSpecGen: Co-piloting formal Kernel specification synthesis with refined knowledge graphs and large language models. PLOS One. https://doi.org/10.1371/journal.pone.0338821
Vancouver
Wang Z, Zhu X, Wang H, Yu Y, Lan Y. KerSpecGen: Co-piloting formal Kernel specification synthesis with refined knowledge graphs and large language models. PLOS One. 2025. doi:10.1371/journal.pone.0338821
BibTeX
@article{Wang2025,
author = {Wang, Zi and Zhu, Xiaoyu and Wang, Hongqiang and Yu, Yichun and Lan, Yuqing},
title = {KerSpecGen: Co-piloting formal Kernel specification synthesis with refined knowledge graphs and large language models},
journal = {PLOS One},
year = {2025},
doi = {10.1371/journal.pone.0338821}
}
EUVIMED