ArchCode: Incorporating Software Requirements in Code Generation with Large Language Models

Fuente: arXiv
Gespeichert in:
Bibliographische Detailangaben
Hauptverfasser: Han, Hojae, Kim, Jaejin, Yoo, Jaeseok, Lee, Youngwon, Hwang, Seung-won
Format: Preprint
Veröffentlicht: 2024
Schlagworte:
Online-Zugang:
Tags: Tag hinzufügen
Keine Tags, Fügen Sie den ersten Tag hinzu!
_version_ 1866929446609485824
author Han, Hojae
Kim, Jaejin
Yoo, Jaeseok
Lee, Youngwon
Hwang, Seung-won
author_facet Han, Hojae
Kim, Jaejin
Yoo, Jaeseok
Lee, Youngwon
Hwang, Seung-won
contents This paper aims to extend the code generation capability of large language models (LLMs) to automatically manage comprehensive software requirements from given textual descriptions. Such requirements include both functional (i.e. achieving expected behavior for inputs) and non-functional (e.g., time/space performance, robustness, maintainability) requirements. However, textual descriptions can either express requirements verbosely or may even omit some of them. We introduce ARCHCODE, a novel framework that leverages in-context learning to organize requirements observed in descriptions and to extrapolate unexpressed requirements from them. ARCHCODE generates requirements from given descriptions, conditioning them to produce code snippets and test cases. Each test case is tailored to one of the requirements, allowing for the ranking of code snippets based on the compliance of their execution results with the requirements. Public benchmarks show that ARCHCODE enhances to satisfy functional requirements, significantly improving Pass@k scores. Furthermore, we introduce HumanEval-NFR, the first evaluation of LLMs' non-functional requirements in code generation, demonstrating ARCHCODE's superiority over baseline methods. The implementation of ARCHCODE and the HumanEval-NFR benchmark are both publicly accessible.
format Preprint
id arxiv_https___arxiv_org_abs_2408_00994
institution arXiv
publishDate 2024
record_format arxiv
spellingShingle ArchCode: Incorporating Software Requirements in Code Generation with Large Language Models
Han, Hojae
Kim, Jaejin
Yoo, Jaeseok
Lee, Youngwon
Hwang, Seung-won
Software Engineering
Artificial Intelligence
Computation and Language
This paper aims to extend the code generation capability of large language models (LLMs) to automatically manage comprehensive software requirements from given textual descriptions. Such requirements include both functional (i.e. achieving expected behavior for inputs) and non-functional (e.g., time/space performance, robustness, maintainability) requirements. However, textual descriptions can either express requirements verbosely or may even omit some of them. We introduce ARCHCODE, a novel framework that leverages in-context learning to organize requirements observed in descriptions and to extrapolate unexpressed requirements from them. ARCHCODE generates requirements from given descriptions, conditioning them to produce code snippets and test cases. Each test case is tailored to one of the requirements, allowing for the ranking of code snippets based on the compliance of their execution results with the requirements. Public benchmarks show that ARCHCODE enhances to satisfy functional requirements, significantly improving Pass@k scores. Furthermore, we introduce HumanEval-NFR, the first evaluation of LLMs' non-functional requirements in code generation, demonstrating ARCHCODE's superiority over baseline methods. The implementation of ARCHCODE and the HumanEval-NFR benchmark are both publicly accessible.
title ArchCode: Incorporating Software Requirements in Code Generation with Large Language Models
topic Software Engineering
Artificial Intelligence
Computation and Language
url https://arxiv.org/abs/2408.00994