Think Outside the Code: Brainstorming Boosts Large Language Models in Code Generation

05/18/2023
by   Xin-Ye Li, et al.
0

Code generation aims to automatically generate source code from high-level task specifications, which can significantly increase productivity of software engineering. Recently, approaches based on large language models (LLMs) have shown remarkable code generation abilities on simple tasks. However, generate code for more complex tasks, such as competition-level problems, remains challenging. In this paper, we introduce Brainstorm framework for code generation. It leverages a brainstorming step that generates and selects diverse thoughts on the problem to facilitate algorithmic reasoning, where the thoughts are possible blueprint of solving the problem. We demonstrate that Brainstorm significantly enhances the ability of LLMs to solve competition-level programming problems, resulting in a more than 50 in the pass@k metrics for ChatGPT on the CodeContests benchmark, achieving state-of-the-art performance. Furthermore, our experiments conducted on LeetCode contests show that our framework boosts the ability of ChatGPT to a level comparable to that of human programmers.

READ FULL TEXT

page 1

page 2

page 3

page 4

research
06/21/2023

Solving and Generating NPR Sunday Puzzles with Large Language Models

We explore the ability of large language models to solve and generate pu...
research
06/26/2023

Exploring the Robustness of Large Language Models for Solving Programming Problems

Using large language models (LLMs) for source code has recently gained a...
research
02/08/2022

Competition-Level Code Generation with AlphaCode

Programming is a powerful and ubiquitous problem-solving tool. Developin...
research
02/10/2023

Large Language Models for Code: Security Hardening and Adversarial Testing

Large language models (LMs) are increasingly pretrained on massive codeb...
research
05/11/2023

Enabling Programming Thinking in Large Language Models Toward Code Generation

Large Language Models (LLMs) (e.g., ChatGPT) have shown impressive perfo...
research
07/07/2023

Exploring and Characterizing Large Language Models For Embedded System Development and Debugging

Large language models (LLMs) have shown remarkable abilities to generate...
research
07/25/2022

A Hazard Analysis Framework for Code Synthesis Large Language Models

Codex, a large language model (LLM) trained on a variety of codebases, e...

Please sign up or login with your details

Forgot password? Click here to reset