CodeTree: Agent-guided Tree Search for Code Generation with Large Language Models
On the map: LLM reasoning → Reasoning for agents, planning and code
also in 1 more
Abstract (arXiv)
Pre-trained on massive amounts of code and text data, large language models (LLMs) have demonstrated remarkable achievements in performing code generation tasks. With additional execution-based feedback, these models can act as agents with capabilities to self-refine and improve generated code autonomously. However, on challenging coding tasks with extremely large search space, current agentic approaches still struggle with multi-stage planning, generating, and debugging. To address this problem, we propose CodeTree, a framework for LLM agents to efficiently explore the search space in different stages of the code generation process. Specifically, we adopted a unified tree structure to explicitly explore different coding strategies, generate corresponding coding solutions, and subsequently refine the solutions. In each stage, critical decision-making (ranking, termination, expanding) of the exploration process is guided by both the environmental execution-based feedback and LLM-agent-generated feedback. We comprehensively evaluated CodeTree on 7 code generation benchmarks and demonstrated the significant performance gains of CodeTree against strong baselines. Using GPT-4o as the base model, we consistently achieved top results of 95.1 on HumanEval, 98.7 on MBPP, and 43.0 on CodeContests. On the challenging SWEBench benchmark, our approach led to significant performance gains.
Key facts. Cited by 34 papers in the map (data through 14 Oct 2026). Placed in Reasoning for agents, planning and code, one of 17 directions in LLM reasoning. Builds on 33 of its 42 references that are in the map. First posted on arXiv 7 Nov 2024.
Builds on
33 of 42 references.
Closest ancestors · 4
Same direction, newest first
- 2024MapCoder: Multi-Agent Code Generation for Competitive Problem Solving18 May
- 2023Teaching Large Language Models to Self-Debug11 Apr
- 2023LEVER: Learning to Verify Language-to-Code Generation with Execution16 Feb
- 2022Competition-Level Code Generation with AlphaCode8 Feb
Other references · 29
- 2023GPT-4 Technical Reportcited by 18,396
- 2022Training language models to follow instructions with human feedbackcited by 15,971
- 2023LLaMA: Open and Efficient Foundation Language Modelscited by 14,132
- 2021Evaluating Large Language Models Trained on Codecited by 8,320
- 2022Self-Consistency Improves Chain of Thought Reasoning in Language Modelscited by 5,708
- 2022PaLM: Scaling Language Modeling with Pathwayscited by 5,326
- 2023Reflexion: Language Agents with Verbal Reinforcement Learningcited by 4,276
- 2021Program Synthesis with Large Language Modelscited by 3,637
- 2023Self-Refine: Iterative Refinement with Self-Feedbackcited by 3,442
- 2023SWE-bench: Can Language Models Resolve Real-World GitHub Issues?cited by 3,373
- 2023Code Llama: Open Foundation Models for Codecited by 2,139
- 2023MetaGPT: Meta Programming for A Multi-Agent Collaborative Frameworkcited by 1,808
17 more
- 2023CAMEL: Communicative Agents for "Mind" Exploration of Large Language Model Societycited by 1,395
- 2023Is Your Code Generated by ChatGPT Really Correct? Rigorous Evaluation of Large Language Models for Code Generationcited by 1,391
- 2023ChatDev: Communicative Agents for Software Developmentcited by 919
- 2021Measuring Coding Challenge Competence With APPScited by 902
- 2023StarCoder: may the source be with you!cited by 799
- 2023Textbooks Are All You Needcited by 569
- 2022CodeT: Code Generation with Generated Testscited by 384
- 2023CodeT5+: Open Code Large Language Models for Code Understanding and Generationcited by 333
- 2022Generating Sequences by Learning to Self-Correctcited by 277
- 2023Self-collaboration Code Generation via ChatGPTcited by 258
- 2024Tree Search for Language Model Agentscited by 151
- 2022Natural Language to Code Translation with Executioncited by 124
- 2023Self-Edit: Fault-Aware Code Editor for Code Generationcited by 111
- 2022Coder Reviewer Reranking for Code Generationcited by 84
- 2023Improving Code Generation by Training with Natural Language Feedbackcited by 76
- 2023CodeChain: Towards Modular Code Generation Through Chain of Self-revisions with Representative Sub-modulescited by 58
- 2024Divide-and-Conquer Meets Consensus: Unleashing the Power of Functions in Code Generationcited by 19
Built on by
Citing papers per year: 2025: 17; 2026: 17.
34 papers.
Sort:
By area:
- 2025Towards Reasoning Era: A Survey of Long Chain-of-Thought for Reasoning Large Language Modelscited by 384
- 2025From System 1 to System 2: A Survey of Reasoning Large Language Modelscited by 320
- 2025Wider or Deeper? Scaling LLM Inference-Time Compute with Adaptive Branching Tree Searchcited by 51
- 2026A Survey of Agentic Reasoning for Large Language Models: Towards Recursively Self-Improving and Collective Agentscited by 50
- 2025CodeCoR: An LLM-Based Self-Reflective Multi-Agent Framework for Code Generationcited by 34
- 2025Large Language Model-based Data Science Agent: A Surveycited by 23
- 2025Self-Abstraction from Grounded Experience for Plan-Guided Policy Refinementcited by 9
- 2025Position: Foundation Models for Tabular Data within Systemic Contexts Need Groundingcited by 6
- 2025An LLM-based multi-agent framework for agile effort estimationcited by 6
- 2025VisCoder2: Building Multi-Language Visualization Coding Agentscited by 6
- 2026Orchestrating Intelligence: Confidence-Aware Routing for Efficient Multi-Agent Collaboration across Multi-Scale Modelscited by 6
- 2025Code Reasoning for Software Engineering Tasks: A Survey and A Call to Actioncited by 4
22 more
- 2025LUT-LLM: Efficient Large Language Model Inference with Memory-based Computations on FPGAscited by 4
- 2026Learning Agent Routing From Early Experiencecited by 3
- 2025MasHost Builds It All: Autonomous Multi-Agent System Directed by Reinforcement Learningcited by 2
- 2025AlgoSimBench: Identifying Algorithmically Similar Problems for Competitive Programmingcited by 2
- 2025Adaptive Test-Time Reasoning via Reward-Guided Dual-Phase Searchcited by 2
- 2026MagicAgent: Towards Generalized Agent Planningcited by 2
- 2026WebGen-R1: Incentivizing Large Language Models to Generate Functional and Aesthetic Websites with Reinforcement Learningcited by 2
- 2026Governed Evolution of Agent Runtimes through Executable Operational Cognitioncited by 2
- 2025AnesSuite: A Comprehensive Benchmark and Dataset Suite for Anesthesiology Reasoning in LLMscited by 1
- 2026From LLMs to Agents in Programming: The Impact of Providing an LLM with a Compilercited by 1
- 2026Quality-Driven Agentic Reasoning for LLM-Assisted Software Design: Questions-of-Thoughts (QoT) as a Time-Series Self-QA Chaincited by 1
- 2026ARIADNE: Agentic Reward-Informed Adaptive Decision Exploration via Blackboard-Driven MCTS for Competitive Program Generationcited by 1
- 2026TraceDev: A Traceability-Driven Multi-agent Framework for Requirement-to-Code Developmentcited by 1
- 2025MutaGReP: Execution-Free Repository-Grounded Plan Search for Code-Usecited by 0
- 2025Knowledge-Guided Multi-Agent Framework for Application-Level Software Code Generationcited by 0
- 2026LogitsCoder: Towards Efficient Chain-of-Thought Path Search via Logits Preference Decoding for Code Generationcited by 0
- 2026VQ-Jarvis: Retrieval-Augmented Video Restoration Agent with Sharp Vision and Fast Thoughtcited by 0
- 2026Budget-Efficient Automatic Algorithm Design via Code Graphcited by 0
- 2026MineValiCoder: Reliable Code Generation with Test Case Quality Mining and Bipartite Graph-Based Mutual Validationcited by 0
- 2026ExeCRE: Execution-Consistency Guided Reliability Estimation for Self-Correcting Code Generationcited by 0
- 2026Make Every Expansion Count: Learning to Search Efficiently in LLM Code Repaircited by 0
- 2026Write Once, Plan Many: Building Reusable Visual Planning Systems from One Scenecited by 0
- 2026Write Once, Plan Many: Building Reusable Visual Planning Systems from One Scene13 Oct 2026
- 2026Make Every Expansion Count: Learning to Search Efficiently in LLM Code Repair11 Oct 2026
- 2026ExeCRE: Execution-Consistency Guided Reliability Estimation for Self-Correcting Code Generation5 Aug 2026
- 2026MineValiCoder: Reliable Code Generation with Test Case Quality Mining and Bipartite Graph-Based Mutual Validation24 Jul 2026
- 2026TraceDev: A Traceability-Driven Multi-agent Framework for Requirement-to-Code Development21 Jul 2026
- 2026Governed Evolution of Agent Runtimes through Executable Operational Cognition26 May 2026
- 2026Budget-Efficient Automatic Algorithm Design via Code Graph11 May 2026
- 2026Learning Agent Routing From Early Experience8 May 2026
- 2026ARIADNE: Agentic Reward-Informed Adaptive Decision Exploration via Blackboard-Driven MCTS for Competitive Program Generation4 May 2026
- 2026WebGen-R1: Incentivizing Large Language Models to Generate Functional and Aesthetic Websites with Reinforcement Learning22 Apr 2026
- 2026VQ-Jarvis: Retrieval-Augmented Video Restoration Agent with Sharp Vision and Fast Thought24 Mar 2026
- 2026Quality-Driven Agentic Reasoning for LLM-Assisted Software Design: Questions-of-Thoughts (QoT) as a Time-Series Self-QA Chain10 Mar 2026
22 more
- 2026MagicAgent: Towards Generalized Agent Planning22 Feb 2026
- 2026LogitsCoder: Towards Efficient Chain-of-Thought Path Search via Logits Preference Decoding for Code Generation15 Feb 2026
- 2026A Survey of Agentic Reasoning for Large Language Models: Towards Recursively Self-Improving and Collective Agents18 Jan 2026
- 2026From LLMs to Agents in Programming: The Impact of Providing an LLM with a Compiler17 Jan 2026
- 2026Orchestrating Intelligence: Confidence-Aware Routing for Efficient Multi-Agent Collaboration across Multi-Scale Models8 Jan 2026
- 2025LUT-LLM: Efficient Large Language Model Inference with Memory-based Computations on FPGAs9 Nov 2025
- 2025Self-Abstraction from Grounded Experience for Plan-Guided Policy Refinement8 Nov 2025
- 2025VisCoder2: Building Multi-Language Visualization Coding Agents24 Oct 2025
- 2025Knowledge-Guided Multi-Agent Framework for Application-Level Software Code Generation22 Oct 2025
- 2025Adaptive Test-Time Reasoning via Reward-Guided Dual-Phase Search29 Sep 2025
- 2025An LLM-based multi-agent framework for agile effort estimation17 Sep 2025
- 2025Large Language Model-based Data Science Agent: A Survey2 Aug 2025
- 2025AlgoSimBench: Identifying Algorithmically Similar Problems for Competitive Programming21 Jul 2025
- 2025Code Reasoning for Software Engineering Tasks: A Survey and A Call to Action16 Jun 2025
- 2025MasHost Builds It All: Autonomous Multi-Agent System Directed by Reinforcement Learning10 Jun 2025
- 2025Position: Foundation Models for Tabular Data within Systemic Contexts Need Grounding26 May 2025
- 2025AnesSuite: A Comprehensive Benchmark and Dataset Suite for Anesthesiology Reasoning in LLMs3 Apr 2025
- 2025Towards Reasoning Era: A Survey of Long Chain-of-Thought for Reasoning Large Language Models12 Mar 2025
- 2025Wider or Deeper? Scaling LLM Inference-Time Compute with Adaptive Branching Tree Search6 Mar 2025
- 2025From System 1 to System 2: A Survey of Reasoning Large Language Models24 Feb 2025
- 2025MutaGReP: Execution-Free Repository-Grounded Plan Search for Code-Use21 Feb 2025
- 2025CodeCoR: An LLM-Based Self-Reflective Multi-Agent Framework for Code Generation14 Jan 2025
- 2025CodeCoR: An LLM-Based Self-Reflective Multi-Agent Framework for Code Generationcited by 34
- 2025Large Language Model-based Data Science Agent: A Surveycited by 23
- 2025An LLM-based multi-agent framework for agile effort estimationcited by 6
- 2025VisCoder2: Building Multi-Language Visualization Coding Agentscited by 6
- 2026Orchestrating Intelligence: Confidence-Aware Routing for Efficient Multi-Agent Collaboration across Multi-Scale Modelscited by 6
- 2026Learning Agent Routing From Early Experiencecited by 3
- 2025MasHost Builds It All: Autonomous Multi-Agent System Directed by Reinforcement Learningcited by 2
- 2026MagicAgent: Towards Generalized Agent Planningcited by 2
- 2026Governed Evolution of Agent Runtimes through Executable Operational Cognitioncited by 2
- 2026From LLMs to Agents in Programming: The Impact of Providing an LLM with a Compilercited by 1
- 2026ARIADNE: Agentic Reward-Informed Adaptive Decision Exploration via Blackboard-Driven MCTS for Competitive Program Generationcited by 1
- 2026TraceDev: A Traceability-Driven Multi-agent Framework for Requirement-to-Code Developmentcited by 1
12 most cited of 13 All 13 (JSON)
- 2026TraceDev: A Traceability-Driven Multi-agent Framework for Requirement-to-Code Development21 Jul 2026
- 2026Governed Evolution of Agent Runtimes through Executable Operational Cognition26 May 2026
- 2026Learning Agent Routing From Early Experience8 May 2026
- 2026ARIADNE: Agentic Reward-Informed Adaptive Decision Exploration via Blackboard-Driven MCTS for Competitive Program Generation4 May 2026
- 2026MagicAgent: Towards Generalized Agent Planning22 Feb 2026
- 2026From LLMs to Agents in Programming: The Impact of Providing an LLM with a Compiler17 Jan 2026
- 2026Orchestrating Intelligence: Confidence-Aware Routing for Efficient Multi-Agent Collaboration across Multi-Scale Models8 Jan 2026
- 2025VisCoder2: Building Multi-Language Visualization Coding Agents24 Oct 2025
- 2025Knowledge-Guided Multi-Agent Framework for Application-Level Software Code Generation22 Oct 2025
- 2025An LLM-based multi-agent framework for agile effort estimation17 Sep 2025
- 2025Large Language Model-based Data Science Agent: A Survey2 Aug 2025
- 2025MasHost Builds It All: Autonomous Multi-Agent System Directed by Reinforcement Learning10 Jun 2025
12 newest of 13 All 13 (JSON)
- 2025Towards Reasoning Era: A Survey of Long Chain-of-Thought for Reasoning Large Language Modelscited by 384
- 2025From System 1 to System 2: A Survey of Reasoning Large Language Modelscited by 320
- 2025Wider or Deeper? Scaling LLM Inference-Time Compute with Adaptive Branching Tree Searchcited by 51
- 2026A Survey of Agentic Reasoning for Large Language Models: Towards Recursively Self-Improving and Collective Agentscited by 50
- 2025Code Reasoning for Software Engineering Tasks: A Survey and A Call to Actioncited by 4
- 2025AlgoSimBench: Identifying Algorithmically Similar Problems for Competitive Programmingcited by 2
- 2025Adaptive Test-Time Reasoning via Reward-Guided Dual-Phase Searchcited by 2
- 2025AnesSuite: A Comprehensive Benchmark and Dataset Suite for Anesthesiology Reasoning in LLMscited by 1
- 2026Quality-Driven Agentic Reasoning for LLM-Assisted Software Design: Questions-of-Thoughts (QoT) as a Time-Series Self-QA Chaincited by 1
- 2026LogitsCoder: Towards Efficient Chain-of-Thought Path Search via Logits Preference Decoding for Code Generationcited by 0
- 2026Quality-Driven Agentic Reasoning for LLM-Assisted Software Design: Questions-of-Thoughts (QoT) as a Time-Series Self-QA Chain10 Mar 2026
- 2026LogitsCoder: Towards Efficient Chain-of-Thought Path Search via Logits Preference Decoding for Code Generation15 Feb 2026
- 2026A Survey of Agentic Reasoning for Large Language Models: Towards Recursively Self-Improving and Collective Agents18 Jan 2026
- 2025Adaptive Test-Time Reasoning via Reward-Guided Dual-Phase Search29 Sep 2025
- 2025AlgoSimBench: Identifying Algorithmically Similar Problems for Competitive Programming21 Jul 2025
- 2025Code Reasoning for Software Engineering Tasks: A Survey and A Call to Action16 Jun 2025
- 2025AnesSuite: A Comprehensive Benchmark and Dataset Suite for Anesthesiology Reasoning in LLMs3 Apr 2025
- 2025Towards Reasoning Era: A Survey of Long Chain-of-Thought for Reasoning Large Language Models12 Mar 2025
- 2025Wider or Deeper? Scaling LLM Inference-Time Compute with Adaptive Branching Tree Search6 Mar 2025
- 2025From System 1 to System 2: A Survey of Reasoning Large Language Models24 Feb 2025
- 2025Self-Abstraction from Grounded Experience for Plan-Guided Policy Refinementcited by 9
- 2025Position: Foundation Models for Tabular Data within Systemic Contexts Need Groundingcited by 6
- 2026WebGen-R1: Incentivizing Large Language Models to Generate Functional and Aesthetic Websites with Reinforcement Learningcited by 2
- 2025MutaGReP: Execution-Free Repository-Grounded Plan Search for Code-Usecited by 0
- 2026Budget-Efficient Automatic Algorithm Design via Code Graphcited by 0
- 2026MineValiCoder: Reliable Code Generation with Test Case Quality Mining and Bipartite Graph-Based Mutual Validationcited by 0
- 2026ExeCRE: Execution-Consistency Guided Reliability Estimation for Self-Correcting Code Generationcited by 0
- 2026Make Every Expansion Count: Learning to Search Efficiently in LLM Code Repaircited by 0
- 2026Make Every Expansion Count: Learning to Search Efficiently in LLM Code Repair11 Oct 2026
- 2026ExeCRE: Execution-Consistency Guided Reliability Estimation for Self-Correcting Code Generation5 Aug 2026
- 2026MineValiCoder: Reliable Code Generation with Test Case Quality Mining and Bipartite Graph-Based Mutual Validation24 Jul 2026
- 2026Budget-Efficient Automatic Algorithm Design via Code Graph11 May 2026
- 2026WebGen-R1: Incentivizing Large Language Models to Generate Functional and Aesthetic Websites with Reinforcement Learning22 Apr 2026
- 2025Self-Abstraction from Grounded Experience for Plan-Guided Policy Refinement8 Nov 2025
- 2025Position: Foundation Models for Tabular Data within Systemic Contexts Need Grounding26 May 2025
- 2025MutaGReP: Execution-Free Repository-Grounded Plan Search for Code-Use21 Feb 2025
Similar, not cited
Close in wording, no citation either way
- 2025SEW: Self-Evolving Agentic Workflows for Automated Code Generation
- 2024Tree-of-Code: A Tree-Structured Exploring Framework for End-to-End Code Generation and Execution in Complex Task Handling
- 2024Tree-of-Code: A Hybrid Approach for Robust Complex Task Planning and Execution
- 2025MapCoder-Lite: Distilling Multi-Agent Coding into a Single Small LLM
- 2025CodeVisionary: An Agent-based Framework for Evaluating Large Language Models in Code Generation
- 2025Enhancing LLM Code Generation: A Systematic Evaluation of Multi-Agent Collaboration and Runtime Debugging for Improved Accuracy, Reliability, and Latency
- 2025Towards Advancing Code Generation with Large Language Models: A Research Roadmap
- 2023AgentCoder: Multi-Agent-based Code Generation with Iterative Testing and Optimisation