我无法共享代码,但我需要翻译——基于联邦大语言模型的代码翻译实证研究
I Can't Share Code, but I need Translation -- An Empirical Study on Code Translation through Federated LLM
AI总结:
本文提出基于联邦大语言模型的代码翻译方法,使多方在不共享敏感代码的情况下协同训练 C# 与 Java 翻译器,CodeBLEU 较独立模型提升超 40%。
摘要:
由于技术和项目需求的快速演进,各组织需要将其软件项目中的代码库升级到编程语言的新版本,甚至翻译为一种全新的语言。然而,代码翻译是资源密集型工作,并且需要同时具备源语言和目标语言的专业知识。尽管研究人员在自动化传统语言与现代语言之间的翻译方面已取得进展,但近期工作越来越多地转向使用预训练大语言模型(LLM)来高效完成翻译。鉴于代码的专有性质,各组织更倾向于在本地微调 LLM,而不是依赖外部 API。本文是最早提出基于联邦 LLM 的代码翻译方法的实证研究之一。所提出的方法使客户端能够在不共享敏感数据的情况下联合训练代码翻译器。本研究表明,参与者可以协作开发用于高效代码翻译的 FedLLM(尤其是 C# 与 Java 之间的双向翻译),并取得优于各客户端独立模型的结果(CodeLLaMA 的 CodeBLEU 分数提升超过 40%)。我们的研究结果表明,FedLLM 提供了一种协作式代码翻译方法,并可成为该领域未来研究中一个有前景的方向。
英文摘要:
Owing to the rapid evolution of technologies and project requirements, organizations need to upgrade the code base in their software projects to a new version of the programming language or even translating to an entirely new one. However, code translation is resource-intensive and requires expertise in both the source and target languages. While researchers have made progress in automating translations between legacy and modern languages, recent work has increasingly turned to pre-trained Large Language Models (LLMs) to translate efficiently. Given the proprietary nature of code, organizations prefer fine-tuning LLMs locally rather than relying on external APIs. This is one of the first empirical studies that proposes a Federated LLM-based approach for code translation. The proposed approach enables clients to jointly train a code translator without sharing sensitive data. This study demonstrates that participants can collaboratively develop a FedLLM for efficient code translation (particularly C\# to Java and vice-versa) with superior results (more than 40\% improvement in CodeLLaMA's CodeBLEU score) compared to individual client models. Our findings indicate that FedLLM offers a collaborative approach to code translation and could serve as a promising direction for future research in this field.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。