Boosting LLM-Based Software Generation by Aligning Code with Requirements

Research output: Chapter in Book/Report/Conference proceedingConference contributionpeer-review

Abstract

Emerging LLM-based code generation tools enable programmers to specify desired functionality and automatically generate code. However, these tools fall short in comparison to human ability when it comes to creating complete system models from requirements. This is because humans typically formulate a software design before implementing a system. In this paper, we propose to use the behavioral programming (BP) model-based paradigm as a general design approach that allows for the direct translation of requirements of any reactive systems into code. We demonstrate that each requirement can be automatically transformed into a dedicated code module without the need for a global view of the system. The key lies in BP's capability to enable modules to implement both scenarios and anti-scenarios separately. This means that each module can independently define behaviors that may happen, must happen, and must not happen. Subsequently, an application-agnostic execution engine interprets and interweaves these modules at runtime to generate cohesive system behavior consistent with system requirements. The fact that each requirement is translated into a small module also facilitates the verification of its implementation, thereby helping to reduce errors in LLM code generation. We present an initial evaluation of our approach and demonstrate how the characteristics of BP aid in generating aligned and correct implementations.

Original languageEnglish
Title of host publicationProceedings - 32nd IEEE International Requirements Engineering Conference Workshops, REW 2024
EditorsGrischa Liebel, Irit Hadar, Paola Spoletini
PublisherInstitute of Electrical and Electronics Engineers
Pages301-305
Number of pages5
ISBN (Electronic)9798350395518
DOIs
StatePublished - 1 Jan 2024
Event32nd IEEE International Requirements Engineering Conference Workshops, REW 2024 - Reykjavik, Iceland
Duration: 24 Jun 202428 Jun 2024

Publication series

NameProceedings - 32nd IEEE International Requirements Engineering Conference Workshops, REW 2024

Conference

Conference32nd IEEE International Requirements Engineering Conference Workshops, REW 2024
Country/TerritoryIceland
CityReykjavik
Period24/06/2428/06/24

Keywords

  • behavioral programming
  • large language models
  • requirement engineering

ASJC Scopus subject areas

  • Artificial Intelligence
  • Software
  • Safety, Risk, Reliability and Quality
  • Modeling and Simulation

Fingerprint

Dive into the research topics of 'Boosting LLM-Based Software Generation by Aligning Code with Requirements'. Together they form a unique fingerprint.

Cite this