用于合成 Gas 高效金融衍生品合约的课程引导强化学习
Curriculum-Guided Reinforcement Learning for Synthesizing Gas-Efficient Financial Derivatives Contracts
AI总结:
提出课程引导的 PPO 强化学习框架,直接由 CDM 规范生成功能正确且 Gas 优化的 Solidity 合约,最高降低 35.59% 成本。
摘要:
基于智能合约的金融衍生品自动化可带来显著的效率提升,但其在现实世界中的采用受到将金融规范转换为 Gas 高效可执行代码这一复杂性的限制。特别是,根据 Common Domain Model(CDM,通用领域模型)等高层规范生成既功能正确又经济可行的代码,仍然是一项重大挑战。本文提出一种强化学习(RL)框架,用于直接根据 CDM 规范生成功能完备且经过 Gas 优化的 Solidity 智能合约。我们采用 Proximal Policy Optimization(PPO,近端策略优化)智能体,该智能体学习从预定义代码库中选择最优代码片段。为管理复杂的搜索空间,两阶段课程首先训练智能体实现功能正确性,随后将其重点转向 Gas 优化。实验结果表明,该 RL 智能体能够学会生成具有显著 Gas 节省的合约,在未见过的测试数据上,与未优化基线相比成本降低最高达 35.59%。本工作为自动合成可靠且经济可持续的智能合约提供了一种可行方法,弥合了高层金融协议与高效链上执行之间的差距。
英文摘要:
Smart contract-based automation of financial derivatives offers substantial efficiency gains, but its real-world adoption is constrained by the complexity of translating financial specifications into gas-efficient executable code. In particular, generating code that is both functionally correct and economically viable from high-level specifications, such as the Common Domain Model (CDM), remains a significant challenge. This paper introduces a Reinforcement Learning (RL) framework to generate functional and gas-optimized Solidity smart contracts directly from CDM specifications. We employ a Proximal Policy Optimization (PPO) agent that learns to select optimal code snippets from a pre-defined library. To manage the complex search space, a two-phase curriculum first trains the agent for functional correctness before shifting its focus to gas optimization. Our empirical results show the RL agent learns to generate contracts with significant gas savings, achieving cost reductions of up to 35.59% on unseen test data compared to unoptimized baselines. This work presents a viable methodology for the automated synthesis of reliable and economically sustainable smart contracts, bridging the gap between high-level financial agreements and efficient on-chain execution.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。