Creative and Correct: Requesting Diverse Code Solutions from AI Foundation Models

Scott Blyth, Christoph Treude, Markus Wagner

Research output: Chapter in Book/Report/Conference proceedingConference PaperResearch

1 Citation (Scopus)

Abstract

AI foundation models have the capability to produce a wide array of responses to a single prompt, a feature that is highly beneficial in software engineering to generate diverse code solutions. However, this advantage introduces a significant trade-off between diversity and correctness. In software engineering tasks, diversity is key to exploring design spaces and fostering creativity, but the practical value of these solutions is heavily dependent on their correctness. Our study systematically investigates this trade-off using experiments with HumanEval tasks, exploring various parameter settings and prompting strategies. We assess the diversity of code solutions using similarity metrics from the code clone community. The study identifies combinations of parameters and strategies that strike an optimal balance between diversity and correctness, situated on the Pareto front of this trade-off space. These findings offer valuable insights for software engineers on how to effectively use AI foundation models to generate code solutions that are diverse and accurate.

Original languageEnglish
Title of host publicationProceedings - 2024 IEEE/ACM 1st International Conference on AI Foundation Models and Software Engineering, FORGE 2024
EditorsMassimiliano Di Penta, Xing Hu
Place of PublicationNew York NY USA
PublisherAssociation for Computing Machinery (ACM)
Pages119-123
Number of pages5
ISBN (Electronic)9798400706097
DOIs
Publication statusPublished - 2024
Event IEEE/ACM International Conference on AI Foundation Models and Software Engineering 2024: co-located with the 46th ACM/IEEE International Conference on Software Engineering, ICSE 2024 - Lisbon, Portugal
Duration: 14 Apr 202414 Apr 2024
Conference number: 1st
https://dl.acm.org/doi/proceedings/10.1145/3650105 (Proceedings)
https://conf.researchr.org/home/forge-2024 (Website)

Conference

Conference IEEE/ACM International Conference on AI Foundation Models and Software Engineering 2024
Abbreviated titleFORGE 2024
Country/TerritoryPortugal
CityLisbon
Period14/04/2414/04/24
Internet address

Keywords

  • correctness
  • creativity
  • foundation models

Cite this