Pig: Leveraging Large Language Models for Python Library Migrations

Python(编程语言) 计算机科学 正确性 程序设计语言 文档 源代码 麻省理工许可证 管道(软件) 软件工程 任务(项目管理) 万维网 单元测试 编码(集合论) 源代码行 自然语言处理 人工智能 开源
作者
Miryeong,Wonseok Oh,Gabin An,Hakjoo Oh
出处
期刊: [Association for Computing Machinery]
卷期号:3 (FSE): 967-988
标识
DOI:10.1145/3797072
摘要

We present Pig, a novel approach to automating Python library migration by leveraging large language models (LLMs). Library migration is an increasingly common task in modern Python development, yet it remains tedious and error-prone due to the lack of general solutions that can handle diverse libraries without relying on documentation or code examples. To address this challenge, Pig employs a four-step pipeline that effectively harnesses the capabilities of LLMs. First, Pig decomposes the migration task into smaller units by performing API-level slicing, allowing the LLM to focus on minimal, relevant context. Second, it guides LLMs using prompts informed by common failure patterns in naive LLM-based migrations and plausible API candidates. Third, Pig selectively extracts the migration-related code fragments from the LLM outputs. Finally, it transplants the migrated code back into the original program with post-processing to ensure semantic correctness and consistency. We demonstrate the effectiveness of Pig by evaluating it on 364 API-level migration tasks, where it improves the average success rate of the baseline approach by 53.5% across seven different LLM models.
最长约 10秒,即可获得该文献文件

科研通智能强力驱动
Strongly Powered by AbleSci AI
科研通是完全免费的文献互助平台,具备全网最快的应助速度,最高的求助完成率。 对每一个文献求助,科研通都将尽心尽力,给求助人一个满意的交代。
实时播报
粥丫丫丫丫完成签到,获得积分10
刚刚
1秒前
Owen应助harvey1989采纳,获得10
2秒前
lilray完成签到,获得积分10
2秒前
杨哈哈完成签到,获得积分10
2秒前
Super发布了新的文献求助30
3秒前
领导范儿应助柚子宝宝采纳,获得10
4秒前
5秒前
章铭-111完成签到 ,获得积分10
5秒前
高高发布了新的文献求助10
5秒前
icy发布了新的文献求助10
5秒前
WZMZARD关注了科研通微信公众号
7秒前
Hart发布了新的文献求助10
7秒前
7秒前
8秒前
神秘奇男子完成签到,获得积分10
8秒前
诸军则应助cliff采纳,获得10
8秒前
chen完成签到,获得积分10
9秒前
大模型应助mxy126354采纳,获得100
10秒前
10秒前
man发布了新的文献求助10
11秒前
11秒前
11秒前
11秒前
稳重的无招完成签到,获得积分10
13秒前
Yolanda发布了新的文献求助160
13秒前
13秒前
14秒前
14秒前
14秒前
harvey1989完成签到,获得积分10
14秒前
mj发布了新的文献求助10
14秒前
小白完成签到,获得积分10
14秒前
柚子宝宝发布了新的文献求助10
14秒前
简单海露应助阳光采纳,获得10
14秒前
15秒前
LiXF发布了新的文献求助10
15秒前
852应助....采纳,获得10
16秒前
燕子应助半糖糖采纳,获得10
17秒前
17秒前
高分求助中
(应助此贴封号)【重要!!请各用户(尤其是新用户)详细阅读】【科研通的精品贴汇总】 10000
HYDROLYSE ACIDE DE QUELQUES DIOXASPIROCYCLANES 1314
Essentials of Carbohydrate Chemistry and Biochemistry, 4th Edition 800
Navigating Normative Orders. Interdisciplinary Perspectives 800
1 Peter and Christ's Descent to the Dead in Its Early Christian Reception 700
Organizational Behavior 510
Management and the Arts 510
热门求助领域 (近24小时)
化学 材料科学 医学 生物 纳米技术 工程类 有机化学 化学工程 生物化学 计算机科学 内科学 物理 复合材料 催化作用 细胞生物学 无机化学 光电子学 物理化学 电极 基因
热门帖子
关注 科研通微信公众号,转发送积分 7749370
求助须知:如何正确求助?哪些是违规求助? 9297188
关于积分的说明 20239045
捐赠科研通 7330737
什么是DOI,文献DOI怎么找? 3309129
关于科研通互助平台的介绍 2460794
邀请新用户注册赠送积分活动 2321412