EUVIMEDEUVIMED entdecken
Open Access · CC BY 4.0

Pig: Leveraging Large Language Models for Python Library Migrations

Miryeong Kang, Wonseok Oh, Gabin An, Hakjoo Oh

Proceedings of the ACM on Software Engineering · 30.06.2026 · 3 (FSE) · 967-988

DOI: 10.1145/3797072 ↗

Kurz gefasst

Fachartikel in der Zeitschrift Proceedings of the ACM on Software Engineering, online erschienen am 30.06.2026. Verfasst von Miryeong Kang und 3 weiteren Autor:innen. Die Arbeit nennt 50 Literaturangaben. Der Volltext ist frei zugänglich (Open Access, CC BY 4.0).

AbstractBibliografische AngabenZitierenVerwandte Studien

Abstract (Originalsprache)

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.

Zitieren

APA

Kang, M., Oh, W., An, G., & Oh, H. (2026). Pig: Leveraging Large Language Models for Python Library Migrations. Proceedings of the ACM on Software Engineering, 3(FSE), 967-988. https://doi.org/10.1145/3797072

Vancouver

Kang M, Oh W, An G, Oh H. Pig: Leveraging Large Language Models for Python Library Migrations. Proceedings of the ACM on Software Engineering. 2026;3(FSE):967-988. doi:10.1145/3797072

BibTeX
@article{Kang2026,
  author = {Kang, Miryeong and Oh, Wonseok and An, Gabin and Oh, Hakjoo},
  title = {Pig: Leveraging Large Language Models for Python Library Migrations},
  journal = {Proceedings of the ACM on Software Engineering},
  year = {2026},
  volume = {3},
  number = {FSE},
  pages = {967--988},
  doi = {10.1145/3797072}
}
Kostenlos starten →