mlsanityData to 14 Oct 2026

Planning with Large Language Models for Code Generation

arXiv 2303.05510 ↗First posted 9 Mar 2023cs.LG cs.AI cs.CLcited by 182

Not on the map. Why?

Cited by 62 in LLM reasoning, but placed by its own abstract, which didn’t fit.

Abstract (arXiv)

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, the Transformer makes use of a planner to generate candidate programs and test them on public test cases. The Transformer can therefore make more informed decisions and generate tokens that will eventually lead to higher-quality programs. We also design a mechanism that shares information between the Transformer and the planner to make our algorithm computationally efficient. We empirically evaluate our framework with several large language models as backbones on public coding challenge benchmarks, showing that 1) it can generate programs that consistently achieve higher performance compared with competing baseline methods; 2) it enables controllable code generation, such as concise codes and highly-commented codes by optimizing modified objective.

Key facts. Cited by 182 papers in the map (data through 14 Oct 2026). Builds on 32 of its 50 references that are in the map. First posted on arXiv 9 Mar 2023.

Builds on

32 of 50 references.

References · 32

  1. 2017Attention Is All You Needcited by 60,361
  2. 2018BERT: Pre-training of Deep Bidirectional Transformers for Language Understandingcited by 40,399
  3. 2019Exploring the Limits of Transfer Learning with a Unified Text-to-Text Transformercited by 14,599
  4. 2021Evaluating Large Language Models Trained on Codecited by 8,320
  5. 2021Program Synthesis with Large Language Modelscited by 3,637
  6. 2019HuggingFace's Transformers: State-of-the-art Natural Language Processingcited by 2,218
  7. 2022Competition-Level Code Generation with AlphaCodecited by 1,462
  8. 2020CodeBERT: A Pre-Trained Model for Programming and Natural Languagescited by 1,310
  9. 2018Hierarchical Neural Story Generationcited by 1,193
  10. 2021CodeT5: Identifier-aware Unified Pre-trained Encoder-Decoder Models for Code Understanding and Generationcited by 906
  11. 2021Measuring Coding Challenge Competence With APPScited by 902
  12. 2017Mastering Chess and Shogi by Self-Play with a General Reinforcement Learning Algorithmcited by 734
20 more
  1. 2020GraphCodeBERT: Pre-training Code Representations with Data Flowcited by 609
  2. 2022CodeT: Code Generation with Generated Testscited by 384
  3. 2021Unified Pre-training for Program Understanding and Generationcited by 366
  4. 2022CodeRL: Mastering Code Generation through Pretrained Models and Deep Reinforcement Learningcited by 358
  5. 2020Unsupervised Translation of Programming Languagescited by 263
  6. 2021NeuroLogic A*esque Decoding: Constrained Text Generation with Lookahead Heuristicscited by 154
  7. 2020Unit Test Case Generation with Transformers and Focal Contextcited by 118
  8. 2019Write, Execute, Assess: Program Synthesis with a REPLcited by 93
  9. 2018Leveraging Grammar and Reinforcement Learning for Neural Program Synthesiscited by 84
  10. 2021Leveraging Automated Unit Tests for Unsupervised Code Translationcited by 82
  11. 2020Learning Compositional Rules via Neural Program Synthesiscited by 74
  12. 2021Machine Translation Decoding beyond Beam Searchcited by 55
  13. 2020Synthesize, Execute and Debug: Learning to Repair for Neural Program Synthesiscited by 39
  14. 2021Latent Execution for Neural Program Synthesiscited by 35
  15. 2021PPL-MCTS: Constrained Textual Generation Through Discriminator-Guided MCTS Decodingcited by 33
  16. 2020Generating Accurate Assert Statements for Unit Test Cases using Pretrained Transformerscited by 30
  17. 2021To Beam Or Not To Beam: That is a Question of Cooperation for Language GANscited by 14
  18. 2018Program Synthesis Through Reinforcement Learning Guided Tree Searchcited by 7
  19. 2020Softmax Tempering for Training Neural Machine Translation Modelscited by 6
  20. 2019Neural Program Synthesis By Self-Learningcited by 5

Built on by

Cited by year (2026 to 14 Oct)

Citing papers per year: 2023: 22; 2024: 56; 2025: 75; 2026: 29.

182 papers.

Sort:

By area:

  1. 2023Tree of Thoughts: Deliberate Problem Solving with Large Language Modelscited by 3,211
  2. 2023A Survey of Large Language Modelscited by 2,576
  3. 2023Code Llama: Open Foundation Models for Codecited by 2,139
  4. 2025s1: Simple test-time scalingcited by 1,341
  5. 2023Graph of Thoughts: Solving Elaborate Problems with Large Language Modelscited by 886
  6. 2024CRUXEval: A Benchmark for Code Reasoning, Understanding and Executioncited by 300
  7. 2023Alphazero-like Tree-Search can Guide Large Language Model Decoding and Trainingcited by 295
  8. 2024Inference Scaling Laws: An Empirical Analysis of Compute-Optimal Inference for Problem-Solving with Language Modelscited by 290
  9. 2024ReEvo: Large Language Models as Hyper-Heuristics with Reflective Evolutioncited by 276
  10. 2024Spider 2.0: Evaluating Language Models on Real-World Enterprise Text-to-SQL Workflowscited by 232
  11. 2023Large Language Models as Commonsense Knowledge for Large-Scale Task Planningcited by 231
  12. 2025A Survey on Test-Time Scaling in Large Language Models: What, How, Where, and How Well?cited by 223
38 more
  1. 2024ArtPrompt: ASCII Art-based Jailbreak Attacks against Aligned LLMscited by 216
  2. 2023Self-Taught Optimizer (STOP): Recursively Self-Improving Code Generationcited by 148
  3. 2023Table Meets LLM: Can Large Language Models Understand Structured Table Data? A Benchmark and Empirical Studycited by 116
  4. 2023Toward General-Purpose Robots via Foundation Models: A Survey and Meta-Analysiscited by 103
  5. 2023Sequential Monte Carlo Steering of Large Language Models using Probabilistic Programscited by 80
  6. 2023Transformer-based Planning for Symbolic Regressioncited by 79
  7. 2024Functional Benchmarks for Robust Evaluation of Reasoning Performance, and the Reasoning Gapcited by 79
  8. 2023Unleashing the potential of prompt engineering for large language modelscited by 72
  9. 2025Revisiting the Test-Time Scaling of o1-like Models: Do they Truly Possess Test-Time Scaling Capabilities?cited by 70
  10. 2024Fight Back Against Jailbreaking via Prompt Adversarial Tuningcited by 67
  11. 2025Think Only When You Need with Large Hybrid-Reasoning Modelscited by 66
  12. 2025ReasonFlux: Hierarchical LLM Reasoning via Scaling Thought Templatescited by 63
  13. 2024DA-Code: Agent Data Science Code Generation Benchmark for Large Language Modelscited by 58
  14. 2025A Survey of LLM-Driven AI Agent Communication: Protocols, Security Risks, and Defense Countermeasurescited by 57
  15. 2024GenARM: Reward Guided Generation with Autoregressive Reward Model for Test-time Alignmentcited by 54
  16. 2024Universal Vulnerabilities in Large Language Models: Backdoor Attacks for In-context Learningcited by 53
  17. 2023Adaptation with Self-Evaluation to Improve Selective Prediction in LLMscited by 50
  18. 2024When is Tree Search Useful for LLM Planning? It Depends on the Discriminatorcited by 47
  19. 2024From Code to Correctness: Closing the Last Mile of Code Generation with Hierarchical Debuggingcited by 46
  20. 2025Syntactic and Semantic Control of Large Language Models via Sequential Monte Carlocited by 46
  21. 2023ALGO: Synthesizing Algorithmic Programs with LLM-Generated Oracle Verifierscited by 41
  22. 2024RATT: A Thought Structure for Coherent and Correct LLM Reasoningcited by 41
  23. 2024Generating Code World Models with Large Language Models Guided by Monte Carlo Tree Searchcited by 40
  24. 2024Benchmarking Language Model Creativity: A Case Study on Code Generationcited by 40
  25. 2024CRAB: Cross-environment Agent Benchmark for Multimodal Language Model Agentscited by 39
  26. 2024Causal Language Modeling Can Elicit Search and Reasoning Capabilities on Logic Puzzlescited by 38
  27. 2024The Essential Role of Causality in Foundation World Models for Embodied AIcited by 32
  28. 2025Uncertainty-Guided Chain-of-Thought for Code Generation with LLMscited by 32
  29. 2024A Survey on Data Augmentation in Large Model Eracited by 31
  30. 2026Scalable Power Sampling: Unlocking Efficient, Training-Free Reasoning for LLMs via Distribution Sharpeningcited by 31
  31. 2025Two Heads are Better Than One: Test-time Scaling of Multi-agent Collaborative Reasoningcited by 29
  32. 2024Search-Based LLMs for Code Optimizationcited by 28
  33. 2023LLM-Assisted Code Cleaning For Training Accurate Code Generatorscited by 27
  34. 2024RethinkMCTS: Refining Erroneous Thoughts in Monte Carlo Tree Search for Code Generationcited by 26
  35. 2025Large Language Models for Code Generation: A Comprehensive Survey of Challenges, Techniques, Evaluation, and Applicationscited by 26
  36. 2025Thinking Machines: A Survey of LLM based Reasoning Strategiescited by 25
  37. 2023Beyond Static Datasets: A Deep Interaction Approach to LLM Evaluationcited by 24
  38. 2025AdaptiveStep: Automatically Dividing Reasoning Step through Model Confidencecited by 24

50 most cited of 182 All 182 (JSON)