What a diff makes: automating code migration with large language models

📅 2025-10-31
📈 Citations: 0
✨ Influential: 0
📄 PDF
🤖 AI Summary
Semantic version upgrades of software dependency libraries frequently break backward compatibility, necessitating automated code migration solutions. This paper proposes AIMigrate, an LLM-based migration method that innovatively incorporates version-diff information as critical contextual input to the LLM, substantially improving migration accuracy. To support this work, we construct and publicly release the first benchmark dataset specifically designed for code migration tasks, along with the end-to-end tool AIMigrate. Experimental results on real-world migration scenarios show that AIMigrate identifies 65% of necessary changes in a single inference pass and achieves 80% coverage under multiple sampling; among the generated changes, 47% are fully correct. Compared to baseline approaches using source code alone, the diff-augmented strategy consistently outperforms across multiple evaluation metrics.

Technology Category

Machine Learning: Large Multimodal Models (LMMs)Natural Language Processing: Code Generation / Program Synthesis from Natural LanguageComputer Vision: Diffusion Models for Vision

Application Category

Semantics and Knowledge: Methods to enhance, augment, integrate or synergize semantic models such as knowledge graphs and LLMsGraph Algorithms and Modeling for the Web: Foundation models and LLMs for Web-related graphsSearch and Retrieval-Augmented AI: Search Tool Learning with LLM: Teaching LLMs to invoke search and make use of retrieved information
📝 Abstract
Modern software programs are built on stacks that are often undergoing changes that introduce updates and improvements, but may also break any project that depends upon them. In this paper we explore the use of Large Language Models (LLMs) for code migration, specifically the problem of maintaining compatibility with a dependency as it undergoes major and minor semantic version changes. We demonstrate, using metrics such as test coverage and change comparisons, that contexts containing diffs can significantly improve performance against out of the box LLMs and, in some cases, perform better than using code. We provide a dataset to assist in further development of this problem area, as well as an open-source Python package, AIMigrate, that can be used to assist with migrating code bases. In a real-world migration of TYPHOIDSIM between STARSIM versions, AIMigrate correctly identified 65% of required changes in a single run, increasing to 80% with multiple runs, with 47% of changes generated perfectly.
Problem

Research questions and friction points this paper is trying to address.

Automating code migration using large language models
Maintaining compatibility during dependency version changes
Improving performance with diff contexts over standard LLMs
Innovation

Methods, ideas, or system contributions that make the work stand out.

Using LLMs with diff contexts for code migration
Providing dataset and AIMigrate package for automation
Achieving 65-80% accuracy in real-world migration tests
🔎 Similar Papers
2024-03-252024 IEEE/ACM First International Conference on AI Foundation Models and Software Engineering (Forge) Conference Acronym:Citations: 22
K
Katherine A. Rosenfeld
Institute for Disease Modeling, Gates Foundation
C
Cliff C. Kerr
Institute for Disease Modeling, Gates Foundation
J
Jessica Lundin
Institute for Disease Modeling, Gates Foundation