ETLGMar 8, 2025

Generation of Optimized Solidity Code for Machine Learning Models using LLMs

arXiv:2503.06203v14 citationsh-index: 34ICBC
Originality Incremental advance
AI Analysis

This enables verifiable ML code execution on blockchains, addressing a gap for decentralized applications, though it appears incremental as it builds on existing LLM and blockchain technologies.

The authors tackled the problem of deploying machine learning models on public blockchains by developing LMST, a method that uses Large Language Models to convert ML inference paths and weights into optimized Solidity code, demonstrating feasibility through experiments.

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.

Foundations

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

Your Notes