mlsanityData to 7 Oct 2026

Effective Large Language Model Debugging with Best-first Tree Search

arXiv 2407.19055 ↗First posted 26 Jul 2024cs.SE cs.AI cs.LGcited by 1

Not on the map. Why?

Abstract (arXiv)

Large Language Models (LLMs) show promise in code generation tasks. However, their code-writing abilities are often limited in scope: while they can successfully implement simple functions, they struggle with more complex tasks. A fundamental difference with how an LLM writes code, compared to a human programmer, is that it cannot consistently spot and fix bugs. Debugging is a crucial skill for programmers and it enables iterative code refinement towards a correct implementation. In this work, we propose a novel algorithm to enable LLMs to debug their code via self-reflection and search where a model attempts to identify its previous mistakes. Our key contributions are 1) a best-first tree search algorithm with self-reflections (BESTER) that achieves state-of-the-art Pass@1 in three code generation benchmarks. BESTER maintains its superiority when we measure pass rates taking into account additional inference costs incurred by tree search. 2) A novel interpretability study on what self-reflections attend to in buggy programs and how they impact bug fixes, which provides a deeper understanding of the debugging process. 3) An extensive study on when self-reflections are effective in finding bugs.

Key facts. Cited by 1 paper in the map (data through 7 Oct 2026). Builds on 35 of its 41 references that are in the map. First posted on arXiv 26 Jul 2024.

Builds on

35 of 41 references.

References · 35

  1. 2023GPT-4 Technical Reportcited by 18,132
  2. 2023Llama 2: Open Foundation and Fine-Tuned Chat Modelscited by 12,865
  3. 2022Chain-of-Thought Prompting Elicits Reasoning in Large Language Modelscited by 12,302
  4. 2021Training Verifiers to Solve Math Word Problemscited by 9,743
  5. 2020Measuring Massive Multitask Language Understandingcited by 7,768
  6. 2021Measuring Mathematical Problem Solving With the MATH Datasetcited by 5,203
  7. 2023Reflexion: Language Agents with Verbal Reinforcement Learningcited by 4,064
  8. 2021Program Synthesis with Large Language Modelscited by 3,509
  9. 2023Self-Refine: Iterative Refinement with Self-Feedbackcited by 3,317
  10. 2023SWE-bench: Can Language Models Resolve Real-World GitHub Issues?cited by 3,193
  11. 2023Tree of Thoughts: Deliberate Problem Solving with Large Language Modelscited by 3,155
  12. 2023Code Llama: Open Foundation Models for Codecited by 2,105
23 more
  1. 2024Mixtral of Expertscited by 1,785
  2. 2022Competition-Level Code Generation with AlphaCodecited by 1,427
  3. 2022Least-to-Most Prompting Enables Complex Reasoning in Large Language Modelscited by 1,397
  4. 2023Is Your Code Generated by ChatGPT Really Correct? Rigorous Evaluation of Large Language Models for Code Generationcited by 1,332
  5. 2024DeepSeek-Coder: When the Large Language Model Meets Programming -- The Rise of Code Intelligencecited by 1,154
  6. 2021Measuring Coding Challenge Competence With APPScited by 879
  7. 2022Large Language Models Can Self-Improvecited by 656
  8. 2023WizardMath: Empowering Mathematical Reasoning for Large Language Models via Reinforced Evol-Instructcited by 618
  9. 2023Language Agent Tree Search Unifies Reasoning Acting and Planning in Language Modelscited by 551
  10. 2020Captum: A unified and generic model interpretability library for PyTorchcited by 542
  11. 2023Logic-LM: Empowering Large Language Models with Symbolic Solvers for Faithful Logical Reasoningcited by 379
  12. 2022A Systematic Evaluation of Large Language Models of Codecited by 360
  13. 2022Reasoning with Language Model Prompting: A Surveycited by 251
  14. 2024OpenCodeInterpreter: Integrating Code Generation with Execution and Refinementcited by 242
  15. 2023MathPrompter: Mathematical Reasoning using Large Language Modelscited by 236
  16. 2023Is Self-Repair a Silver Bullet for Code Generation?cited by 191
  17. 2022GitHub Copilot AI pair programmer: Asset or Liability?cited by 150
  18. 2024OpenMathInstruct-1: A 1.8 Million Math Instruction Tuning Datasetcited by 143
  19. 2023LLMs cannot find reasoning errors, but can correct them given the error locationcited by 85
  20. 2023Coupling Large Language Models with Logic Programming for Robust and General Reasoning from Textcited by 59
  21. 2024Prompting Large Language Models to Tackle the Full Software Development Lifecycle: A Case Studycited by 40
  22. 2024Nemotron-4 15B Technical Reportcited by 36
  23. 2023Using Captum to Explain Generative Language Modelscited by 33

Built on by

Cited by year (2026 to 7 Oct)

Citing papers per year: 2026: 1.

1 paper.