The paper introduces ML2SC, a tool that can automatically translate Multi-Layer Perceptron (MLP) models written in PyTorch to Solidity smart contracts. This allows deploying ML models on the blockchain, ensuring transparency and verifiability of the model inference process.
The key highlights are:
ML2SC uses a fixed-point math library (PRBMath) to approximate floating-point computations in Solidity, enabling identical performance to the original off-chain PyTorch models.
The paper provides a detailed mathematical modeling of the gas costs associated with deploying, updating, and running inference on the on-chain MLP models. The gas costs are shown to increase linearly with various model architecture parameters.
Empirical results are presented, validating the accuracy parity between the on-chain Solidity models and the off-chain PyTorch implementations. The gas cost experiments also match the proposed mathematical models.
The authors offer ML2SC as an open-source tool to bridge the gap between theoretical ML models and their real-world deployment on blockchain platforms, contributing to the ongoing research in this field.
To Another Language
from source content
arxiv.org
Thông tin chi tiết chính được chắt lọc từ
by Zhikai Li,St... lúc arxiv.org 04-29-2024
https://arxiv.org/pdf/2404.16967.pdfYêu cầu sâu hơn