SEAIMar 13, 2024

Teaching Machines to Code: Smart Contract Translation with LLMs

arXiv:2403.09740v111 citationsh-index: 7AIware
Originality Incremental advance
AI Analysis

This addresses the challenge of smart contract translation for blockchain developers, but it is incremental as it builds on existing LLM capabilities for code translation.

The paper tackles the problem of translating smart contracts from Solidity to Move, a language with limited resources, by introducing SolMover, a framework that uses two LLMs to grasp coding principles and apply them to unfamiliar languages. The result shows that SolMover substantially enhances performance over gpt-3.5-turbo-1106 and achieves superior results compared to competitors like Palm2 and Mixtral-8x7B-Instruct, with a bug mitigation strategy improving code quality across models.

The advent of large language models (LLMs) has marked a significant milestone in the realm of artificial intelligence, with their capabilities often matching or surpassing human expertise in various domains. Among these achievements, their adeptness in translation tasks stands out, closely mimicking the intricate and preliminary processes undertaken by human translators to ensure the fidelity and quality of the translated content. Despite the advancements in utilizing LLMs for translating programming code across different languages, the domain of smart contract translation, particularly into languages not previously encountered by the LLM, remains largely unexplored. In our research, we present a pioneering approach, SolMover, which harnesses the synergy of two distinct LLMs within a unified framework. This framework is designed to grasp coding principles and apply this understanding to the translation of code into an unfamiliar language. Our study delves into the capacity of LLMs to mimic human learning processes, offering an in-depth evaluation of our methodology for converting smart contracts written in Solidity to Move, a language with limited resources. The framework employs one LLM to decipher coding conventions for the new language, creating a blueprint for the second LLM, which, lacking planning abilities, possesses coding expertise. The empirical evidence from our experiments suggests that SolMover substantially enhances performance compared to gpt-3.5-turbo-1106, and achieves superior results over competitors such as Palm2 and Mixtral-8x7B-Instruct. Additionally, our analysis highlights the efficacy of our bug mitigation strategy in elevating code quality across all models, even outside the SolMover framework.

Foundations

The foundational work for this paper's niche, ranked by how specifically the neighbourhood builds on it — not by global fame.

Your Notes