Neural-guided superoptimization in ethereum

Superoptimization is a synthesis technique that, given a loop-free sequence of instructions, searches for an equivalent sequence that is optimal wrt. an objective function. Superoptimization of Ethereum smart contracts aims at minimizing the size of their bytecode and the gas consumption of executing the contract’s functions. The search for the optimal solution poses huge computational demands –as the search space to find the optimal sequence is exponential on the given size-bound – being the main challenge for superoptimization today to scale up to real, industrial software. Even if the underlying problem for finding the optimal solution is decidable, practical tools often prioritize efficiency over completeness. This means they might be implemented to find a sub-optimal solution or even time out. This work aims at leveraging superoptimization to a real setting: Ethereum blockchain. This paper proposes a neural-guided superoptimization (NGS) approach which incorporates deep neural networks using (supervised) learning into superoptimization to improve scalability by predicting: (1) if a sequence is already optimal and hence the search can be skipped; (2) the size-bound for the optimal solution in order to reduce the search space. We have downloaded over 13,000 smart contracts deployed on the blockchain for training and testing the machine learning models, and a disjoint set with 100 of the smart contracts with more transactions to prove our scalability gains and impact for the Ethereum community. Incorporating DNNs resulted in a 16x overall speedup (12x for gas) with only 12% optimization loss (14% for gas), or a 3-4x speedup with no optimization loss. For the 100 analyzed contracts, this approach reduced the average compilation time to 3 min per contract and achieved monetary savings of $1.24M. The integration of machine learning models mitigates several limitations of traditional superoptimization by drastically reducing execution times while maintaining most of the original optimization gains. • We present a neural-guided superoptimization framework, integrating ML techniques. • We build a classifier that predicts if a sequence of opcodes is already optimal. • We introduce a regression model to infer a bound for the size of the optimal solution. • We enhance a superoptimization algorithm for smart contracts to speed up the search. • We evaluate its impact on 100 of the most-used smart contracts deployed on Ethereum.

Authors

Institutions

Publication Details

Journal
Information and Software Technology
Published
2025-06-16
DOI
https://doi.org/10.1016/j.infsof.2025.107800
Citations
1
Primary Topic
Neural Networks and Applications
Type
article
Field-Weighted Citation Impact
2.48
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
article

Neural-guided superoptimization in ethereum

Pablo Gordillo, Maria S. Aguiar, Samir Genaim, Albert Rubio et al.
1 citations
Information and Software Technology
Neural Networks and Applications
2.48
article

Neural-guided superoptimization in ethereum

Pablo Gordillo, Maria S. Aguiar, Samir Genaim, Albert Rubio, Alejandro Hernández-Cerezo, Daniel Kirchner, Elvira Albert
article en
1 citations

Abstract

Superoptimization is a synthesis technique that, given a loop-free sequence of instructions, searches for an equivalent sequence that is optimal wrt. an objective function. Superoptimization of Ethereum smart contracts aims at minimizing the size of their bytecode and the gas consumption of executing the contract’s functions. The search for the optimal solution poses huge computational demands –as the search space to find the optimal sequence is exponential on the given size-bound – being the main challenge for superoptimization today to scale up to real, industrial software. Even if the underlying problem for finding the optimal solution is decidable, practical tools often prioritize efficiency over completeness. This means they might be implemented to find a sub-optimal solution or even time out. This work aims at leveraging superoptimization to a real setting: Ethereum blockchain. This paper proposes a neural-guided superoptimization (NGS) approach which incorporates deep neural networks using (supervised) learning into superoptimization to improve scalability by predicting: (1) if a sequence is already optimal and hence the search can be skipped; (2) the size-bound for the optimal solution in order to reduce the search space. We have downloaded over 13,000 smart contracts deployed on the blockchain for training and testing the machine learning models, and a disjoint set with 100 of the smart contracts with more transactions to prove our scalability gains and impact for the Ethereum community. Incorporating DNNs resulted in a 16x overall speedup (12x for gas) with only 12% optimization loss (14% for gas), or a 3-4x speedup with no optimization loss. For the 100 analyzed contracts, this approach reduced the average compilation time to 3 min per contract and achieved monetary savings of $1.24M. The integration of machine learning models mitigates several limitations of traditional superoptimization by drastically reducing execution times while maintaining most of the original optimization gains. • We present a neural-guided superoptimization framework, integrating ML techniques. • We build a classifier that predicts if a sequence of opcodes is already optimal. • We introduce a regression model to infer a bound for the size of the optimal solution. • We enhance a superoptimization algorithm for smart contracts to speed up the search. • We evaluate its impact on 100 of the most-used smart contracts deployed on Ethereum.

Information and Software TechnologyVol. 186
Universidad Complutense de Madrid (ES), University of Bamberg (DE)
Openalex Percentile: Top 10%
Neural Networks and Applications
2.48
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.