Code vs Serialized AST Inputs for LLM-Based Code Summarization: An Empirical Study
Summarizing source code into natural language descriptions (code summarization) helps developers better understand program functionality and reduce the burden of software maintenance. Abstract Syntax Trees (ASTs), as opposed to source code, have been shown to improve summarization quality in traditional encoder–decoder-based code summarization models. However, most large language model (LLM)-based code summarization methods rely on raw code or only incorporate partial AST signals, meaning that the potential of complete AST representation has not been fully explored for LLMs.
This paper presents AST(NIT), an AST augmentation and serialization method that preserves lexical details and encodes structural information into LLM-compatible sequences. Experiments with the LLaMA-3.1-8B model on the CodeXGLUE Python dataset show that the proposed serialized ASTs reduce the length of LLM inputs, require shorter training times, and achieve summarization quality comparable to existing approaches.
Tue 14 AprDisplayed time zone: Brasilia, Distrito Federal, Brazil change
16:00 - 16:40 | Analysis and Optimization for AI-generated Code (Virtual Session)LLM4Code at Oceania I Chair(s): Kexin Pei The University of Chicago Zoom Link: https://us06web.zoom.us/j/89846180915 | ||
16:00 10mTalk | Do LLMs Dream of Energy-Efficient Code? LLM4Code Antimo Di Bernardo Independent Researcher, Gianluca Capozzi Sapienza University of Rome, Pasquale De Rosa University of Neuchâtel, Daniele Cono D'Elia Sapienza University of Rome, Leonardo Querzoni Sapienza University of Rome, Giuseppe Antonio Di Luna Sapienza University of Rome, Valerio Schiavoni University of Neuchâtel | ||
16:10 10mTalk | A Benchmark for Language Models in Real-World System Building LLM4Code Weilin Jin Peking University, Chenyu Zhao Nankai University, Zeshun Huang Nankai University, Chaoyun Zhang Microsoft, Qingwei Lin Microsoft, Chetan Bansal Microsoft Research, Saravan Rajmohan Microsoft, Shenglin Zhang Nankai University, Yongqian Sun Nankai University, Dan Pei Tsinghua University, Yifan Wu Peking University, Tong Jia Institute for Artificial Intelligence, Peking University, Beijing, China, Ying Li School of Software and Microelectronics, Peking University, Beijing, China, Zhonghai Wu Peking University, Minghua Ma Microsoft | ||
16:20 10mTalk | An Automated Methodology for Generating Labeled Datasets of Semantic Errors in Code LLM4Code Mahmoud Kassem New York University Abu Dhabi, Francisco Ribeiro New York University, Abu Dhabi, Sarah Nadi New York University Abu Dhabi | ||
16:30 10mTalk | Code vs Serialized AST Inputs for LLM-Based Code Summarization: An Empirical Study LLM4Code Shijia Dong School of Computing Science, University of Glasgow, Haoruo Zhao School of Computing Science, University of Glasgow, Paul Harvey University of Glasgow, UK | ||