arXiv:2512.13515cs.SEcs.CL2025-12被引 5

用微调大模型实现跨数据库代码精准迁移,提升自动化水平

Fine-tuned LLM-based Code Migration Framework

  • 结合微调LLM与提示工程,实现SQL语法精准映射
  • 语法错误率显著降低,多轮迭代中特征对齐度提升
  • 适合需要高精度数据库迁移的开发者与企业

本研究针对SQL系统迁移中的挑战,提出一种基于微调大语言模型的自动化代码库迁移框架。该方法融合传统软件工程方法,通过迭代、可扩展、精确且高效的流程,解决从Oracle PL/SQL向PostgreSQL迁移时的语法映射、存储过程、触发器、视图及整体逻辑差异问题。核心在于利用微调后的LLM增强适配性与兼容性。实验采用目标评估方法与计算指标衡量多轮转换效果,创新包括自动检测SQL特性、半监督错误分析及引入领域专家反馈的系统化工作流。结果表明,微调在迁移中起关键作用,显著降低语法错误率,提升特征一致性,并通过数据采样实现持续优化。通过嵌入生成式AI,实现精准特征映射、半自动错误修复与数据驱动优化循环,有效提升迁移效率。

原文摘要 · Abstract (English)

The study presents the outcomes of research and experimental validation in the domain of automated codebase migration, with a focus on addressing challenges in transitioning SQL-based systems. The proposed method for migration essentially appears as a framework that leverages the best aspects of traditional software engineering techniques and provides an iterative, scalable, precise and efficient solution for modern database transformations. The central piece of the approach is the integration of a fine-tuned Large Language Model to address critical issues in SQL code conversion, such as syntax mapping, resolving discrepancies between Oracle PL/SQL and PostgreSQL, and optimising database elements such as stored procedures, triggers, views, and overall database logic. Thus, the method involves a trade-off between fine-tuning and prompt engineering. Special attention is given to a fine-tuning approach, which enhances the adaptability and compatibility with migration requirements across the entire database. According to the achieved results, fine-tuning plays a very important role. The study employs targeted evaluation methodologies along with computational metrics to measure the success of iterative conversion cycles. Core innovations include automated SQL feature detection, semi-supervised error analysis and integration of Subject Matter Experts feedback within a systematic migration workflow. The methodology achieves significant reductions in Syntax Error Rates, enhances feature alignment throughout migration iterations, and leverages dataset sampling to ensure continual improvement. By embedding GAI into the migration process, the framework facilitates precise feature mapping, semi-automated error resolution, and data-driven optimisation loops, improving workflow efficiency.

代码迁移大模型应用数据库自动化

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。