SCLA: Automated Smart Contract Summarization via LLMs and Control Flow Prompt
Xiaoqi Li, Yingjie Mao, Zexin Lu, Wenkai Li, Zongwei Li

TL;DR
SCLA is a novel method that enhances smart contract summarization by integrating control flow graphs and semantic facts into LLM prompts, significantly improving accuracy over existing models.
Contribution
This paper introduces SCLA, which combines control flow analysis with semantic enrichment to improve LLM-based smart contract summarization.
Findings
SCLA outperforms state-of-the-art models with up to 26.7% BLEU-4 improvement.
The method achieves significant gains in METEOR, ROUGE-L, and BLEURT scores.
Experiments on 40,000 real-world contracts validate its effectiveness.
Abstract
Smart contract code summarization is crucial for efficient maintenance and vulnerability mitigation. While many studies use Large Language Models (LLMs) for summarization, their performance still falls short compared to fine-tuned models like CodeT5+ and CodeBERT. Some approaches combine LLMs with data flow analysis but fail to fully capture the hierarchy and control structures of the code, leading to information loss and degraded summarization quality. We propose SCLA, an LLM-based method that enhances summarization by integrating a Control Flow Graph (CFG) and semantic facts from the code's control flow into a semantically enriched prompt. SCLA uses a control flow extraction algorithm to derive control flows from semantic nodes in the Abstract Syntax Tree (AST) and constructs the corresponding CFG. Code semantic facts refer to both explicit and implicit information within the AST that…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsArtificial Intelligence in Law
