用多个小型大模型协作翻译代码,效果媲美大型模型。
Collaboration is all you need: LLM Assisted Safe Code Translation
- 多个专注的微型大模型协同工作,分工处理翻译各环节。
- 在多种语言对上表现优异,尤其擅长低资源语言翻译。
- 通过自然语言推理和迭代反馈减少代码幻觉与错误。
本文提出UniTranslator,一种将代码翻译重构为多个小型大模型协作的新框架。通过协调专注于不同翻译环节的专用智能体,每个智能体基于对编程概念的深入理解,实现高精度与高效率,表现媲美大型单一模型。初步评估表明,该框架能突破现有方法局限,释放小型大模型在复杂代码翻译任务中的潜力。我们验证了该动态多智能体范式在处理多种语言对(包括低资源语言)的有效性,并通过自然语言推理(NLI)约束和迭代反馈机制,有效缓解代码伪影与幻觉问题。
原文摘要 · Abstract (English)
This paper introduces UniTranslator, a visionary framework that re-imagines code translation as a collaborative endeavor among multiple, compact LLMs. 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 mitigating common issues such as code artifacts and hallucinations through the use of Natural Language Inference (NLI) grounding and iterative feedback mechanisms
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。