Python Library Migration with LLMs: Paper Accepted at FSE'26 🇨🇦
Our joint work with the SAL Lab (led by Prof. Hakjoo Oh), “Pig: Leveraging Large Language Models for Python Library Migrations,” has been accepted to FSE 2026, to be held in Montreal, Canada 🇨🇦.
Pig introduces a novel approach to automating Python library migration using large language models (LLMs). Although library migration is a routine task in modern Python development, existing LLM-based solutions often suffer from brittleness, frequent errors, and heavy reliance on documentation or example code.
To address these limitations, Pig adopts a structured four-step pipeline:
- decomposing migration tasks at the API level to minimize irrelevant context,
- guiding LLMs with prompts informed by common failure patterns and plausible API candidates,
- selectively extracting migration-relevant code from LLM outputs, and
- reintegrating the migrated code into the original program with post-processing to ensure semantic correctness.
In an evaluation on 364 API-level migration tasks, Pig improves the average success rate of baseline approaches by 53.5% across seven different LLMs.
📄 Preprint to appear soon. Stay tuned!