paperbot · PL 论文追踪

全部论文 待读 收藏

P1 PYEVOLVE: Automating Frequent Code Changes in Python ML Systems

PYEVOLVE:自动化 Python 机器学习系统中的频繁代码变更
ICSE 2023 IEEE/ACM 45th International Conference on Software Engineering (ICSE)2023匹配度 6/10 · 论文将数据流/控制流分析用于 Python ML 系统的代码变换规则推断与自动移植,属于将程序分析技术应用于 ML 系统,与“PL→AI”方向部分吻合;但不涉及 LLM/Agentic 程序、浮点程序分析或贝叶斯程序分析,因此不是研究方向的核心。引用 23 inbox
Malinda Dilhara, Danny Dig, Ameya Ketkar
crossref: 2026-09-12dblp: 2026-09-12

AI 速览

一句话:提出数据流/控制流感知的变换规则推断引擎,自动挖掘、推断并移植 Python ML 系统中的频繁代码变更。

由于软件的自然性和机器学习技术快速演进,Python ML 系统中频繁出现重复代码变更模式(CPAT),从简单 API 迁移到涉及 for 循环等复杂控制结构。人工执行繁琐,而现有变换规则推断方法难以处理未见过的复杂 CPAT 变体,召回率低。本文提出自动化工作流:挖掘 CPAT、推断变换规则并自动移植到新目标位置,并实现工具 PYEVOLVE。其核心是数据流与控制流感知的变换规则推断引擎。在超过 40,000 个变换上的评估达到 97% 精确率和 94% 召回率;若无该引擎,70% 的代码变更无法自动化;在知名开源项目中开发者接受 90% 的 PYEVOLVE 生成 CPAT。

问题
如何自动推断可处理未见复杂变体的频繁代码变更模式(CPAT)变换规则,并将其移植到新目标位置,以减轻 Python ML 系统中重复手工修改的负担。
方法
设计数据流与控制流感知的变换规则推断引擎,构建从挖掘 CPAT、推断规则到自动移植的自动化工作流,并实现工具 PYEVOLVE。
评估
在超过 40,000 个变换上评估精确率 97%、召回率 94%,并报告开发者对知名开源项目中 90% 生成 CPAT 的接受情况,以及无该引擎时 70% 变换无法自动化的消融结果。
原文摘要(Abstract)

Because of the naturalness of software and the rapid evolution of Machine Learning (ML) techniques, frequently repeated code change patterns (CPATs) occur often. They range from simple API migrations to changes involving several complex control structures such as for loops. While manually performing CPATs is tedious, the current state-of-the-art techniques for inferring transformation rules are not advanced enough to handle unseen variants of complex CPATs, resulting in a low recall rate. In this paper we present a novel, automated workflow that mines CPATs, infers the transformation rules, and then transplants them automatically to new target sites. We designed, implemented, evaluated and released this in a tool, PYEVOLVE. At its core is a novel data-flow, control-flow aware transformation rule inference engine. Our technique allows us to advance the state-of-the-art for transformation-by-example tools; without it, 70% of the code changes that PYEVOLVE transforms would not be possible to automate. Our thorough empirical evaluation of over 40,000 transformations shows 97% precision and 94% recall. By accepting 90% of CPATs generated by PYEVOLVE in famous open-source projects, developers confirmed its changes are useful.

链接与引用

DOI 原文 · PDF(开放获取) · DBLP

BibTeX
@inproceedings{DilharaDK23,
  title = {PYEVOLVE: Automating Frequent Code Changes in Python ML Systems},
  author = {Malinda Dilhara and Danny Dig and Ameya Ketkar},
  booktitle = {ICSE},
  year = {2023},
  doi = {10.1109/icse48619.2023.00091}
}