TY - GEN
T1 - Boosting LLM-Based Software Generation by Aligning Code with Requirements
AU - Yaacov, Tom
AU - Elyasaf, Achiya
AU - Weiss, Gera
N1 - Publisher Copyright:
© 2024 IEEE.
PY - 2024/1/1
Y1 - 2024/1/1
N2 - 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.
AB - 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.
KW - behavioral programming
KW - large language models
KW - requirement engineering
UR - http://www.scopus.com/inward/record.url?scp=85203104501&partnerID=8YFLogxK
U2 - 10.1109/REW61692.2024.00045
DO - 10.1109/REW61692.2024.00045
M3 - Conference contribution
AN - SCOPUS:85203104501
T3 - Proceedings - 32nd IEEE International Requirements Engineering Conference Workshops, REW 2024
SP - 301
EP - 305
BT - Proceedings - 32nd IEEE International Requirements Engineering Conference Workshops, REW 2024
A2 - Liebel, Grischa
A2 - Hadar, Irit
A2 - Spoletini, Paola
PB - Institute of Electrical and Electronics Engineers
T2 - 32nd IEEE International Requirements Engineering Conference Workshops, REW 2024
Y2 - 24 June 2024 through 28 June 2024
ER -