arXiv:2504.20964cs.CLcs.AI2025-04AAAI被引 13

评测大模型生成操作系统内核形式化规范的能力,发现现有模型表现有限。

OSVBench: Benchmarking LLMs on Specification Generation Tasks for Operating System Verification

  • 将规范生成任务建模为领域限定的程序合成问题,要求理解编程范式与验证假设。
  • 基于真实内核Hyperkernel构建245个长上下文任务(20k-30k tokens),需完整描述正确状态与转移。
  • 揭示大模型在长上下文代码生成中的能力差异,适合系统验证与LLM评估研究者参考。

我们提出OSVBench,一个用于评估大语言模型(LLMs)在生成操作系统内核功能正确性验证所需完整形式化规范任务上的新基准。该基准基于真实操作系统内核Hyperkernel,包含总计245个复杂规范生成任务,每个任务为约20k-30k token的长上下文任务。规范生成任务被建模为受限于特定领域的程序合成问题,通过编程模型提供给LLMs。LLMs需理解该编程模型与验证假设,才能正确界定语法与语义的搜索空间并生成形式化规范。在高阶功能描述指导下,要求模型生成覆盖潜在有缺陷代码实现的所有正确状态与转移的规范。12个先进LLMs的实验结果表明,现有模型在操作系统验证的规范生成任务上表现有限,性能差异显著,反映出其处理长上下文代码生成任务的能力差异。代码已公开于https://github.com/lishangyu-hkust/OSVBench。

原文摘要 · Abstract (English)

We introduce OSVBench, a new benchmark for evaluating Large Language Models (LLMs) on the task of generating complete formal specifications for verifying the functional correctness of operating system kernels. This benchmark is built upon a real-world operating system kernel, Hyperkernel, and consists of 245 complex specification generation tasks in total, each of which is a long-context task of about 20k-30k tokens. The benchmark formulates the specification generation task as a program synthesis problem confined to a domain for specifying states and transitions. This formulation is provided to LLMs through a programming model. The LLMs must be able to understand the programming model and verification assumptions before delineating the correct search space for syntax and semantics and generating formal specifications. Guided by the operating system's high-level functional description, the LLMs are asked to generate a specification that fully describes all correct states and transitions for a potentially buggy code implementation of the operating system. Experimental results with 12 state-of-the-art LLMs indicate limited performance of existing LLMs on the specification generation task for operating system verification. Significant disparities in their performance highlight differences in their ability to handle long-context code generation tasks. The code are available at https://github.com/lishangyu-hkust/OSVBench

大模型评估形式化验证操作系统程序合成

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。