mlsanityData to 7 Oct 2026

PaT: Planning-after-Trial for Efficient Test-Time Code Generation

arXiv 2605.07248 ↗First posted 8 May 2026cs.CL cs.LGcited by 2

On the map: LLM reasoning → Reasoning for agents, planning and code

Abstract (arXiv)

Beyond training-time optimization, scaling test-time computation has emerged as a key paradigm to extend the reasoning capabilities of Large Language Models (LLMs). However, most existing methods adopt a rigid Planning-before-Trial (PbT) policy, which inefficiently allocates test-time compute by incurring planning overhead even on directly solvable problems. We propose Planning-after-Trial (PaT), an adaptive policy for code generation that invokes a planner only upon verification failure. This adaptive policy naturally enables a heterogeneous model configuration: a cost-efficient model handles generation attempts, while a powerful model is reserved for targeted planning interventions. Empirically, across multiple benchmarks and model families, our approach significantly advances the cost-performance Pareto frontier. Notably, our heterogeneous configuration achieves performance comparable to a large homogeneous model while reducing inference cost by approximately 69%.

Key facts. Cited by 2 papers in the map (data through 7 Oct 2026). Placed in Reasoning for agents, planning and code, one of 17 directions in LLM reasoning. Builds on 19 of its 37 references that are in the map. First posted on arXiv 8 May 2026.

Builds on

19 of 37 references.

Closest ancestors · 3

Same direction, newest first

  1. 2025Learning When to Plan: Efficiently Allocating Test-Time Compute for LLM Agents3 Sep
  2. 2025rStar-Coder: Scaling Competitive Code Reasoning with a Large-Scale Verified Dataset27 May
  3. 2022Competition-Level Code Generation with AlphaCode8 Feb

Other references · 16

  1. 2020Language Models are Few-Shot Learnerscited by 32,199
  2. 2022Training language models to follow instructions with human feedbackcited by 15,712
  3. 2020Scaling Laws for Neural Language Modelscited by 6,411
  4. 2021Program Synthesis with Large Language Modelscited by 3,509
  5. 2023Is Your Code Generated by ChatGPT Really Correct? Rigorous Evaluation of Large Language Models for Code Generationcited by 1,332
  6. 2022Program of Thoughts Prompting: Disentangling Computation from Reasoning for Numerical Reasoning Taskscited by 1,057
  7. 2023WizardCoder: Empowering Code Large Language Models with Evol-Instructcited by 728
  8. 2024Self-Play Fine-Tuning Converts Weak Language Models to Strong Language Modelscited by 552
  9. 2022CodeT: Code Generation with Generated Testscited by 369
  10. 2023RepoCoder: Repository-Level Code Completion Through Iterative Retrieval and Generationcited by 357
  11. 2024Debug like a Human: A Large Language Model Debugger via Verifying Runtime Execution Step-by-stepcited by 123
  12. 2023CodeChain: Towards Modular Code Generation Through Chain of Self-revisions with Representative Sub-modulescited by 58
4 more
  1. 2024A Pair Programming Framework for Code Generation via Multi-Plan Exploration and Feedback-Driven Refinementcited by 21
  2. 2024Divide-and-Conquer Meets Consensus: Unleashing the Power of Functions in Code Generationcited by 19
  3. 2023INTERVENOR: Prompting the Coding Ability of Large Language Models with the Interactive Chain of Repaircited by 18
  4. 2025Learning to Generate Unit Tests for Automated Debuggingcited by 16

Built on by

Cited by year (2026 to 7 Oct)

Citing papers per year: 2026: 2.

2 papers.

Similar, not cited

Close in wording, no citation either way

  1. 2025S*: Test Time Scaling for Code Generation
  2. 2024Planning-Driven Programming: A Large Language Model Programming Workflow
  3. 2025Adaptive Test-Time Reasoning via Reward-Guided Dual-Phase Search
  4. 2024Enhancing Code Generation Performance of Smaller Models by Distilling the Reasoning Ability of LLMs
  5. 2026TDD-Agent: Test-Driven Reasoning for Code Generation
  6. 2026Adaptive Test-Time Compute Allocation via Learned Heuristics over Categorical Structure
  7. 2026Adaptive Generate-Rank-Verify: Inference-Time Search with Costly Verification
  8. 2025Reasoning on a Budget: A Survey of Adaptive and Controllable Test-Time Compute in LLMs