Table of Contents
Fetching ...

Generating Move Smart Contracts based on Concepts

Rabimba Karanjai, Sam Blackshear, Lei Xu, Weidong Shi

TL;DR

ConMover tackles low-resource Move code generation by marrying a Move knowledge graph with a multi-agent, iterative planning and debugging pipeline. It leverages concept generation, planning, coding, and plan-aware debugging to refine code, guided by a small set of verified Move examples and a RAG-based validator. Experiments show substantial improvements across open-source LLMs, with notable gains for smaller models, highlighting data-efficient code generation for low-resource languages. The framework offers a scalable, self-improving approach to bridging natural language and reliable smart contract development without large-scale pre-training.

Abstract

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.

Generating Move Smart Contracts based on Concepts

TL;DR

ConMover tackles low-resource Move code generation by marrying a Move knowledge graph with a multi-agent, iterative planning and debugging pipeline. It leverages concept generation, planning, coding, and plan-aware debugging to refine code, guided by a small set of verified Move examples and a RAG-based validator. Experiments show substantial improvements across open-source LLMs, with notable gains for smaller models, highlighting data-efficient code generation for low-resource languages. The framework offers a scalable, self-improving approach to bridging natural language and reliable smart contract development without large-scale pre-training.

Abstract

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.

Paper Structure

This paper contains 26 sections, 2 equations, 4 figures, 2 tables.

Figures (4)

  • Figure 1: Concept Generation
  • Figure 2: Planning Agent
  • Figure 3: Feedback Loop
  • Figure 4: Template