Self-planning Code Generation with Large Language Model

Auteurs : Xue Jiang, Yihong Dong, Lecheng Wang, Qiwei Shang, Ge Li

Soumis à arXiv le 12 Mar. 2023
Licence : CC BY 4.0
Résumé scientifique

Although large language models have demonstrated impressive ability in code generation, they are still struggling to address the complicated intent provided by humans. It is widely acknowledged that humans typically employ planning to decompose complex problems and schedule the solution steps prior to implementation. Thus we introduce planning into code generation to help the model understand complex intent and reduce the difficulty of problem solving. This paper proposes a self-planning code generation method with large language model, which consists of two phases, namely planning phase and implementation phase. Specifically, in the planning phase, the language model plans out the solution steps from the intent combined with in-context learning. Then it enters the implementation phase, where the model generates code step by step, guided by the solution steps. The effectiveness of self-planning code generation has been rigorously evaluated on multiple code generation datasets and the results have demonstrated a marked superiority over naive direct generation approaches with language model. The improvement in performance is substantial, highlighting the significance of self-planning in code generation tasks.

Les articles autour de lui, par date et par proximité

Plus haut, c’est plus proche de cet article ; à gauche, c’est plus ancien. Les traits relient les articles proches entre eux : les groupes de traits sont des sous-thèmes. Sélectionnez un point pour voir pourquoi il est là. Retour au résumé de cet article

Comment lire cette carte ? Guide illustré

Les articles les plus proches Les travaux antérieurs sur lesquels il s’appuie Les articles qui le citent

Les articles autour de celui-ci

Classés selon la proximité de leur titre et de leur résumé avec ceux de cet article. Sélectionnez-en pour les lire ensemble.

Les articles les plus proches

  1. Très proche Autre approche du problème Cité par cet article
    Planning with Large Language Models for Code Generation
    Shun Zhang, Zhenfang Chen, Yikang Shen et al. · 2023 · Machine Learning · cité 277 fois · Résumé IA disponible

    Planning-Guided Transformer Decoding emploie une recherche anticipée pour guider le décodage, tandis que l’article planifie les étapes avant de générer le code.

    Résumé scientifique

    Existing large language model-based code generation pipelines typically use beam search or sampling algorithms during the decoding process. Although the programs they generate achieve high token-matching-based scores, they often fail to compile or generate incorrect outputs. The main reason is that conventional Transformer decoding algorithms may not be the best choice for code generation. In this work, we propose a novel Transformer decoding algorithm, Planning-Guided Transformer Decoding (PG-TD), that uses a planning algorithm to do lookahead search and guide the Transformer to generate better programs. Specifically, instead of simply optimizing the likelihood of the generated sequences, t…

  2. Très proche Autre approche du problème Cite cet article
    A Self-Iteration Code Generation Method Based on Large Language Models
    Tianyou Chang, Shi-Zhan Chen, Guo-Dong Fan et al. · 2023 · International Conference on Parallel and Distributed Systems · cité 5 fois · Pas encore résumé

    A Self-Iteration Code Generation Method améliore le code par cycles de rôles spécialisés, alors que l’article guide une génération étape par étape avec un plan préalable.

    Résumé scientifique

    Although large language models (LLMs) have demonstrated impressive performance in code generation, they still face challenges when dealing with complex code generation tasks. In the software development process, humans often refine complex tasks iteratively and continuously modify and improve them. Inspired by this, we propose a self-iteration code generation framework based on large language models like ChatGPT. To realize this idea, we incorporated software development methodologies into the self-iteration framework. We introduced four roles into each cycle, including analyst, designer, developer, and tester. Each role performs different tasks during the self-iteration cycle, with analyst …

  3. Très proche Prolonge cet article Cite cet article Utilise cet article en profondeur
    Planning-Driven Programming: A Large Language Model Programming Workflow
    Chao Lei, Yan-Chuan Chang, N. Lipovetzky et al. · 2024 · Annual Meeting of the Association for Computational Linguistics · cité 14 fois · Pas encore résumé

    Planning-Driven Programming reprend un workflow en deux phases avec planification, puis ajoute des tests visibles pour vérifier le plan et affiner le code.

    Résumé scientifique

    The strong performance of large language models (LLMs) raises extensive discussion on their application to code generation. Recent research suggests continuous program refinements through visible tests to improve code generation accuracy in LLMs. However, these methods suffer from LLMs' inefficiency and limited reasoning capacity. In this work, we propose an LLM programming workflow (LPW) designed to improve both initial code generation and subsequent refinements within a structured two-phase workflow. Specifically, the solution generation phase formulates a solution plan, which is then verified through visible tests to specify the intended natural language solution. Subsequently, the code i…

  4. Très proche Contexte plus large Cite cet article
    Code Auto-generation System based on Large Language Models
    Dan Liu, Junxiang He, Yun Shen et al. · 2025 · IEEE international Symposium on Broadband Multimedia Systems and Broadcasting · cité 1 fois · Pas encore résumé

    Code Auto-generation System décrit un système qui transforme des besoins utilisateurs en code, notamment pour des scénarios de développement spécialisés.

    Résumé scientifique

    This paper introduces a large-scale model-based code automatic generation system and its construction method. It aims to use deep learning and natural language processing techniques, based on pre trained large language models, to automatically understand user input and needs, and generate executable program code. In addition to supporting automatic generation of general code, this patent is more suitable for professional system development scenarios, especially those with specific requirements for generating code. For example, in the front-end development process, users need to use previously created custom controls, custom styles, or layouts in the automatically generated code; Or when acce…

  5. Très proche Contexte plus large Cite cet article
    Aligning User Requirement with Large Language Model in Code Generation
    J. Li, Rui-Qi Bai, Yang Luo et al. · 2026 · Proceedings of the 41st IEEE/ACM International Conference on Automated Software Engineering · Pas encore résumé

    REA-Coder vise l’alignement entre exigences utilisateur et compréhension du modèle, tandis que l’article traite la complexité par la planification des étapes de résolution.

    Résumé scientifique

    Code generation refers to automatically producing executable programs from user requirements. Recently, researchers have explored approaches to enhance the correctness of generated code with advanced large language models. Although achieving improvements, existing approaches focus on designing reasoning strategies or post-refinement methods to enhance code generation performance. Despite their differences, all these methods share a common assumption: the LLM can correctly understand the given requirement. However, this assumption does not always hold. To fill this gap, we propose REA-Coder, a requirement alignment approach to enhance the code generation performance of LLMs. REA-Coder involve…

  6. Très proche Article de revue Cite cet article
    Code generation with large language models: a survey from neural program synthesis to autonomous software development
    Burak Gülmez · 2026 · Applied intelligence (Boston) · cité 10 fois · Pas encore résumé

    Le survey retrace les méthodes de génération de code, des approches classiques aux grands modèles, et examine leurs tâches et évaluations.

    Résumé scientifique

    Large language models have reshaped code generation, driving a transition from rule-based and statistical methods to transformer-based architectures pretrained on vast code corpora. This survey traces the intellectual lineage from classical program synthesis through pre-transformer neural approaches to contemporary large-scale models, examining code generation capabilities across model architectures, training strategies, task taxonomies, evaluation methodologies, security implications, and ethical considerations. Contemporary models show proficiency in function-level synthesis, program repair, and documentation generation, though performance varies across programming languages and task compl…

  7. Très proche* Contexte plus large
    Enabling Programming Thinking in Large Language Models Toward Code Generation
    J. Li, Ge Li, Yong-Ming Li et al. · 2023 · arXiv.org · preprint, non relu par les pairs · cité 44 fois · Pas encore résumé

    Enabling Programming Thinking traite de la pensée de programmation des grands modèles pour la génération de code; aucun résumé ne précise sa méthode.

  8. Très proche Autre approche du problème
    Think Outside the Code: Brainstorming Boosts Large Language Models in Code Generation
    Xinyu Li, Jiang-Tian Xue, Zheng Xie et al. · 2023 · arXiv.org · preprint, non relu par les pairs · cité 43 fois · Pas encore résumé

    Brainstorm génère et sélectionne des pistes de solution pour les problèmes complexes, tandis que l’article utilise un plan d’étapes pour guider la génération.

    Résumé scientifique

    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 signific…

Les travaux antérieurs sur lesquels il s’appuie

  1. Proche Autre approche du problème
    Teaching Large Language Models to Self-Debug
    Xinyun Chen, Maxwell Lin, Nathanael Schärli et al. · 2023 · Computation and Language · cité 1 513 fois · Résumé IA disponible

    Self-Debugging apprend au modèle à expliquer et corriger son programme généré, tandis que l’article prépare la génération par une planification préalable.

    Résumé scientifique

    Large language models (LLMs) have achieved impressive performance on code generation. However, for complex programming tasks, generating the correct solution in one go becomes challenging, thus some prior works have designed program repair approaches to improve code generation performance. In this work, we propose Self-Debugging, which teaches a large language model to debug its predicted program via few-shot demonstrations. In particular, we demonstrate that Self-Debugging can teach the large language model to perform rubber duck debugging; i.e., without any feedback on the code correctness or error messages, the model is able to identify its mistakes by explaining the generated code in nat…

  2. Proche Base de cet article Utilisé en profondeur par cet article
    Program Synthesis with Large Language Models
    Jacob Austin, Augustus Odena, Maxwell Nye et al. · 2021 · Programming Languages · preprint, non relu par les pairs · cité 5 041 fois · Résumé IA disponible

    Program Synthesis with Large Language Models évalue la synthèse de courts programmes Python à partir de descriptions naturelles sur MBPP et MathQA-Python.

    Résumé scientifique

    This paper explores the limits of the current generation of large language models for program synthesis in general purpose programming languages. We evaluate a collection of such models (with between 244M and 137B parameters) on two new benchmarks, MBPP and MathQA-Python, in both the few-shot and fine-tuning regimes. Our benchmarks are designed to measure the ability of these models to synthesize short Python programs from natural language descriptions. The Mostly Basic Programming Problems (MBPP) dataset contains 974 programming tasks, designed to be solvable by entry-level programmers. The MathQA-Python dataset, a Python version of the MathQA benchmark, contains 23914 problems that evaluat…

  3. Apparenté Autre approche du problème Utilisé en profondeur par cet article
    Synchromesh: Reliable code generation from pre-trained language models
    Gabriel Poesia, Oleksandr Polozov, Vu Le et al. · 2022 · International Conference on Learning Representations · cité 239 fois · Pas encore résumé

    Synchromesh améliore la fiabilité par sélection d’exemples et contraintes linguistiques, plutôt que par planification préalable des étapes de résolution.

    Résumé scientifique

    Large pre-trained language models have been used to generate code,providing a flexible interface for synthesizing programs from natural language specifications. However, they often violate syntactic and semantic rules of their output language, limiting their practical usability. In this paper, we propose Synchromesh: a framework for substantially improving the reliability of pre-trained models for code generation. Synchromesh comprises two components. First, it retrieves few-shot examples from a training bank using Target Similarity Tuning (TST), a novel method for semantic example selection. TST learns to recognize utterances that describe similar target programs despite differences in surf…

  4. Proche Autre approche du problème
    Structured Chain-of-Thought Prompting for Code Generation
    J. Li, Ge Li, Yong-Ming Li et al. · 2023 · ACM Transactions on Software Engineering and Methodology · cité 424 fois · Pas encore résumé

    Structured CoTs organise le raisonnement intermédiaire selon les principes de programmation structurée, tandis que l’article guide le code par un plan de solution.

    Résumé scientifique

    Large Language Models (LLMs) have shown impressive abilities in code generation. Chain-of-Thought (CoT) prompting is the state-of-the-art approach to utilizing LLMs. CoT prompting asks LLMs first to generate CoTs (i.e., intermediate natural language reasoning steps) and then output the code. However, the accuracy of CoT prompting still cannot satisfy practical applications. For example, gpt-3.5-turbo with CoT prompting only achieves 53.29% Pass@1 in HumanEval. In this article, we propose Structured CoTs (SCoTs) and present a novel prompting technique for code generation named SCoT prompting. Our motivation is that human developers follow structured programming. Developers use three programmi…

  5. Proche Contexte plus large
    Self-Instruct: Aligning Language Models with Self-Generated Instructions
    Yizhong Wang, Yeganeh Kordi, Swaroop Mishra et al. · 2022 · Annual Meeting of the Association for Computational Linguistics · cité 3 884 fois · Résumé IA disponible

    Self-Instruct utilise les générations du modèle pour créer des données d’instructions et améliorer le suivi des consignes, plutôt que la génération de code planifiée.

    Résumé scientifique

    Large “instruction-tuned” language models (i.e., finetuned to respond to instructions) have demonstrated a remarkable ability to generalize zero-shot to new tasks. Nevertheless, they depend heavily on human-written instruction data that is often limited in quantity, diversity, and creativity, therefore hindering the generality of the tuned model. We introduce Self-Instruct, a framework for improving the instruction-following capabilities of pretrained language models by bootstrapping off their own generations. Our pipeline generates instructions, input, and output samples from a language model, then filters invalid or similar ones before using them to finetune the original model. Applying ou…

Les articles qui le citent

  1. Proche Autre approche du problème Utilise cet article en profondeur
    Knowledge-Aware Code Generation with Large Language Models
    Tao Huang, Zhihong Sun, Zhi Jin et al. · 2024 · IEEE International Conference on Program Comprehension · cité 26 fois · Pas encore résumé

    Knowledge-Aware Code Generation cible les problèmes nouveaux et complexes en mobilisant des connaissances algorithmiques, tandis que l’article décompose la résolution en étapes.

    Résumé scientifique

    Large Language Models (LLMs) perform well on basic programming problems. However, they encounter challenges when dealing with complex tasks involving the use of diverse algorithmic and data structure skills, particularly programming competition-level problems. Notably, ChatGPT exhibits proficient performance on problems it has encountered during its pre-training phase, but this performance deteriorates when faced with novel problems. Consequently, enhancing the ability of LLMs to address unfamiliar problems has emerged as a pivotal research focus. The problem-solving process of LLMs mirrors human programmers’ approach to a certain extent. When confronted with new programming tasks, human pro…

  2. Proche Autre approche du problème Utilise cet article en profondeur
    Reliable Code Generation with Test Case Prioritization and Cognitive Validation
    Lingyun Huang, Xin Yin, Xin-Rui Li et al. · 2025 · Asia-Pacific Software Engineering Conference · Pas encore résumé

    PriGen sélectionne des cas de test prioritaires pour guider la génération et valider la compréhension, tandis que l’article s’appuie sur un plan explicite.

    Résumé scientifique

    Large Language Models (LLMs) have shown impressive capabilities in code generation. However, they often struggle in complex programming scenarios due to incomplete semantic understanding and limited ability to correct misunderstandinginduced errors. While recent efforts have incorporated test cases to guide task comprehension, they typically overlook the quality and relevance of the test cases, reducing their effectiveness in steering accurate code generation. To overcome these limitations, we present PriGen, a multiagent collaborative framework for prioritized and test case driven code generation. PriGen introduces a novel test case prioritization mechanism that selects a high-value subset …

  3. Proche Données, outil ou méthode en commun Utilise cet article en profondeur
    A Comparative Empirical Study of Prompting Strategies for Code Generation with Large Language Models
    Fanyi Zhao, Mingzhuo Yu, Chuan Luo · 2025 · Journal of Advanced Computing Systems · cité 1 fois · Pas encore résumé

    A Comparative Empirical Study évalue plusieurs stratégies de prompting sur quatre benchmarks de code, fournissant un cadre de comparaison des méthodes de génération.

    Résumé scientifique

    Large language models have demonstrated strong capabilities in automated code generation, yet the influence of prompting strategies on generation quality remains insufficiently characterized under controlled experimental conditions. This study presents a systematic comparative evaluation of five prompting strategies — direct instruction, few-shot, zero-shot chain-of-thought, few-shot chain-of-thought, and self-consistency — across seven code-oriented large language models spanning both open-source and proprietary families. Experiments are conducted on four established benchmarks: HumanEval, MBPP, HumanEval+, and MBPP+. Results measured by pass@1 indicate that self-consistency with ten sampli…

  4. Proche Autre approche du problème Utilise cet article en profondeur
    CodeCoR: An LLM-Based Self-Reflective Multi-Agent Framework for Code Generation
    Ru-Wei Pan, Hong-Yu Zhang, Chao Liu · 2025 · arXiv.org · preprint, non relu par les pairs · cité 46 fois · Pas encore résumé

    CodeCoR répartit analyse, génération et test entre agents avec réflexion sur les étapes intermédiaires, plutôt que de s’appuyer sur un plan préalable unique.

    Résumé scientifique

    Code generation aims to produce code that fulfills requirements written in natural language automatically. Large Language Models (LLMs) like ChatGPT have demonstrated promising effectiveness in this area. Nonetheless, the LLMs often fail to ensure the syntactic and semantic correctness of the generated code. Recently, researchers proposed multi-agent frameworks that guide LLMs with different prompts to analyze programming tasks, generate code, and perform testing in a sequential workflow. However, the performance of the workflow is not robust as code generation depends on the performance of each agent. To address this challenge, we propose CodeCoR, a multi-agent framework that prunes interme…

  5. Proche Autre approche du problème Utilise cet article en profondeur
    RGD: Multi-LLM Based Agent Debugger via Refinement and Generation Guidance
    Haolin Jin, Ze-Chao Sun, Hua-Ming Chen · 2024 · International Conference on Agents · cité 22 fois · Pas encore résumé

    RGD combine plusieurs modèles pour guider le raffinement et la génération de code, tandis que l’article décompose la tâche en planification puis implémentation.

    Résumé scientifique

    Large Language Models (LLMs) have shown incredible potential in code generation tasks, and recent research in prompt engineering have enhanced LLMs’ understanding of textual information. However, ensuring the accuracy of generated code often requires extensive testing and validation by programmers. While LLMs can typically generate code based on task descriptions, their accuracy remains limited, especially for complex tasks that require a deeper understanding of both the problem statement and the code generation process. This limitation is primarily due to the LLMs’ need to simultaneously comprehend text and generate syntactically and semantically correct code, without having the capability …

Comment ces articles sont-ils trouvés ?

Nous comparons le titre et le résumé de cet article avec ceux de tous les articles résumés sur ce site, et avec les articles que Semantic Scholar recommande, ceux qu’il cite et ceux qui le citent (pour un article très cité, ses citations les plus récentes et, depuis OpenAlex, les plus citées). Parmi les travaux antérieurs et les suites, les articles qui s’utilisent en profondeur, une méthode qu’il utilise et les suites très citées remontent un peu. Les niveaux (très proche, proche, apparenté) viennent de la similarité des textes, pas d’un jugement de qualité ; * signale un article sans résumé, comparé par son titre. La phrase sous un article est écrite par une IA à partir des deux résumés : vérifiez-la dans les articles. Un article jugé hors sujet par trois lecteurs quitte la liste.

Mis à jour le 6 novembre 2026.

Le guide illustré des articles autour d’un article