一句话:UniTranslator 让多个小型 LLM 智能体协作完成代码翻译,效果媲美大型单体模型并减少幻觉。
本文提出 UniTranslator,一个使用多个紧凑型 LLM 协同工作的代码翻译框架。其核心思想是通过编排多个专门化智能体的交互,让每个智能体聚焦翻译流程的不同方面,并基于对编程概念的深入理解来提升翻译质量。与依赖大型单体模型的既有方法相比,UniTranslator 旨在用小模型达到相近甚至相当的准确率与效率。作者进行了初步评估,考察该动态多智能体范式在多种语言对(包括低资源语言)上的表现,并利用自然语言推理(NLI)与迭代反馈来抑制代码伪影和幻觉等常见错误。结果表明,这一协作范式有望突破现有方法的局限,释放小型 LLM 在复杂代码翻译任务中的潜力。
This paper introduces UniTranslator, a framework, that uses multiple, compact LLMs working together for code translation. By orchestrating the interaction of specialized agents, each focused on different aspects of the translation process and grounded in a deep understanding of programming concepts, UniTranslator achieves a level of accuracy and efficiency that rivals larger, monolithic models. Our preliminary evaluation demonstrates the potential of UniTranslator to overcome the limitations of existing approaches and unlock the power of smaller LLMs for complex code translation tasks. We explore the effectiveness of this dynamic multi-agent paradigm in handling diverse language pairs, including low-resource languages, and in reducing common errors like code artifacts and hallucinations using Natural Language Inference (NLI) and iterative feedback.