Think Outside the Code: Brainstorming Boosts Large Language Models in Code Generation
On the map: LLM reasoning → Reasoning for agents, planning and code
Abstract (arXiv)
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% increase 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.
Key facts. Cited by 19 papers in the map (data through 7 Oct 2026). Placed in Reasoning for agents, planning and code, one of 17 directions in LLM reasoning. Builds on 6 of its 47 references that are in the map. First posted on arXiv 18 May 2023.
Builds on
6 of 47 references.
References · 6
- 2023GPT-4 Technical Reportcited by 18,132
- 2021Evaluating Large Language Models Trained on Codecited by 8,053
- 2021Program Synthesis with Large Language Modelscited by 3,509
- 2023Sparks of Artificial General Intelligence: Early experiments with GPT-4cited by 2,579
- 2022GPT-NeoX-20B: An Open-Source Autoregressive Language Modelcited by 711
- 2022Parsel: Algorithmic Reasoning with Language Models by Composing Decompositionscited by 62
Built on by
Citing papers per year: 2023: 4; 2024: 11; 2025: 4.
19 papers.
Sort:
By area:
- 2023Large Language Models for Software Engineering: A Systematic Literature Reviewcited by 389
- 2024Agents in Software Engineering: Survey, Landscape, and Visioncited by 60
- 2023LLM-Assisted Code Cleaning For Training Accurate Code Generatorscited by 27
- 2024Evaluating LLMs' Divergent Thinking Capabilities for Scientific Idea Generation with Minimal Contextcited by 25
- 2025Learning to Reason via Mixture-of-Thought for Logical Reasoningcited by 20
- 2024SwarmBrain: Embodied agent for real-time strategy game StarCraft II via large language modelscited by 18
- 2024Enhancing Code Generation Performance of Smaller Models by Distilling the Reasoning Ability of LLMscited by 17
- 2024Leveraging Print Debugging to Improve Code Generation in Large Language Modelscited by 15
- 2024Beyond Functional Correctness: Investigating Coding Style Inconsistencies in Large Language Modelscited by 15
- 2023Think Before You Speak: Cultivating Communication Skills of Large Language Models via Inner Monologuecited by 11
- 2024SRA-MCTS: Self-driven Reasoning Augmentation with Monte Carlo Tree Search for Code Generationcited by 9
- 2024ArchCode: Incorporating Software Requirements in Code Generation with Large Language Modelscited by 8
7 more
- 2024A Survey on Large Language Models from Concept to Implementationcited by 4
- 2025RefleXGen:The unexamined code is not worth usingcited by 4
- 2025Yggdrasil: Bridging Dynamic Speculation and Static Runtime for Latency-Optimal Tree-Based LLM Decodingcited by 4
- 2024Comments as Natural Logic Pivots: Improve Code Generation via Comment Perspectivecited by 3
- 2025Weaker LLMs' Opinions Also Matter: Mixture of Opinions Enhances LLM's Mathematical Reasoningcited by 2
- 2023PatternGPT :A Pattern-Driven Framework for Large Language Model Text Generationcited by 1
- 2024Evaluating ChatGPT-3.5 Efficiency in Solving Coding Problems of Different Complexity Levels: An Empirical Analysiscited by 1
- 2025Yggdrasil: Bridging Dynamic Speculation and Static Runtime for Latency-Optimal Tree-Based LLM Decoding29 Dec 2025
- 2025RefleXGen:The unexamined code is not worth using27 Oct 2025
- 2025Learning to Reason via Mixture-of-Thought for Logical Reasoning21 May 2025
- 2025Weaker LLMs' Opinions Also Matter: Mixture of Opinions Enhances LLM's Mathematical Reasoning26 Feb 2025
- 2024Evaluating LLMs' Divergent Thinking Capabilities for Scientific Idea Generation with Minimal Context23 Dec 2024
- 2024SRA-MCTS: Self-driven Reasoning Augmentation with Monte Carlo Tree Search for Code Generation17 Nov 2024
- 2024Evaluating ChatGPT-3.5 Efficiency in Solving Coding Problems of Different Complexity Levels: An Empirical Analysis12 Nov 2024
- 2024Agents in Software Engineering: Survey, Landscape, and Vision13 Sep 2024
- 2024ArchCode: Incorporating Software Requirements in Code Generation with Large Language Models2 Aug 2024
- 2024Beyond Functional Correctness: Investigating Coding Style Inconsistencies in Large Language Models29 Jun 2024
- 2024Comments as Natural Logic Pivots: Improve Code Generation via Comment Perspective11 Apr 2024
- 2024A Survey on Large Language Models from Concept to Implementation27 Mar 2024
7 more
- 2024Enhancing Code Generation Performance of Smaller Models by Distilling the Reasoning Ability of LLMs20 Mar 2024
- 2024SwarmBrain: Embodied agent for real-time strategy game StarCraft II via large language models31 Jan 2024
- 2024Leveraging Print Debugging to Improve Code Generation in Large Language Models10 Jan 2024
- 2023LLM-Assisted Code Cleaning For Training Accurate Code Generators25 Nov 2023
- 2023Think Before You Speak: Cultivating Communication Skills of Large Language Models via Inner Monologue13 Nov 2023
- 2023Large Language Models for Software Engineering: A Systematic Literature Review21 Aug 2023
- 2023PatternGPT :A Pattern-Driven Framework for Large Language Model Text Generation2 Jul 2023
- 2024Evaluating LLMs' Divergent Thinking Capabilities for Scientific Idea Generation with Minimal Contextcited by 25
- 2025Learning to Reason via Mixture-of-Thought for Logical Reasoningcited by 20
- 2024Enhancing Code Generation Performance of Smaller Models by Distilling the Reasoning Ability of LLMscited by 17
- 2023Think Before You Speak: Cultivating Communication Skills of Large Language Models via Inner Monologuecited by 11
- 2024SRA-MCTS: Self-driven Reasoning Augmentation with Monte Carlo Tree Search for Code Generationcited by 9
- 2024Comments as Natural Logic Pivots: Improve Code Generation via Comment Perspectivecited by 3
- 2025Weaker LLMs' Opinions Also Matter: Mixture of Opinions Enhances LLM's Mathematical Reasoningcited by 2
- 2025Learning to Reason via Mixture-of-Thought for Logical Reasoning21 May 2025
- 2025Weaker LLMs' Opinions Also Matter: Mixture of Opinions Enhances LLM's Mathematical Reasoning26 Feb 2025
- 2024Evaluating LLMs' Divergent Thinking Capabilities for Scientific Idea Generation with Minimal Context23 Dec 2024
- 2024SRA-MCTS: Self-driven Reasoning Augmentation with Monte Carlo Tree Search for Code Generation17 Nov 2024
- 2024Comments as Natural Logic Pivots: Improve Code Generation via Comment Perspective11 Apr 2024
- 2024Enhancing Code Generation Performance of Smaller Models by Distilling the Reasoning Ability of LLMs20 Mar 2024
- 2023Think Before You Speak: Cultivating Communication Skills of Large Language Models via Inner Monologue13 Nov 2023
- 2023Large Language Models for Software Engineering: A Systematic Literature Reviewcited by 389
- 2023LLM-Assisted Code Cleaning For Training Accurate Code Generatorscited by 27
- 2024Leveraging Print Debugging to Improve Code Generation in Large Language Modelscited by 15
- 2024Beyond Functional Correctness: Investigating Coding Style Inconsistencies in Large Language Modelscited by 15
- 2024ArchCode: Incorporating Software Requirements in Code Generation with Large Language Modelscited by 8
- 2024A Survey on Large Language Models from Concept to Implementationcited by 4
- 2025RefleXGen:The unexamined code is not worth usingcited by 4
- 2023PatternGPT :A Pattern-Driven Framework for Large Language Model Text Generationcited by 1
- 2024Evaluating ChatGPT-3.5 Efficiency in Solving Coding Problems of Different Complexity Levels: An Empirical Analysiscited by 1
- 2025RefleXGen:The unexamined code is not worth using27 Oct 2025
- 2024Evaluating ChatGPT-3.5 Efficiency in Solving Coding Problems of Different Complexity Levels: An Empirical Analysis12 Nov 2024
- 2024ArchCode: Incorporating Software Requirements in Code Generation with Large Language Models2 Aug 2024
- 2024Beyond Functional Correctness: Investigating Coding Style Inconsistencies in Large Language Models29 Jun 2024
- 2024A Survey on Large Language Models from Concept to Implementation27 Mar 2024
- 2024Leveraging Print Debugging to Improve Code Generation in Large Language Models10 Jan 2024
- 2023LLM-Assisted Code Cleaning For Training Accurate Code Generators25 Nov 2023
- 2023Large Language Models for Software Engineering: A Systematic Literature Review21 Aug 2023
- 2023PatternGPT :A Pattern-Driven Framework for Large Language Model Text Generation2 Jul 2023
Similar, not cited
Close in wording, no citation either way
- 2025Evaluating and Improving Large Language Models for Competitive Program Generation
- 2025An Empirical Study of Reasoning Steps in Thinking Code LLMs
- 2023Self-planning Code Generation with Large Language Models
- 2026Think Anywhere in Code Generation
- 2024MapCoder: Multi-Agent Code Generation for Competitive Problem Solving
- 2023On the Effectiveness of Large Language Models in Domain-Specific Code Generation
- 2022Competition-Level Code Generation with AlphaCode
- 2024Assessing Code Generation with Intermediate Languages