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.
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.
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:
- 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.
- 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.
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.
Key Results
- For the majority of LLMs, the
Pass@1accuracy 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.
Limitations and Future Work
The authors note two primary limitations:
- 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.
- 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