Generation of Optimized Solidity Code for Machine Learning Models using LLMs
While a plethora of machine learning (ML) models are currently available, along with their implementation on disparate platforms, there is hardly any verifiable ML code which can be executed on public blockchains. We propose a novel approach named LMST that enables conversion of the inferencing path of an ML model as well as its weights trained off-chain into Solidity code using Large Language Models (LLMs). Extensive prompt engineering is done to achieve gas cost optimization beyond mere correctness of the produced code, while taking into consideration the capabilities and limitations of the Ethereum Virtual Machine. We have also developed a proof of concept decentralized application using the code so generated for verifying the accuracy claims of the underlying ML model. An extensive set of experiments demonstrate the feasibility of deploying ML models on blockchains through automated code translation using LLMs.
Code (0)
등록된 구현이 없습니다.
Tasks
Code TranslationPrompt EngineeringMethods 이 논문이 사용한 방법론
Similar Papers 제목 키워드 기반
PRIMG : Efficient LLM-driven Test Generation Using Mutant Prioritization
Mutation testing is a widely recognized technique for assessing and enhancing the effectiveness of software test suites by introducing deliberate code mutations. However, its application often results in overly large tes…
A Multi-Agent Framework for Automated Vulnerability Detection and Repair in Solidity and Move Smart Contracts
The rapid growth of the blockchain ecosystem and the increasing value locked in smart contracts necessitate robust security measures. While languages like Solidity and Move aim to improve smart contract security, vulnera…
Vulnerability DetectionSolBench: A Dataset and Benchmark for Evaluating Functional Correctness in Solidity Code Completion and Repair
Smart contracts are crucial programs on blockchains, and their immutability post-deployment makes functional correctness vital. Despite progress in code completion models, benchmarks for Solidity, the primary smart contr…
Code CompletionCode RepairRetrievalAn Empirical Study of AI-based Smart Contract Creation
The introduction of large language models (LLMs) like ChatGPT and Google Palm2 for smart contract generation seems to be the first well-established instance of an AI pair programmer. LLMs have access to a large number of…
Code GenerationSCDBench: A Benchmark for LLM-Based Smart Contract Decompilers
Smart contract decompilation aims to recover high-level source code from bytecode, but evaluating decompilers remains difficult because existing studies use narrow datasets, inconsistent metrics, and limited semantic con…