一句话:EditFlow 从开发者心流视角基准测试并优化代码编辑推荐系统,显著提升顺序重构与推荐精度。
现有基于大语言模型的代码编辑推荐虽在基准上表现优异,却与开发者实际生产率脱节:使用 AI 辅助时任务完成反而慢 19%,68.81% 的推荐打断开发者心流。作者指出根源在于静态 commit 快照缺乏时序信息,模型只优化最终结果而非符合开发者推理习惯的增量编辑步骤。为此提出 EditFlow,通过重构开发者编辑流来评测与优化后续编辑推荐系统,包含三个紧耦合组件:(1) prompt 自动调优机制,学习推断两次编辑相对顺序的最优提示;(2) 数字孪生,回放重构的编辑序列以模拟开发者编辑过程;(3) 统一的优化策略,基于开发者当前编辑流优化后续编辑建议的流连续性。在人工标注 commit、真实工业代码与开源仓库等多类基准上,顺序重构准确率提升 63.81%,流违例减少逾 75%,推荐精度提升 66.99%;32 名开发者的用户研究显示任务完成快 25.11%,感知推荐质量显著更高。该工作首次从开发者心流角度评测与优化代码编辑推荐系统。
Large language models (LLMs) for code editing have achieved remarkable progress, yet recent empirical studies reveal a fundamental disconnect between technical accuracy and developer productivity . Despite their strong benchmark performance, developers complete tasks 19% slower when using AI assistance, with over 68.81% of recommendations disrupting their mental flow. This misalignment stems from the use of static commit snapshots that lack temporal information, causing models to optimize for end results rather than the incremental, context-sensitive steps that align with developers’ natural reasoning process. To bridge this gap, we present EditFlow , which benchmarks and optimizes subsequent code edit recommendation systems through the reconstruction of developer editing flows. EditFlow addresses three key challenges. First, collecting edit-order data that reflects developers’ flow is inherently difficult: manual annotation introduces prohibitive overhead, while development logs capture only single trajectories instead of all plausible editing flows. Second, benchmarking recommendation performance against developers’ ongoing editing flow requires a digital-twin-like simulation that can faithfully simulate the editing process. Third, existing heterogeneous systems vary drastically in scale and architecture, posing challenges for developing a unified optimization strategy that endows all models with mental-flow awareness regardless of design or capability. To overcome these challenges, we propose three tightly coupled components: (1) a prompt auto-tuning mechanism that learns an optimized prompt for inferring the relative order between two edits, (2) a digital twin that replays reconstructed edit sequences to simulate developers’ editing process, and (3) EditFlow , a unified optimization strategy that optimizes the flow continuity of subsequent edit suggestions based on developers’ ongoing flow. Evaluations across diverse benchmarks, including manually annotated commits, real-world industrial code, and open-source repositories, show that EditFlow improves order reconstruction accuracy by 63.81%, reduces flow violations by over 75%, and boosts recommendation precision by 66.99%. A user study with 32 developers further demonstrates 25.11% faster task completion and significantly higher perceived recommendation quality. To the best of our knowledge, EditFlow is the first to evaluate and optimize code edit recommendation systems from the perspective of developers’ mental flow, establishing flow-awareness as a new dimension for advancing human-AI code collaboration.
@article{paperbot3801,
title = {EditFlow: Benchmarking and Optimizing Code Edit Recommendation Systems via Reconstruction of Developer Flows},
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},
journal = {Proceedings of the ACM on Programming Languages},
volume = {10},
number = {OOPSLA1},
year = {2026},
doi = {10.1145/3798249}
}