The growing adoption of formal verification for smart contracts has spurred the development of new verifiable languages like Move. However, the limited availability of training data for these languages hinders effective code generation by large language models (LLMs). This paper presents ConMover, a novel framework that enhances LLM-based code generation for Move by leveraging a knowledge graph of Move concepts and a small set of verified code examples. ConMover integrates concept retrieval, planning, coding, and debugging agents in an iterative process to refine generated code. Evaluations with various open-source LLMs demonstrate substantial accuracy improvements over baseline models. These results underscore ConMover's potential to address low-resource code generation challenges, bridging the gap between natural language descriptions and reliable smart contract development.
翻译:随着智能合约形式化验证的日益普及,Move等新型可验证语言得到了快速发展。然而,这些语言训练数据的匮乏限制了大型语言模型(LLMs)在代码生成方面的有效性。本文提出ConMover——一种创新框架,通过利用Move概念知识图谱与少量已验证代码示例,显著提升了基于LLM的Move代码生成能力。ConMover将概念检索、规划、编码和调试智能体集成于迭代流程中,持续优化生成代码。采用多种开源LLM进行的评估表明,该框架相较于基线模型实现了显著的准确率提升。这些结果印证了ConMover在应对低资源代码生成挑战方面的潜力,为弥合自然语言描述与可靠智能合约开发之间的鸿沟提供了有效途径。