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

EditFlow: Benchmarking and Optimizing Code Edit Recommendation Systems via Reconstruction of Developer Flows

Chenyan Liu, Yun Lin, Jiaxin Chang, Jiawei Liu, Binhang Qi, Bo Jiang, Zhiyong Huang, Jin Song Dong · DOI

TL;DR

Current AI coding assistants often slow developers down because they suggest technically correct edits in a disruptive, non-linear order. EditFlow bridges this gap by reconstructing the step-by-step "mental flow" of developers, using a digital-twin simulation to benchmark and optimize AI suggestions, ultimately boosting developer productivity by over 25%.

What Problem Does This Paper Address?

We are in a strange era where LLMs are setting records on coding benchmarks, yet empirical studies show that developers using these tools can actually be 19% slower than those working unaided.

The authors identify a fundamental disconnect: accuracy is not equivalent to productivity. Most code LLMs are trained on static "commit snapshots"—the final state of a code change. This training ignores the temporal, incremental process a human follows. When an AI suggests a change that is technically correct but "ill-timed" (e.g., jumping to a final implementation before defining the function signature), it breaks the developer's mental flow. This disruption forces the developer to context-switch, verify out-of-order logic, or even undo work, incurring a heavy "recovery tax" in terms of time and cognitive effort.

Methods

The authors propose a three-part framework to make AI assistants "flow-aware":

  1. Prompt Auto-Tuning: Since ground-truth data on the order of edits is rare, the authors developed a strategy to learn an optimized prompt. This prompt allows an LLM to look at two code edits and accurately infer which one should naturally come first based on cognitive continuity.
  2. Digital Twin Framework: To evaluate systems without constant human testing, they built a "digital twin" that replays reconstructed edit sequences. It simulates a developer’s trajectory, interacting with the AI at each step to see if the AI's suggestions align with the next logical step in the flow.
  3. EditFlow Optimization Wrapper: This is a post-processing layer that can be wrapped around existing tools (like Cursor or Claude Code). It uses the learned flow-awareness to filter out "flow-breaking" suggestions and re-rank the remaining ones to ensure they follow a natural progression.

The relationship between these components—recovery, evaluation, and optimization—is illustrated in the figure below:

Fig. 2. Relationships among the three problems.

Datasets

The study utilizes three distinct datasets to validate the approach:

  • Annotated Open-Source Dataset: 100 commits from top GitHub Python repositories, manually annotated by experts to establish ground-truth "flow" (772 edit hunks, 1,747 directed edges).
  • Industrial Dataset: A massive real-world dataset from an international IT firm with 60,000+ employees, consisting of 500 commits and over 3,000 edit hunks.
  • Large-Scale Simulation Benchmark: 500 open-source commits used to drive the digital twin simulations.

Key Insights and Ideas

  • The Flow Taxonomy: The authors categorize AI suggestions into four types: Keep (follows the flow), Jump (valid but skips steps), Revert (suggests undoing work), and Break (hallucinations). They found that in current systems, "Keep" edits—the ones that actually help—often make up less than 35% of suggestions.
  • Cognitive vs. Technical Order: A "flow-aligned" edit isn't just about what is syntactically required next. It's about what a human expects next. For example, in a cascading change (shown in Figure 1), a developer might naturally move from a function call to its signature, then to its implementation.
  • The "1-Context" Trap: A key failure mode identified was looking only at the very last edit to predict the next. Human flow often depends on a broader context of several prior steps.
Fig. 1. Motivating example: Edit partial order graph

Key Results

EditFlow demonstrated significant improvements across the board:

  • Accuracy: The auto-tuned prompt improved order reconstruction accuracy by 63.81% over standard few-shot baselines.
  • Flow Violations: On industrial data, EditFlow reduced flow violations by over 75%.
  • Precision: It boosted the precision of suggestions for state-of-the-art systems (Cursor, Claude Code) by an average of 66.99%.
  • Real-World Productivity: In a controlled study with 32 developers, those using EditFlow-enhanced tools completed tasks 25.11% faster and reported significantly higher perceived quality.

Limitations and Future Work

While powerful, EditFlow has a few hurdles:

  • Context Sensitivity: The current implementation sometimes suffers from "False Rejections" because it focuses heavily on the most recent edit (1-step context). Future versions could benefit from a wider "k-step" context window.
  • Intent Ambiguity: Sometimes a single edit could logically lead to multiple different paths. EditFlow currently struggles to distinguish between these valid but divergent "intent branches."
  • Latency: The optimization wrapper adds about 1.7 seconds of latency per query. While the authors argue this is below the threshold of human disruption, further engineering is needed to make it truly seamless.

Future work aims to incorporate more nuanced behavioral factors into the digital twin and explore multi-path simulations to better capture the diversity of human coding styles.

Summary updated

BibTeX
@article{liu2026editflow,
  author = {Chenyan Liu and Yun Lin and Jiaxin Chang and Jiawei Liu and Binhang Qi and Bo Jiang and Zhiyong Huang and Jin Song Dong},
  title = {{EditFlow: Benchmarking and Optimizing Code Edit Recommendation Systems via Reconstruction of Developer Flows}},
  journal = {Proc. ACM Program. Lang.},
  year = {2026},
  doi = {10.1145/3798249},
}
Figure