一句话:提出 SCLA,用函数调用图与控制流语义事实增强提示,使通用 LLM 在智能合约摘要上显著超越微调基线。
智能合约代码摘要有助于维护与漏洞检测,但通用大语言模型在该任务上往往逊于 CodeT5+、CodeBERT 等微调模型;现有基于数据流的方法忽略层次化与控制结构,造成信息损失并降低摘要质量。本文提出 SCLA,一种多模态 LLM 方法:从抽象语法树中提取函数调用图(FCG)与控制流语义事实,构造语义增强的提示,以保留显式与隐式行为的结构和上下文依赖。作者在 4 万个真实智能合约上评估,SCLA 相对最优基线在 BLEU-4、METEOR、ROUGE-L、BLEURT 上分别提升 26.7%、23.2%、16.7%、14.7%,表明控制流增强提示能有效弥合通用 LLM 与领域特定代码理解之间的差距。
Smart contract code summarization facilitates maintenance and vulnerability detection. Although large language models (LLMs) are widely adopted, they underperform fine-tuned models such as CodeT5+ and CodeBERT. Existing data-flow-based methods often miss hierarchical and control structures, leading to information loss and lower summarization quality. We propose SCLA, a multimodal LLM approach that enhances code understanding via semantically enriched prompts. SCLA integrates Function Call Graphs (FCGs) and control-flow semantic facts extracted from the Abstract Syntax Tree (AST) to preserve structural and contextual dependencies, including both explicit and implicit behaviors. Evaluated on 40,000 real-world smart contracts, SCLA achieves substantial gains over state-of-the-art baselines: 26.7% (BLEU-4), 23.2% (METEOR), 16.7% (ROUGE-L), and 14.7% (BLEURT), demonstrating that control flow–enhanced prompting effectively bridges the gap between general-purpose LLMs and domain-specific code understanding.
@inproceedings{paperbot12046,
title = {SCLA: Automated Smart Contract Summarization via LLMs and Control Flow Prompt},
author = {Xiaoqi Li and Yingjie Mao and Zexin Lu and Wenkai Li and Zongwei Li},
booktitle = {ICSE},
year = {2026},
doi = {10.1145/3786582.3786812}
}