MASLM: Multi-Agent System for Library Migration
收藏Zenodo2026-03-31 更新2026-05-26 收录
下载链接:
https://zenodo.org/doi/10.5281/zenodo.19344705
下载链接
链接失效反馈官方服务:
资源简介:
MASLM: Multi-Agent System for LLM-based Software Library Migration
Overview
MASLM is an automated framework designed to assist developers in performing software library migration using Large Language Models (LLMs) and a structured multi-agent reasoning pipeline. The system focuses on identifying deprecated APIs, generating migration rationales, and transforming source code to maintain compatibility with evolving library versions.
Software libraries evolve rapidly. APIs are frequently deprecated, modified, or removed across versions, requiring developers to manually adapt their code. This process is time-consuming and error-prone, especially when migration knowledge is scattered across documentation, release notes, and community discussions.
MASLM addresses this challenge by decomposing the migration process into multiple coordinated reasoning stages. Instead of directly generating migrated code with a single LLM prompt, MASLM organizes the task into structured agents that collaborate to identify problematic APIs, explain migration decisions, and generate updated code.
This design improves migration reliability, reduces hallucinated API replacements, and enhances the interpretability of the migration process.
Key Features
Automated Library MigrationAutomatically identifies outdated APIs and updates them to compatible alternatives.
Multi-Agent Reasoning PipelineDecomposes migration tasks into multiple coordinated reasoning stages.
Explicit Migration RationalesGenerates explanations for API changes to improve interpretability.
Reduced HallucinationStructured reasoning reduces the likelihood of incorrect or fabricated API replacements.
Extensible ArchitectureThe system can be extended to support additional libraries, languages, and LLM backends.
Motivation
Library migration is a recurring maintenance task in modern software development. As libraries evolve, developers must continuously adapt their code to maintain compatibility with new versions. However, this process involves several challenges:
API Deprecation
Library maintainers frequently remove or modify APIs between versions. Developers must identify affected code segments and determine appropriate replacements.
Fragmented Migration Knowledge
Migration information is often distributed across release notes, documentation pages, issue discussions, and community forums. Extracting correct migration strategies requires significant manual effort.
Semantic Preservation
Replacing APIs is not simply a syntactic transformation. Developers must ensure that the updated implementation preserves the original program semantics.
LLM Hallucination
While LLMs are capable of generating code, directly prompting them for migration tasks can produce hallucinated APIs or incorrect transformations.
MASLM addresses these challenges by introducing a structured reasoning pipeline where each stage performs a specific responsibility in the migration workflow.
System Architecture
MASLM adopts a multi-agent architecture where specialized agents collaborate to complete the migration task.
The system decomposes the migration workflow into three primary stages:
1. API Localization Agent
The API Localization Agent analyzes the input source code and identifies API usages that may be incompatible with the target library version.
Responsibilities include:
parsing the source code
detecting deprecated APIs
locating migration points within the program
2. Migration Rationale Agent
The Migration Rationale Agent generates explanations for why an API must be replaced and suggests appropriate migration strategies.
Responsibilities include:
interpreting API evolution
explaining compatibility issues
proposing suitable replacement APIs
3. API Transformation Agent
The API Transformation Agent performs the final code transformation by replacing deprecated APIs with compatible alternatives.
Responsibilities include:
generating updated code
preserving original program semantics
ensuring syntactic correctness
This staged reasoning architecture improves both the reliability and transparency of the migration process.
Migration Pipeline
The MASLM migration workflow consists of the following steps:
Input Code AnalysisThe system receives the original source code and the target library version.
Deprecated API DetectionThe API Localization Agent identifies incompatible API usages.
Migration Knowledge GenerationThe Migration Rationale Agent generates explanations and migration strategies.
Code TransformationThe API Transformation Agent rewrites the code using compatible APIs.
Result ValidationThe transformed code is verified for syntactic and logical consistency.
This pipeline ensures that migration decisions are based on structured reasoning rather than direct code generation.
Repository Structure
MASLM/
│
├── ablation/ # Ablation output
├── agent/ # Multi-agent implementations
├── ast_pre/ # AST_Preprocessing
├── input_dataset/ # Benchmark_data
├── output_dataset/ # MASLM result
├── prompt/ # Prompt templates used by agents
├── tmp/ # Task_3 environment
├── filter.py # Entry point of Task_3
├── run.py # Entry point of MASLM
├── utils.py # Python script
└── requirements/ # Python dependencies from CODEMENV: Benchmarking Large Language Models on Code Migration
提供机构:
Zenodo创建时间:
2026-03-31



