LLM4VV: Developing LLM-Driven Testsuite for Compiler Validation

📄 arXiv: 2310.04963v3 📥 PDF

作者: Christian Munley, Aaron Jarmusch, Sunita Chandrasekaran

分类: cs.AI

发布日期: 2023-10-08 (更新: 2024-03-10)


💡 一句话要点

提出LLM驱动的测试套件以验证编译器实现

🎯 匹配领域: 支柱九:具身大模型 (Embodied Foundation Models)

关键词: 大型语言模型 编译器验证 自动化测试 OpenACC 提示工程 微调技术 代码生成

📋 核心要点

  1. 现有编译器验证方法缺乏高效的自动化测试生成手段,导致验证过程繁琐且耗时。
  2. 本研究通过利用最新的LLMs,自动生成测试用例以验证OpenACC编译器的实现,提升了验证效率。
  3. 实验结果显示,Deepseek-Coder-33b-Instruct生成的通过测试数量最多,其次是GPT-4-Turbo,验证了LLMs在此领域的有效性。

📝 摘要(中文)

大型语言模型(LLMs)是一种强大的工具,能够在自然语言处理和代码生成等多种应用中展现出色的能力。本研究旨在自动生成测试用例,以验证和验证基于指令的并行编程范式OpenACC的编译器实现。我们探索了多种最新的LLMs,包括开源和闭源模型,并对其进行了微调,使用了我们自己的测试套件数据集和OpenACC规范。通过多种提示工程技术,我们生成了超过5000个测试,并分析了LLMs生成测试的结果。我们的贡献包括探索LLMs在代码生成中的能力、研究微调和提示方法,以及对生成测试结果的分析。

🔬 方法详解

问题定义:本论文旨在解决编译器实现验证中的自动化测试生成问题。现有方法往往依赖手动测试,效率低下且容易出错。

核心思路:通过利用最新的LLMs,自动生成针对OpenACC编译器的测试用例,结合微调和提示工程技术,以提高测试的覆盖率和有效性。

技术框架:整体流程包括选择和微调LLMs,设计多种提示工程策略,生成测试用例,并对生成的测试进行分析和验证。主要模块包括LLM选择、数据集构建、提示设计和结果分析。

关键创新:本研究的创新点在于系统性地评估多种LLMs在代码生成中的能力,并通过微调和提示工程技术优化生成效果,显著提升了测试生成的质量和数量。

关键设计:在微调过程中,使用了自定义的测试套件数据集,并结合OpenACC规范进行训练。提示设计方面,采用了多种策略,如代码模板、检索增强生成(RAG)等,以提高生成的多样性和准确性。

🖼️ 关键图片

fig_0
fig_1
fig_2

📊 实验亮点

实验结果表明,Deepseek-Coder-33b-Instruct生成的通过测试数量最多,达到了显著的性能提升,其次是GPT-4-Turbo。这些结果验证了LLMs在自动化测试生成中的有效性,尤其是在编译器验证领域。

🎯 应用场景

该研究的潜在应用领域包括编译器开发、软件验证和自动化测试生成等。通过提高编译器验证的效率和准确性,能够加速软件开发周期,降低开发成本,提升软件质量,具有重要的实际价值和广泛的应用前景。

📄 摘要(原文)

Large language models (LLMs) are a new and powerful tool for a wide span of applications involving natural language and demonstrate impressive code generation abilities. The goal of this work is to automatically generate tests and use these tests to validate and verify compiler implementations of a directive-based parallel programming paradigm, OpenACC. To do so, in this paper, we explore the capabilities of state-of-the-art LLMs, including open-source LLMs -- Meta Codellama, Phind fine-tuned version of Codellama, Deepseek Deepseek Coder and closed-source LLMs -- OpenAI GPT-3.5-Turbo and GPT-4-Turbo. We further fine-tuned the open-source LLMs and GPT-3.5-Turbo using our own testsuite dataset along with using the OpenACC specification. We also explored these LLMs using various prompt engineering techniques that include code template, template with retrieval-augmented generation (RAG), one-shot example, one-shot with RAG, expressive prompt with code template and RAG. This paper highlights our findings from over 5000 tests generated via all the above mentioned methods. Our contributions include: (a) exploring the capabilities of the latest and relevant LLMs for code generation, (b) investigating fine-tuning and prompt methods, and (c) analyzing the outcome of LLMs generated tests including manually analysis of representative set of tests. We found the LLM Deepseek-Coder-33b-Instruct produced the most passing tests followed by GPT-4-Turbo.