杂乱代码让机器学习流水线管理难?让大语言模型重写代码就行!
Messy Code Makes Managing ML Pipelines Difficult? Just Let LLMs Rewrite the Code!
AI总结:
针对数据科学家编写的杂乱命令式ML代码难以适配声明式流水线管理抽象的问题,提出利用LLMs将代码重写为定制声明式抽象的方案,原型Lester在增量视图维护合规场景中验证了可行性。
摘要:
从数据中学习的机器学习(ML)应用正越来越多地用于自动化高影响力决策。遗憾的是,这类应用往往未能充分管理关键数据,也无法满足即将出台的法规要求。这些问题持续存在的一个技术原因是,常见机器学习库与云服务中的数据流水线缺乏基础的声明式、以数据为中心的抽象。近期研究已表明这类抽象如何支撑溯源追踪、自动检查等技术,以助力管理机器学习流水线。但这些方法在现实中未得到广泛采用,因为它们需要用声明式API编写的整洁机器学习流水线代码,而非数据科学家通常为数据准备编写的杂乱命令式Python代码。\n我们认为,指望数据科学家改变其既定开发习惯是不现实的。为此,我们提出利用大语言模型(LLMs)的代码生成能力来绕过这一“代码抽象鸿沟”。我们的思路是将杂乱的数据科学代码重写为定制化的声明式流水线抽象,并在原型系统Lester中实现了概念验证。我们详细介绍了其在一个具有挑战性的合规管理场景中的应用,该场景涉及已部署机器学习流水线的“增量视图维护”。针对我们的运行示例的代码重写结果,展现了大语言模型将杂乱数据科学代码声明式化的潜力,例如识别Python中手动编码的连接操作并将其转换为数据帧上的连接,或是从NumPy代码生成声明式特征编码器。
英文摘要:
Machine learning (ML) applications that learn from data are increasingly used to automate impactful decisions. Unfortunately, these applications often fall short of adequately managing critical data and complying with upcoming regulations. A technical reason for the persistence of these issues is that the data pipelines in common ML libraries and cloud services lack fundamental declarative, data-centric abstractions. Recent research has shown how such abstractions enable techniques like provenance tracking and automatic inspection to help manage ML pipelines. Unfortunately, these approaches lack adoption in the real world because they require clean ML pipeline code written with declarative APIs, instead of the messy imperative Python code that data scientists typically write for data preparation. We argue that it is unrealistic to expect data scientists to change their established development practices. Instead, we propose to circumvent this "code abstraction gap" by leveraging the code generation capabilities of large language models (LLMs). Our idea is to rewrite messy data science code to a custom-tailored declarative pipeline abstraction, which we implement as a proof-of-concept in our prototype Lester. We detail its application for a challenging compliance management example involving "incremental view maintenance" of deployed ML pipelines. The code rewrites for our running example show the potential of LLMs to make messy data science code declarative, e.g., by identifying hand-coded joins in Python and turning them into joins on dataframes, or by generating declarative feature encoders from NumPy code.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。