mlsanityData to 14 Oct 2026

CodeTree: Agent-guided Tree Search for Code Generation with Large Language Models

arXiv 2411.04329 ↗First posted 7 Nov 2024cs.CLcited by 34

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

  1. 2024MapCoder: Multi-Agent Code Generation for Competitive Problem Solving18 May
  2. 2023Teaching Large Language Models to Self-Debug11 Apr
  3. 2023LEVER: Learning to Verify Language-to-Code Generation with Execution16 Feb
  4. 2022Competition-Level Code Generation with AlphaCode8 Feb

Other references · 29

  1. 2023GPT-4 Technical Reportcited by 18,396
  2. 2022Training language models to follow instructions with human feedbackcited by 15,971
  3. 2023LLaMA: Open and Efficient Foundation Language Modelscited by 14,132
  4. 2021Evaluating Large Language Models Trained on Codecited by 8,320
  5. 2022Self-Consistency Improves Chain of Thought Reasoning in Language Modelscited by 5,708
  6. 2022PaLM: Scaling Language Modeling with Pathwayscited by 5,326
  7. 2023Reflexion: Language Agents with Verbal Reinforcement Learningcited by 4,276
  8. 2021Program Synthesis with Large Language Modelscited by 3,637
  9. 2023Self-Refine: Iterative Refinement with Self-Feedbackcited by 3,442
  10. 2023SWE-bench: Can Language Models Resolve Real-World GitHub Issues?cited by 3,373
  11. 2023Code Llama: Open Foundation Models for Codecited by 2,139
  12. 2023MetaGPT: Meta Programming for A Multi-Agent Collaborative Frameworkcited by 1,808
17 more
  1. 2023CAMEL: Communicative Agents for "Mind" Exploration of Large Language Model Societycited by 1,395
  2. 2023Is Your Code Generated by ChatGPT Really Correct? Rigorous Evaluation of Large Language Models for Code Generationcited by 1,391
  3. 2023ChatDev: Communicative Agents for Software Developmentcited by 919
  4. 2021Measuring Coding Challenge Competence With APPScited by 902
  5. 2023StarCoder: may the source be with you!cited by 799
  6. 2023Textbooks Are All You Needcited by 569
  7. 2022CodeT: Code Generation with Generated Testscited by 384
  8. 2023CodeT5+: Open Code Large Language Models for Code Understanding and Generationcited by 333
  9. 2022Generating Sequences by Learning to Self-Correctcited by 277
  10. 2023Self-collaboration Code Generation via ChatGPTcited by 258
  11. 2024Tree Search for Language Model Agentscited by 151
  12. 2022Natural Language to Code Translation with Executioncited by 124
  13. 2023Self-Edit: Fault-Aware Code Editor for Code Generationcited by 111
  14. 2022Coder Reviewer Reranking for Code Generationcited by 84
  15. 2023Improving Code Generation by Training with Natural Language Feedbackcited by 76
  16. 2023CodeChain: Towards Modular Code Generation Through Chain of Self-revisions with Representative Sub-modulescited by 58
  17. 2024Divide-and-Conquer Meets Consensus: Unleashing the Power of Functions in Code Generationcited by 19

Built on by

Cited by year (2026 to 14 Oct)

Citing papers per year: 2025: 17; 2026: 17.

34 papers.

Sort:

By area:

  1. 2025Towards Reasoning Era: A Survey of Long Chain-of-Thought for Reasoning Large Language Modelscited by 384
  2. 2025From System 1 to System 2: A Survey of Reasoning Large Language Modelscited by 320
  3. 2025Wider or Deeper? Scaling LLM Inference-Time Compute with Adaptive Branching Tree Searchcited by 51
  4. 2026A Survey of Agentic Reasoning for Large Language Models: Towards Recursively Self-Improving and Collective Agentscited by 50
  5. 2025CodeCoR: An LLM-Based Self-Reflective Multi-Agent Framework for Code Generationcited by 34
  6. 2025Large Language Model-based Data Science Agent: A Surveycited by 23
  7. 2025Self-Abstraction from Grounded Experience for Plan-Guided Policy Refinementcited by 9
  8. 2025Position: Foundation Models for Tabular Data within Systemic Contexts Need Groundingcited by 6
  9. 2025An LLM-based multi-agent framework for agile effort estimationcited by 6
  10. 2025VisCoder2: Building Multi-Language Visualization Coding Agentscited by 6
  11. 2026Orchestrating Intelligence: Confidence-Aware Routing for Efficient Multi-Agent Collaboration across Multi-Scale Modelscited by 6
  12. 2025Code Reasoning for Software Engineering Tasks: A Survey and A Call to Actioncited by 4
22 more
  1. 2025LUT-LLM: Efficient Large Language Model Inference with Memory-based Computations on FPGAscited by 4
  2. 2026Learning Agent Routing From Early Experiencecited by 3
  3. 2025MasHost Builds It All: Autonomous Multi-Agent System Directed by Reinforcement Learningcited by 2
  4. 2025AlgoSimBench: Identifying Algorithmically Similar Problems for Competitive Programmingcited by 2
  5. 2025Adaptive Test-Time Reasoning via Reward-Guided Dual-Phase Searchcited by 2
  6. 2026MagicAgent: Towards Generalized Agent Planningcited by 2
  7. 2026WebGen-R1: Incentivizing Large Language Models to Generate Functional and Aesthetic Websites with Reinforcement Learningcited by 2
  8. 2026Governed Evolution of Agent Runtimes through Executable Operational Cognitioncited by 2
  9. 2025AnesSuite: A Comprehensive Benchmark and Dataset Suite for Anesthesiology Reasoning in LLMscited by 1
  10. 2026From LLMs to Agents in Programming: The Impact of Providing an LLM with a Compilercited by 1
  11. 2026Quality-Driven Agentic Reasoning for LLM-Assisted Software Design: Questions-of-Thoughts (QoT) as a Time-Series Self-QA Chaincited by 1
  12. 2026ARIADNE: Agentic Reward-Informed Adaptive Decision Exploration via Blackboard-Driven MCTS for Competitive Program Generationcited by 1
  13. 2026TraceDev: A Traceability-Driven Multi-agent Framework for Requirement-to-Code Developmentcited by 1
  14. 2025MutaGReP: Execution-Free Repository-Grounded Plan Search for Code-Usecited by 0
  15. 2025Knowledge-Guided Multi-Agent Framework for Application-Level Software Code Generationcited by 0
  16. 2026LogitsCoder: Towards Efficient Chain-of-Thought Path Search via Logits Preference Decoding for Code Generationcited by 0
  17. 2026VQ-Jarvis: Retrieval-Augmented Video Restoration Agent with Sharp Vision and Fast Thoughtcited by 0
  18. 2026Budget-Efficient Automatic Algorithm Design via Code Graphcited by 0
  19. 2026MineValiCoder: Reliable Code Generation with Test Case Quality Mining and Bipartite Graph-Based Mutual Validationcited by 0
  20. 2026ExeCRE: Execution-Consistency Guided Reliability Estimation for Self-Correcting Code Generationcited by 0
  21. 2026Make Every Expansion Count: Learning to Search Efficiently in LLM Code Repaircited by 0
  22. 2026Write Once, Plan Many: Building Reusable Visual Planning Systems from One Scenecited by 0

Similar, not cited

Close in wording, no citation either way

  1. 2025SEW: Self-Evolving Agentic Workflows for Automated Code Generation
  2. 2024Tree-of-Code: A Tree-Structured Exploring Framework for End-to-End Code Generation and Execution in Complex Task Handling
  3. 2024Tree-of-Code: A Hybrid Approach for Robust Complex Task Planning and Execution
  4. 2025MapCoder-Lite: Distilling Multi-Agent Coding into a Single Small LLM
  5. 2025CodeVisionary: An Agent-based Framework for Evaluating Large Language Models in Code Generation
  6. 2025Enhancing LLM Code Generation: A Systematic Evaluation of Multi-Agent Collaboration and Runtime Debugging for Improved Accuracy, Reliability, and Latency
  7. 2025Towards Advancing Code Generation with Large Language Models: A Research Roadmap
  8. 2023AgentCoder: Multi-Agent-based Code Generation with Iterative Testing and Optimisation