NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

CodeFlowBench: A Multi-turn, Iterative Benchmark for Complex Code Generation

Sizhe Wang, Zhengren Wang, Dongsheng Ma, Yongan Yu, Rui Ling, Zhiyu Li, Feiyu Xiong, Wentao Zhang

TL;DR

CodeFlowBench is the first benchmark designed to evaluate Large Language Models (LLMs) on "codeflow"—the realistic, multi-turn, iterative process of building complex software by reusing modular functions. The benchmark reveals a massive performance gap, showing that even state-of-the-art reasoning models suffer up to a 50% drop in success rates when forced to manage hierarchical code dependencies over multiple turns.

What Problem Does This Paper Address?

While LLMs have become remarkably good at generating standalone code snippets or fixing isolated bugs, standard benchmarks like HumanEval or MBPP evaluate them primarily on single-turn, monolithic code generation. Real-world software engineering doesn't work this way. Instead, developers follow a "codeflow" paradigm: breaking complex tasks into manageable subproblems, writing modular functions, and progressively building solutions by reusing existing code.

As shown in the paper's introductory comparison, a monolithic single-turn approach results in code that is hard to read, test, and maintain. In contrast, a structured codeflow allows for parallel development and clear responsibility boundaries.

A comparison between modular codeflow and monolithic single-turn code generation

Existing multi-turn benchmarks either lack unit tests or fail to replicate the intricate dependency structures found in production software. CodeFlowBench addresses this gap by providing a rigorous framework to evaluate how well LLMs can "look before and after"—leveraging pre-implemented functions while maintaining code modularity.

Methods

The authors developed an automated, lightweight data curation pipeline grounded in Abstract Syntax Tree (AST) parsing. The pipeline takes monolithic solutions, parses their ASTs to extract function dependencies, and topologically sorts them. Each function is treated as a distinct subproblem. The pipeline then uses an LLM (like DeepSeek-V3) to back-translate the code logic into natural language problem descriptions and automatically generates verified unit tests by instrumenting function calls during execution.

The automated data curation pipeline of CodeFlowBench

To evaluate models properly, the authors introduced a specialized evaluation framework featuring structural metrics derived from dependency trees:

  • Pass Turn (PT): Identifies the exact turn at which a model fails.
  • Average Pass Depth (APD): Measures how deeply a model can successfully traverse a bottom-up programming tree.
  • Dependency Structure Complexity (DSC): Defined as the ratio of total turns to the maximum depth in the AST, quantifying the structural complexity of the problem.

Datasets

CodeFlowBench consists of two complementary datasets designed to balance algorithmic depth with real-world domain breadth:

  1. CodeFlowBench-Comp: Sourced from the competitive programming platform Codeforces. It contains 5,258 high-difficulty problems emphasizing multi-step logic (up to 7+ interaction turns) and complex reasoning.
  2. CodeFlowBench-Repo: Derived from real-world GitHub repositories (with >100 stars) across five domains: Basic utilities, Cryptography, Network, System, and Visualization. It features up to 9 interaction turns and a dependency depth of 4.
An illustrative example of a decomposed problem from CodeFlowBench

Key Insights and Ideas

  • The Single-Turn Illusion: Reasoning-enhanced models like DeepSeek-R1 and o3-mini achieve stellar scores in single-turn settings but experience performance drops exceeding 50% in multi-turn codeflow scenarios. This indicates that single-turn metrics largely reflect peak reasoning capabilities rather than long-context coherence and robust dependency management.
  • Complexity as a Capacity Filter: In shallow dependency structures, agile reasoning paradigms matter most (e.g., o3-mini outperforming larger base models). However, deep dependency chains act as a capacity filter where raw parameter scale becomes decisive for maintaining global context.
  • Structural Bottlenecks: Model performance inversely correlates with dependency complexity. Most models perform well on linear dependency structures (DSC = 1) but struggle significantly when faced with hierarchical or nested function calls.
Heatmap showing model performance degrading as Dependency Structure Complexity (DSC) increases

Key Results

  • For the majority of LLMs, the Pass@1 accuracy in multi-turn scenarios remains below 30%, highlighting the benchmark's difficulty.
  • Gemini-3-flash-thinking achieved SOTA performance on CodeFlowBench-Comp with 48.4% accuracy in multi-turn (compared to 65.5% in single-turn).
  • GPT-5 led the pack on CodeFlowBench-Repo with 34.7% multi-turn accuracy (compared to 48.8% in single-turn).
  • As the number of turns increases, performance drops sharply across all models; even top-performing models completely fail to solve problems requiring more than six turns.
Model performance curves showing a sharp decline as the number of turns increases

Limitations and Future Work

The authors note two primary limitations:

  1. Pipeline Specificity: While the subproblem generation phase is generalizable, the initial data preparation phase is currently tailored to Codeforces and DomainEval. Future work includes building an agentic framework to adapt the pipeline to diverse codebases like Bitbucket automatically.
  2. Lack of Specialized Models: Currently, no models are explicitly fine-tuned for the codeflow task.

Future research directions will focus on training specialized models and agentic systems on this dataset, as well as extending the codeflow paradigm to include iterative debugging loops.

Summary updated

BibTeX
@inproceedings{wang2026codeflowbench,
  author = {Sizhe Wang and Zhengren Wang and Dongsheng Ma and Yongan Yu and Rui Ling and Zhiyu Li and Feiyu Xiong and Wentao Zhang},
  title = {{CodeFlowBench: A Multi-turn, Iterative Benchmark for Complex Code Generation}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2026},
  doi = {10.18653/v1/2026.acl-long.201},
}
Figure