Zhipeng Gao
Current Organizations / Institutes
The organizations/institutes from the scholar's latest article
Previous Organizations / Institutes
The organizations / institutes from the scholar's other articles in the past ten years
Research Subjects
Research Interests
Zhipeng Gao has a total of 81 co-authors. Here are the top co-authors by number of shared publications:
- Xin Xia
The State Key Laboratory of Blockchain and Data Security, Zhejiang University, Hangzhou, China
18 shared publications - Xing Hu
The State Key Laboratory of Blockchain and Data Security, Zhejiang University, Hangzhou, China
15 shared publications - David Lo
School of Computing and Information Systems, Singapore Management University, Singapore, Singapore
9 shared publications - John Grundy
Monash University, Melbourne, Australia
8 shared publications - Lingfeng Bao
Zhejiang University
6 shared publications - Shanping Li
Zhejiang University, Hangzhou, China
5 shared publications
Latest Publications
- Open Access
- 18 November 2026
- Published by Association for Computing Machinery (ACM) in ACM Transactions on Software Engineering and Methodology
- Vol. 35 (12) , 1-36
Evolving Trends in Cleanliness of Open Source Projects
In the rapidly evolving landscape of open source software, code cleanliness has become a critical metric for assessing project quality and maintainability. However, understanding its evolution is essential for identifying long-term sustainability and best practices. This study investigates trends in code cleanliness across representative projects from three major open source communities: Apache, Google, and Spring. These were selected based on popularity and active commit frequencies. We focus on indicators such as cyclomatic complexity, lines of code per function and file, line length, and naming practices, drawn from project-specific coding guidelines and relevant for evaluating AI-generated code. Using abstract syntax trees and thresholds from best practice to parse positive and negative modifications and integrating differential information from commit logs, we establish precise mappings between functions and code lines before and after modifications. Our analysis shows complexity and lines of code growth as projects mature, largely due to feature growth and fault-tolerance logic in distributed systems. Continuous refactoring by key contributors can curb this rise overall. Projects also differ in standards and statement use: conditional and exception-handling statements correlate with higher complexity, while variable declarations and expressions track method size and line length, suggesting disciplined statement choices support cleaner code in practice.
- 18 November 2026
- Published by Association for Computing Machinery (ACM) in ACM Transactions on Software Engineering and Methodology
- Vol. 35 (12) , 1-36
Open AccessEvolving Trends in Cleanliness of Open Source Projects
In the rapidly evolving landscape of open source software, code cleanliness has become a critical metric for assessing project quality and maintainability. However, understanding its evolution is essential for identifying long-term sustainability and best practices. This study investigates trends in code cleanliness across representative projects from three major open source communities: Apache, Google, and Spring. These were selected based on popularity and active commit frequencies. We focus on indicators such as cyclomatic complexity, lines of code per function and file, line length, and naming practices, drawn from project-specific coding guidelines and relevant for evaluating AI-generated code. Using abstract syntax trees and thresholds from best practice to parse positive and negative modifications and integrating differential information from commit logs, we establish precise mappings between functions and code lines before and after modifications. Our analysis shows complexity and lines of code growth as projects mature, largely due to feature growth and fault-tolerance logic in distributed systems. Continuous refactoring by key contributors can curb this rise overall. Projects also differ in standards and statement use: conditional and exception-handling statements correlate with higher complexity, while variable declarations and expressions track method size and line length, suggesting disciplined statement choices support cleaner code in practice.
- Open Access
- 7 October 2026
- Published by Association for Computing Machinery (ACM)
- p. 3440-3444
SmellCC: A Tool for Automated Code Smells Remediation
- 7 October 2026
- Published by Association for Computing Machinery (ACM)
- p. 3440-3444
Open AccessSmellCC: A Tool for Automated Code Smells Remediation
- Open Access
- 1 October 2026
- Published by Association for Computing Machinery (ACM) in Proceedings of the ACM on Software Engineering
- Vol. 3 (ISSTA) , 3797-3819
SmartDecompiler-R1: Enhancing Faithful and Explainable Smart Contract Bytecode Decompilation with Reinforcement Learning
Understanding EVM bytecode is critical for smart contract security analysis. Existing decompilers typically rely on heuristic rules or leverage large language models (LLMs) to generate source code after bytecode analysis. However, heuristic-based approaches often produce pseudocode that is difficult for humans to interpret, while LLM-based methods also face several problems. LLMs have little experience with low-level bytecode, which weakens their reasoning and causes inaccurate results. Additionally, their tendency to auto-correct code breaks faithfulness to the original program. A general lack of clarity in these approaches also hinders effective auditing and interpretation. In this paper, we propose SmartDecompiler-R1, an end-to-end decompilation framework that translates Three-Address Code (TAC), a register-based representation of EVM bytecode, into source code using reinforcement learning. SmartDecompiler-R1 significantly improves both the accuracy and consistency of decompiled code, while additionally providing human-readable explanations for the bytecode-to-source generation process. To the best of our knowledge, we are the first to design a benchmark equipped with well-defined test cases and a systematic evaluation framework for smart contract decompilation. Experimental results on this benchmark demonstrate that SmartDecompiler-R1 substantially outperforms existing decompilers on execution consistency by 46.23%. In particular, compared with LLM-based approaches, SmartDecompiler-R1 achieves a significant improvement in preserving vulnerability consistency between the original and decompiled contracts. Furthermore, we conduct extensive ablation studies to validate the effectiveness of individual components of SmartDecompiler-R1, and design targeted experiments to demonstrate the interpretability and readability of the generated explanations.
- 1 October 2026
- Published by Association for Computing Machinery (ACM) in Proceedings of the ACM on Software Engineering
- Vol. 3 (ISSTA) , 3797-3819
Open AccessSmartDecompiler-R1: Enhancing Faithful and Explainable Smart Contract Bytecode Decompilation with Reinforcement Learning
Understanding EVM bytecode is critical for smart contract security analysis. Existing decompilers typically rely on heuristic rules or leverage large language models (LLMs) to generate source code after bytecode analysis. However, heuristic-based approaches often produce pseudocode that is difficult for humans to interpret, while LLM-based methods also face several problems. LLMs have little experience with low-level bytecode, which weakens their reasoning and causes inaccurate results. Additionally, their tendency to auto-correct code breaks faithfulness to the original program. A general lack of clarity in these approaches also hinders effective auditing and interpretation. In this paper, we propose SmartDecompiler-R1, an end-to-end decompilation framework that translates Three-Address Code (TAC), a register-based representation of EVM bytecode, into source code using reinforcement learning. SmartDecompiler-R1 significantly improves both the accuracy and consistency of decompiled code, while additionally providing human-readable explanations for the bytecode-to-source generation process. To the best of our knowledge, we are the first to design a benchmark equipped with well-defined test cases and a systematic evaluation framework for smart contract decompilation. Experimental results on this benchmark demonstrate that SmartDecompiler-R1 substantially outperforms existing decompilers on execution consistency by 46.23%. In particular, compared with LLM-based approaches, SmartDecompiler-R1 achieves a significant improvement in preserving vulnerability consistency between the original and decompiled contracts. Furthermore, we conduct extensive ablation studies to validate the effectiveness of individual components of SmartDecompiler-R1, and design targeted experiments to demonstrate the interpretability and readability of the generated explanations.
- Open Access
- 17 June 2026
- Published by Association for Computing Machinery (ACM) in ACM Transactions on Software Engineering and Methodology
- Vol. 35 (7) , 1-26
Enhancing Domain-Specific Code Completion via Collaborative Inference with Large and Small Language Models
Large language model-based code completion has demonstrated excellent performance, but still encounters challenges in capturing domain-specific knowledge for more precise completion within specific domains, i.e., domain-specific code completion. Prior work has studied fine-tuning techniques or retrieval-augmented techniques for this task. Nevertheless, it requires a lot of computational resources to fine-tune large language models (LLMs), and the cost can increase quadratically with the model size. Retrieval-augmented techniques face difficulties in accurately and adaptively retrieving relevant information. Moreover, considering that code completion tools work in real time, how to utilize large language models more efficiently poses challenges. To tackle these challenges, in this article, we first conduct preliminary experiments and observe that the code completion results of a small model fine-tuned within a specific domain complement those of a large model. Building on this insight, we propose a collaborative framework to effectively combine large and small models for better domain-specific code completion. Specifically, we fine-tune a small code model instead of a large model with the PEFT method, reducing the overhead of fine-tuning. We utilize a well-designed classifier to facilitate the adaptive combination of distinct completion results. The classifier relies on features in various dimensions, such as the similarity between the completed code and the context, and is used to adaptively determine how to combine the tokens predicted by the large and small models for better code completion. Evaluation results show that our approach achieves an average improvement in the exact match of 7.42% and 4.67% over the state-of-the-art baselines in the intra-project and intra-domain code completion scenarios, respectively. Furthermore, compared to the state-of-the-art domain-specific code completion approach FT2Ra, the inference speed of our approach is 1.40 times faster, and the average space requirement drops from 25.98G to 13.69G. These advantages make our approach much more accessible and efficient.
- 17 June 2026
- Published by Association for Computing Machinery (ACM) in ACM Transactions on Software Engineering and Methodology
- Vol. 35 (7) , 1-26
Open AccessEnhancing Domain-Specific Code Completion via Collaborative Inference with Large and Small Language Models
Large language model-based code completion has demonstrated excellent performance, but still encounters challenges in capturing domain-specific knowledge for more precise completion within specific domains, i.e., domain-specific code completion. Prior work has studied fine-tuning techniques or retrieval-augmented techniques for this task. Nevertheless, it requires a lot of computational resources to fine-tune large language models (LLMs), and the cost can increase quadratically with the model size. Retrieval-augmented techniques face difficulties in accurately and adaptively retrieving relevant information. Moreover, considering that code completion tools work in real time, how to utilize large language models more efficiently poses challenges. To tackle these challenges, in this article, we first conduct preliminary experiments and observe that the code completion results of a small model fine-tuned within a specific domain complement those of a large model. Building on this insight, we propose a collaborative framework to effectively combine large and small models for better domain-specific code completion. Specifically, we fine-tune a small code model instead of a large model with the PEFT method, reducing the overhead of fine-tuning. We utilize a well-designed classifier to facilitate the adaptive combination of distinct completion results. The classifier relies on features in various dimensions, such as the similarity between the completed code and the context, and is used to adaptively determine how to combine the tokens predicted by the large and small models for better code completion. Evaluation results show that our approach achieves an average improvement in the exact match of 7.42% and 4.67% over the state-of-the-art baselines in the intra-project and intra-domain code completion scenarios, respectively. Furthermore, compared to the state-of-the-art domain-specific code completion approach FT2Ra, the inference speed of our approach is 1.40 times faster, and the average space requirement drops from 25.98G to 13.69G. These advantages make our approach much more accessible and efficient.
- Open Access
- 12 April 2026
- Published by Association for Computing Machinery (ACM)
- p. 2198-2210
Actionable Warning Is Not Enough: Recommending Valid Actionable Warnings with Weak Supervision
- 12 April 2026
- Published by Association for Computing Machinery (ACM)
- p. 2198-2210
Open AccessActionable Warning Is Not Enough: Recommending Valid Actionable Warnings with Weak Supervision
- Open Access
- 12 April 2026
- Published by Association for Computing Machinery (ACM)
- p. 667-678
Automating Just-In-Time Python Type Annotation Updating
- 12 April 2026
- Published by Association for Computing Machinery (ACM)
- p. 667-678
Open AccessAutomating Just-In-Time Python Type Annotation Updating
- 18 February 2026
- Published by Institute of Electrical and Electronics Engineers (IEEE) in IEEE Transactions on Software Engineering
- Vol. 52 (3) , 1056-1073
Improving Gas Efficiency in Smart Contracts: Data-Driven Insights and LLM-Assisted Remediation
Smart contracts, primarily written in Solidity, are Turing-complete programs on platforms like Ethereum, requiring gas fees for deployment and execution. Gas quantifies computational costs, and inefficient contracts result in unnecessary expenses for developers and users. Gas optimization at the source code level has been studied in various related works; however, existing methods for summarizing gas-inefficient patterns primarily rely on author-defined rules or heuristic approaches, and their evaluations lack a labeled dataset. In this paper, we conduct a comprehensive empirical study on the issue of gas optimization in smart contracts. We begin by gathering audit reports from Code4rena, a well-known smart contract audit platform. These reports include both expert evaluations, conducted by professionals known as Wardens, and automated analyses generated by the platform’s static analysis tool, 4naly3er. After filtering out false-positive gas optimization instances from the automated reports, we identify 2,095 instances of gas-inefficient patterns across 54 projects. We categorize these inefficiencies into 24 types using thematic analysis and find that static analysis tools often produce false positives and negatives. To address this, we propose a hybrid method combining static analysis and large language models (LLMs) to detect and repair gas inefficiencies. The static analysis tool identifies potential optimization opportunities, while the LLM refines these findings and suggests effective repairs. Our evaluation shows that our approach achieves a precision rate of 82.28% and a recall rate of 88.46%, and can save 919 units of gas per function on average during execution.
- 18 February 2026
- Published by Institute of Electrical and Electronics Engineers (IEEE) in IEEE Transactions on Software Engineering
- Vol. 52 (3) , 1056-1073
Improving Gas Efficiency in Smart Contracts: Data-Driven Insights and LLM-Assisted Remediation
Smart contracts, primarily written in Solidity, are Turing-complete programs on platforms like Ethereum, requiring gas fees for deployment and execution. Gas quantifies computational costs, and inefficient contracts result in unnecessary expenses for developers and users. Gas optimization at the source code level has been studied in various related works; however, existing methods for summarizing gas-inefficient patterns primarily rely on author-defined rules or heuristic approaches, and their evaluations lack a labeled dataset. In this paper, we conduct a comprehensive empirical study on the issue of gas optimization in smart contracts. We begin by gathering audit reports from Code4rena, a well-known smart contract audit platform. These reports include both expert evaluations, conducted by professionals known as Wardens, and automated analyses generated by the platform’s static analysis tool, 4naly3er. After filtering out false-positive gas optimization instances from the automated reports, we identify 2,095 instances of gas-inefficient patterns across 54 projects. We categorize these inefficiencies into 24 types using thematic analysis and find that static analysis tools often produce false positives and negatives. To address this, we propose a hybrid method combining static analysis and large language models (LLMs) to detect and repair gas inefficiencies. The static analysis tool identifies potential optimization opportunities, while the LLM refines these findings and suggests effective repairs. Our evaluation shows that our approach achieves a precision rate of 82.28% and a recall rate of 88.46%, and can save 919 units of gas per function on average during execution.
- Open Access
- 5 February 2026
- Published by Association for Computing Machinery (ACM) in ACM Transactions on Software Engineering and Methodology
- Vol. 35 (10) , 1-30
Clean Code, Better Models: Enhancing LLM Performance with Smell-Cleaned Dataset
The Large Language Models (LLMs) have demonstrated great potential in code-related tasks. However, most research focuses on improving the output quality of LLMs (e.g., correctness), and less attention has been paid to the LLM input (e.g., the training code quality). Given that code smells are widely existed in practice and can negatively impact software maintainability and readability, this study takes the first systematic research to assess and improve dataset quality in terms of code smells. In this work, we first conduct a preliminary study to explore the presence of code smells in a popular benchmark dataset (i.e., CodeSearchNet -Python) and evaluate the output of several popular LLMs (i.e., DeepSeek-Coder, CodeLlama, and MagiCoder), revealing that code smell issues extensively exist in LLM’s input (e.g., benchmark dataset) and output (e.g., generated code). We also perform a user study to investigate developers’ perspectives on LLM-generated code with and without smells, which indicated developers’ strong preference for smell-free code and their willingness to leverage LLMs for intricate code smell removal. We then conduct our systematic research by taking three main steps: Firstly, we propose an LLM-based code smell cleaning tool, named Smell CC ( Smell C ode C leaner), which automatically refactors and removes code smells. To evaluate the correctness of the code refactoring, we construct a test set of 50 repositories sourced from the CodeSearchNet -Python benchmark for functional testing. Then we apply our curated smell-cleaned dataset to fine-tune two LLMs (i.e., DeepSeek-V2 and Qwen-Coder) to explore their potential for generating high-quality code. Thirdly, we investigate the impact of code smells on two downstream tasks: code completion and code search. Furthermore, to access the generalizability of Smell CC , we conduct a cross-project evaluation. Lastly, we derive several actionable implications for software engineering researchers and industry practitioners from our findings. The experimental results show that our Smell CC eliminates 91.6% of code smells across the entire CodeSearchNet -Python corpus, curating a smell-cleaned benchmark dataset. On a curated 50-repository subset, Smell CC achieves 96.8% smell removal while maintaining 91.3% correctness through test verification. The LLMs fine-tuned on this smell-cleaned dataset reduce code smells in generated code by 79.6% and 83.1% for DeepSeek-V2 and Qwen-Coder respectively. Moreover, applying the smell-cleaned dataset to code completion and code search tasks yields significant improvements across all models (DeepSeek-V1/V2, Qwen-Coder), with Qwen-Coder achieving peak gains of 12.2% in completion and 4.3% in search performance. Finally, Smell CC also demonstrates strong generalization capabilities in a cross-project setting.
- 5 February 2026
- Published by Association for Computing Machinery (ACM) in ACM Transactions on Software Engineering and Methodology
- Vol. 35 (10) , 1-30
Open AccessClean Code, Better Models: Enhancing LLM Performance with Smell-Cleaned Dataset
The Large Language Models (LLMs) have demonstrated great potential in code-related tasks. However, most research focuses on improving the output quality of LLMs (e.g., correctness), and less attention has been paid to the LLM input (e.g., the training code quality). Given that code smells are widely existed in practice and can negatively impact software maintainability and readability, this study takes the first systematic research to assess and improve dataset quality in terms of code smells. In this work, we first conduct a preliminary study to explore the presence of code smells in a popular benchmark dataset (i.e., CodeSearchNet -Python) and evaluate the output of several popular LLMs (i.e., DeepSeek-Coder, CodeLlama, and MagiCoder), revealing that code smell issues extensively exist in LLM’s input (e.g., benchmark dataset) and output (e.g., generated code). We also perform a user study to investigate developers’ perspectives on LLM-generated code with and without smells, which indicated developers’ strong preference for smell-free code and their willingness to leverage LLMs for intricate code smell removal. We then conduct our systematic research by taking three main steps: Firstly, we propose an LLM-based code smell cleaning tool, named Smell CC ( Smell C ode C leaner), which automatically refactors and removes code smells. To evaluate the correctness of the code refactoring, we construct a test set of 50 repositories sourced from the CodeSearchNet -Python benchmark for functional testing. Then we apply our curated smell-cleaned dataset to fine-tune two LLMs (i.e., DeepSeek-V2 and Qwen-Coder) to explore their potential for generating high-quality code. Thirdly, we investigate the impact of code smells on two downstream tasks: code completion and code search. Furthermore, to access the generalizability of Smell CC , we conduct a cross-project evaluation. Lastly, we derive several actionable implications for software engineering researchers and industry practitioners from our findings. The experimental results show that our Smell CC eliminates 91.6% of code smells across the entire CodeSearchNet -Python corpus, curating a smell-cleaned benchmark dataset. On a curated 50-repository subset, Smell CC achieves 96.8% smell removal while maintaining 91.3% correctness through test verification. The LLMs fine-tuned on this smell-cleaned dataset reduce code smells in generated code by 79.6% and 83.1% for DeepSeek-V2 and Qwen-Coder respectively. Moreover, applying the smell-cleaned dataset to code completion and code search tasks yields significant improvements across all models (DeepSeek-V1/V2, Qwen-Coder), with Qwen-Coder achieving peak gains of 12.2% in completion and 4.3% in search performance. Finally, Smell CC also demonstrates strong generalization capabilities in a cross-project setting.
- Open Access
Clean Code, Better Models: Enhancing LLM Performance with Smell-Cleaned Dataset
The Large Language Models (LLMs) have demonstrated great potential in code-related tasks. However, most research focuses on improving the output quality of LLMs (e.g., correctness), and less attention has been paid to the LLM input (e.g., the training code quality). Given that code smells are widely existed in practice and can negatively impact software maintainability and readability, this study takes the first systematic research to assess and improve dataset quality in terms of code smells. In this work, we first conduct a preliminary study to explore the presence of code smells in a popular benchmark dataset (i.e., CodeSearchNet-Python}) and evaluate the output of several popular LLMs (i.e., DeepSeek-Coder, CodeLlama, and MagiCoder), revealing that code smell issues extensively exist in LLM's input (e.g., benchmark dataset) and output (e.g., generated code). We then conduct our systematic research by taking three main steps: Firstly, we propose an LLM-based code smell cleaning tool, named SmellCC, which automatically refactors and removes code smells. To evaluate the correctness of the code refactoring, we construct a test set of 50 repositories sourced from the CodeSearchNet-Python benchmark for functional testing. Then we apply our curated smell-cleaned dataset to fine-tune two LLMs (i.e., DeepSeek-V2 and Qwen-Coder) to explore their potential for generating high-quality code. Thirdly, we investigate the impact of code smells on two downstream tasks: code completion and code search. Lastly, we derive several actionable implications for software engineering researchers and industry practitioners from our findings.
Open AccessClean Code, Better Models: Enhancing LLM Performance with Smell-Cleaned Dataset
The Large Language Models (LLMs) have demonstrated great potential in code-related tasks. However, most research focuses on improving the output quality of LLMs (e.g., correctness), and less attention has been paid to the LLM input (e.g., the training code quality). Given that code smells are widely existed in practice and can negatively impact software maintainability and readability, this study takes the first systematic research to assess and improve dataset quality in terms of code smells. In this work, we first conduct a preliminary study to explore the presence of code smells in a popular benchmark dataset (i.e., CodeSearchNet-Python}) and evaluate the output of several popular LLMs (i.e., DeepSeek-Coder, CodeLlama, and MagiCoder), revealing that code smell issues extensively exist in LLM's input (e.g., benchmark dataset) and output (e.g., generated code). We then conduct our systematic research by taking three main steps: Firstly, we propose an LLM-based code smell cleaning tool, named SmellCC, which automatically refactors and removes code smells. To evaluate the correctness of the code refactoring, we construct a test set of 50 repositories sourced from the CodeSearchNet-Python benchmark for functional testing. Then we apply our curated smell-cleaned dataset to fine-tune two LLMs (i.e., DeepSeek-V2 and Qwen-Coder) to explore their potential for generating high-quality code. Thirdly, we investigate the impact of code smells on two downstream tasks: code completion and code search. Lastly, we derive several actionable implications for software engineering researchers and industry practitioners from our findings.
- Open Access
- 11 June 2025
- Published by Association for Computing Machinery (ACM)
- p. 71-75
Code2API: A Tool for Generating Reusable APIs from Stack Overflow Code Snippets
- 11 June 2025
- Published by Association for Computing Machinery (ACM)
- p. 71-75
Open AccessCode2API: A Tool for Generating Reusable APIs from Stack Overflow Code Snippets