Benchmarking Language Model Creativity: A Case Study on Code Generation

Yining Lu, Dixuan Wang, Tianjian Li, Dongwei Jiang, Sanjeev Khudanpur +2 more
7/12/2024
cs.CL

No official code found. Best implementation: JHU-CLSP/NeoCoder (14 stars, Apache-2.0, last commit 2025-05-16).

Abstract

As LLMs become increasingly prevalent, it is interesting to consider how ``creative'' these models can be. From cognitive science, creativity consists of at least two key characteristics: \emph{convergent} thinking (purposefulness to achieve a given goal) and \emph{divergent} thinking (adaptability to explore new environments or constraints) \citep{runco2003critical}. In this work, we introduce a framework for quantifying LLM creativity that incorporates the two design ingredients: (1) We introduce DENIAL PROMPTING which pushes LLMs to develop more creative solutions to a given problem by incrementally imposing new constraints on the previous solution, compelling LLMs to adopt new strategies. (2) We define NEOGAUGE, a metric that quantifies both convergent and divergent thinking in the generated creative responses by LLMs. We test the proposed framework on Codeforces problems, which serve as both a natural dataset for coding tasks and a collection of prior human solutions. We quantify NEOGAUGE for various proprietary and open-source models and find that even the most creative model, GPT-4, still falls short of demonstrating human-like creativity. We also experiment with advanced reasoning strategies (MCTS, self-correction, etc.) and observe no significant improvement in creativity. As a by-product of our analysis, we release NEOCODER dataset for reproducing our results on future models.

View on arXivView PDF

Code Implementations(1)

JHU-CLSP/NeoCoderCommunity100%
Apache-2.0

Official implementation of our paper "Benchmarking Language Model Creativity: A Case Study on Code Generation"

144Shell, PythonJun 14, 20241 years agoApache-2.0

Similar Papers

Cite this paper

@article{lu2024benchmarking,
  title  = {Benchmarking Language Model Creativity: A Case Study on Code Generation},
  author = {Yining Lu and Dixuan Wang and Tianjian Li and Dongwei Jiang and Sanjeev Khudanpur and Meng Jiang and Daniel Khashabi},
  year   = {2024},
  eprint = {2407.09007},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2407.09007v2}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2407.09007.svg)](https://codeofpaper.com/paper/2407.09007)

Discussion