BODHI: Precise OS Kernel Specification Inference
Not on the map. Why?
Abstract (arXiv)
The formal verification of operating system kernels requires precise specifications that capture the intended behavior of system calls. Writing these specifications manually demands deep domain expertise, motivating the use of large language models (LLMs) to automate the process. However, in OSV-Bench, a benchmark of 245 specification generation tasks derived from the Hyperkernel OS kernel, the best reported Pass@1 is 55.10%. We propose a domain knowledge prompting method (BODHI), which augments the standard few-shot prompt with a structured C-to-Python translation guide covering 15 categories of domain-specific translation patterns. Inspired by Structured Chain-of-Thought (SCoT) prompting, the guide organizes translation by separation of concerns, addressing pre-condition extraction and post-condition generation as distinct categories. Evaluated on nine models from six providers (Anthropic, Mistral, Amazon, DeepSeek, Meta, Alibaba), covering dense, mixture-of-experts and reasoning architectures, BODHI improves every model tested, with gains ranging from +11% to +32%. The best configuration (Claude Opus 4.6 + BODHI) reaches 96.73% Pass@1. BODHI reduces both syntax and semantic errors, with the strongest effect on models that have sufficient instruction-following capability to utilize structured reference material. These results demonstrate that domain knowledge injection is a model-agnostic technique that substantially bridges the gap between general-purpose code generation and formal specification synthesis.
Key facts. No citing papers in the map yet (data through 7 Oct 2026). Builds on 16 of its 23 references that are in the map. First posted on arXiv 22 Apr 2026.
Builds on
16 of 23 references.
References · 16
- 2022Chain-of-Thought Prompting Elicits Reasoning in Large Language Modelscited by 12,302
- 2020Retrieval-Augmented Generation for Knowledge-Intensive NLP Taskscited by 9,160
- 2021Program Synthesis with Large Language Modelscited by 3,509
- 2023Lost in the Middle: How Language Models Use Long Contextscited by 3,383
- 2024A Survey on Large Language Models for Code Generationcited by 646
- 2023Structured Chain-of-Thought Prompting for Code Generationcited by 136
- 2023Baldur: Whole-Proof Generation and Repair with Large Language Modelscited by 118
- 2024IRIS: LLM-Assisted Static Analysis for Detecting Security Vulnerabilitiescited by 100
- 2023Scallop: A Language for Neurosymbolic Programmingcited by 63
- 2024SpecGen: Automated Generation of Formal Program Specifications via Large Language Modelscited by 51
- 2025When LLMs Meet API Documentation: Can Retrieval Augmentation Aid Code Generation Just as It Helps Developers?cited by 12
- 2025OSVBench: Benchmarking LLMs on Specification Generation Tasks for Operating System Verificationcited by 8
4 more
Built on by
Not cited yet.
Similar, not cited
Close in wording, no citation either way
- 2025AssertCoder: LLM-Based Assertion Generation via Multimodal Specification Extraction
- 2026SyzHarness: Patch-Based Kernel Bug Reproduction with LLM-Synthesized Fuzzing Harnesses
- 2026FVRuleLearner: Operator-Level Reasoning Tree (Op-Tree)-Based Rules Learning for Formal Verification
- 2026Kernel Contracts: A Specification Language for ML Kernel Correctness Across Heterogeneous Silicon
- 2024Learning to Estimate System Specifications in Linear Temporal Logic using Transformers and Mamba
- 2026Don't Regenerate, Debug: A Domain-Specific Agent for Repairing Near-Miss Hardware Operators
- 2026Fine-Tuning Qwen3-27B for C-to-Rust Code Translation: A Three-Stage Curriculum of Pretraining, Debugging-Aware SFT, and Task-Specific SFT
- 2025SysVCoder: An LLM-Driven Framework for Systematic Generation of System-Level Design