arXiv:2611.04320cs.AINov 2026

Manuscript Offprint

arXiv:2611.04320

Planning-Coding Separation in LLM-Based Code Generation: An Empirical Study

Wentao Wang, Zeyu Sun, Ruwei Pan, Yueyi Xiao, Qingyuan Liang, Lu Zhang

WENTAO WANG, Peking University, China

ZEYU SUN, Institute of Software, Chinese Academy of Sciences, China

RUWEI PAN, Peking University, China

YUEYI XIAO, Peking University, China

QINGYUAN LIANG, Peking University, China

LU ZHANG, Peking University, China

Planning has been identified as an important factor for improved code generation with Large Language Models (LLMs). However, the interaction between planning capability and coding capability remains largely underexplored, especially when the two capabilities are from different LLMs. In this paper, we conduct the first comprehensive empirical study of planning-coding interaction in LLM-based code generation, where planning and coding are assigned to different LLMs (i.e., planning-coding separation). Specifically, we explore different planner-coder combinations to investigate the effectiveness for coders to utilize planning information from various planners and the impact of further training of coders on planner-coder combinations. Our results demonstrate that almost all planner-coder combinations are as competitive as using the same LLM for planning and coding, and the combination of a stronger planner and a stronger coder typically achieves improved effectiveness. Furthermore, using a large model as the planner paired with a much smaller model as the coder can sometimes be as competitive as using the large model as both the planner and the coder, and further training of the coder can typically boost various planner-coder combinations. These findings provide empirical evidence that planning and coding can be separated to a considerable extent in LLM-based code generation, which may offer a more flexible way to construct code-generation systems.

CCS Concepts: • Software and its engineering → Automatic programming.

Additional Key Words and Phrases: Code Generation, Large Language Models, Planning-Coding Separation

1 Introduction

Large Language Models (LLMs) have made substantial progress in code generation [8, 15, 25]. Their capabilities have been well demonstrated across programming tasks ranging from function-level [24, 28, 32, 54] to repository-level [3, 29, 50, 52]. Recent studies increasingly use explicit planning to further improve code generation performance [7, 9, 43]. By formulating a solution plan before implementation, an LLM can externalize key algorithmic decisions and use them to guide subsequent code generation [21].

Existing planning-based approaches are commonly based on a close coupling between planning and coding. Prompt-based approaches typically use the same LLM to first generate a plan and then implement it [16, 23]. Multi-agent approaches assign planning and coding to different roles, but often instantiate these roles with the same underlying LLM [12, 20]. Training-based approaches also rely on a strong connection between planning and coding: Some approaches distill planning and reasoning capabilities of larger models into smaller models [35], while others explicitly train coders to better follow and implement plans provided by planners [10]. In these settings, planning and coding are usually developed and evaluated within one particular model or a tightly coupled planner-coder configuration, indicating that the coordination between the planner and the coder should be carefully dealt with. Recently, researchers have conducted further investigations into cross-model planner-coder configurations, i.e., using plans produced by one LLM to assist coding

Authors' Contact Information: Wentao Wang, wwt@stu.pku.edu.cn, Peking University, Beijing, China; Zeyu Sun, Institute of Software, Chinese Academy of Sciences, Beijing, China; Ruwei Pan, Peking University, Beijing, China; Yueyi Xiao, Peking University, Beijing, China; Qingyuan Liang, Peking University, Beijing, China; Lu Zhang, Peking University, Beijing, China.

by another [18, 47]. These investigations are often motivated by practical objectives, such as reducing inference cost. Although these studies investigate some less tightly coupled planner-coder configurations, they typically focus on specific planner-coder configurations designed for specific objectives rather than examining planning and coding as underlying capabilities.

As LLMs continue to exhibit increasingly diverse capabilities, a fundamental question emerges: Should the ability of an LLM-based code generation system be understood as a unified capability of a single model, or as the result of multiple capabilities that can be separately characterized and leveraged? In this context, planning and coding provide an important case for examining whether different stages of code generation exhibit similar or different capability patterns. Understanding this relationship is thus important for revealing how planning and coding interact in LLM-based code generation and how these capabilities can be better studied and improved.

To help researchers have a deeper understanding of the relationship between models' planning capability and coding capability, we conduct a comprehensive empirical study on planning-coding interaction in LLM-based code generation. In our study, we separate planning from coding and assign the two stages to independently configurable LLMs, which we refer to as planning-coding separation. Given a programming problem, a planner first generates a solution plan, and a coder then generates code based on the problem and the plan. This formulation makes it possible to vary planners and coders independently and examine how planning information from different planners is utilized by different coders.

Specifically, we investigate planning-coding interaction from three perspectives. First, we systematically vary the planner and coder across different LLMs to examine how the resulting performance changes under different pairings and whether the relative effectiveness remains consistent across different settings of the two stages. Second, we study the impact of model scales by varying the sizes of the planner and coder independently, allowing us to compare how additional model capacity contributes to overall effectiveness. Third, we further train coders with standard instruction-tuning data for code generation and evaluate the trained coders with different planners to examine how coder-side improvement changes the overall effectiveness.

Our results reveal three main findings.

(1) Planning and coding show substantial compatibility across LLMs: cross-model planner-coder configurations are generally competitive with same-model configurations, and stronger planners and stronger coders generally lead to better combined performance. When comparing each cross-model pair with the corresponding same-model pair, 27 of 44 pairs (61.4%) achieve equal or better performance. Moreover, the relative effectiveness of planners remains consistent across different coders in 9 out of 10 model-group comparisons, suggesting that effective planner-coder combinations are not restricted to the use of the same LLM.

(2) Planning and coding exhibit different requirements for model scales. Although increasing the coder scale generally improves plan-assisted generation, a strong planner can enable substantially smaller coders to achieve competitive performance. For example, when GPT-5.6-Sol is used as the planner, Qwen3.5-27B and Qwen3.8-27B coders achieve 68.00 and 71.05 Pass@1 on LiveCodeBench, matching or even exceeding the performance of using GPT-5.6-Sol for both planning and coding (66.86 Pass@1). With further scale reduction, Qwen3.5-27B (planner) paired with Qwen3-4B (coder) still achieves 37.71 Pass@1, significantly outperforming direct generation with Qwen3-32B (27.43 Pass@1). These results highlight the potential of the Large-Planner-Small-Coder (LPSC) pattern, where a strong planner can be combined with a substantially smaller coder.

(3) Further training of the coder generally improves its performance with different planners, suggesting that planner-agnostic improvements on the coder side are beneficial across different planner-coder combinations. When using the same planning inputs before and after standard code instruction tuning, the training improves performance in 19 of 20 plan-assisted code generation settings, and the training effect follows the same direction as direct generation in 22 of 24 plan-assisted code generation settings across the two benchmarks. These results indicate that coder-side improvements can transfer across different planners even without planner-specific adaptation.

The main contributions of this paper are as follows:

  • To the best of our knowledge, we are the first to systematically study planning-coding separation across LLMs. That is, rather than focusing on a fixed relationship between the two stages, we independently vary the models responsible for planning and coding to study how their interaction affects code generation.
  • Our study of planning-coding separation adopts diverse model families and scales, and further examines the effect of coder training with different planners. This provides a controlled characterization of how planner and coder choices jointly shape generation performance.
  • Our study reveals that planning and coding can be separated to a substantial extent: Planning information is effectively transmitted across LLMs, planning-coding separation can effectively operate with substantially different model scales, and planner-agnostic improvements of a coder remain effective across multiple planners. These findings provide a foundation for further investigation of more flexible planner-coder configurations in LLM-based code generation.

References (31)