跳至主導覽 跳至搜尋 跳過主要內容

LPFGen: Smart Contract Generation with Prompt-Guided and Fine-Tuned LLMs

  • Lixue Liu
  • , Wei Ke
  • , Haiyang Chi
  • Macao Polytechnic University

研究成果: Conference contribution › 同行評審

摘要

Smart contracts enable autonomous blockchain applications but remain difficult to implement securely and efficiently. We present LPFGen, a prompt–plus–fine-tuning framework for automated contract synthesis with large language models (LLMs). Our approach leverages Qwen3-8B with LoRA adapters, trained on a mixed corpus of 141,000 contract–prompt pairs and 6,003 masked-function repair samples, providing a reproducible and efficient PEFT recipe. Evaluation across 100 user-style specifications combines usability screening, compilation success, and static analysis, along with held-out repair and detection tasks. Results show that LPFGen raises the proportion of usable generations from 58.3% to 78.2%, while also improving detection and repair performance (F1 from 0.376 to 0.613; Accuracy from 0.696 to 0.787). These consistent gains indicate clear improvements in generation quality and reliability over untuned baselines. By integrating prompt design with targeted fine-tuning, LPFGen demonstrates that principled adaptation of LLMs can yield secure, verifiable, and practically deployable smart contracts. All code and experiment scripts are released to support reproducibility and further research.

原文English
主出版物標題Blockchain Technology and Applications - Proceedings of 2025 8th International Conference on Blockchain Technology and Applications
編輯Ruidong Li
發行者Springer Science and Business Media Deutschland GmbH
頁面409-418
頁數10
ISBN(列印)9783032220875
DOIs
出版狀態Published - 2026
事件8th International Conference on Blockchain Technology and Applications, ICBTA 2025 - Kanazawa, Japan
持續時間: 12 12月 2025 → 14 12月 2025

出版系列

名字Lecture Notes in Networks and Systems
卷1920 LNNS
ISSN(列印)2367-3370
ISSN(電子)2367-3389

Conference

Conference8th International Conference on Blockchain Technology and Applications, ICBTA 2025
國家/地區Japan
城市Kanazawa
期間12/12/25 → 14/12/25

指紋

深入研究「LPFGen: Smart Contract Generation with Prompt-Guided and Fine-Tuned LLMs」主題。共同形成了獨特的指紋。

引用此