LEANCODE: Understanding Models Better for Code Simplification of Pre-trained Large Language Models

Large Language Models for code often entail significant computational complexity, which grows significantly with the length of the input code sequence.We propose LEANCODE for code simplification to reduce training and prediction time, leveraging code contexts in utilizing attention scores to represent the tokens' importance.We advocate for the selective removal of tokens based on the average context-aware attention scores rather than average scores across all inputs.LEANCODE uses the attention scores of 'CLS' tokens within the encoder for classification tasks, such as code search.It also employs the encoderdecoder attention scores to determine token significance for sequence-to-sequence tasks like code summarization.Our evaluation shows LEANCODE's superiority over the SOTAs DI-ETCODE and SLIMCODE, with improvements of 60% and 16% for code search, and 29% and 27% for code summarization, respectively.

Authors

Publication Details

Published
2025-01-01
DOI
https://doi.org/10.18653/v1/2025.acl-long.78
Citations
1
Primary Topic
Text Readability and Simplification
Type
article
Field-Weighted Citation Impact
2.48

Funders

Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
article

LEANCODE: Understanding Models Better for Code Simplification of Pre-trained Large Language Models

Yanan Zheng, Shaohua Wang, Thi Thu Huong Nguyen, Yan Wang et al.
1 citations
Text Readability and Simplification
2.48
article

LEANCODE: Understanding Models Better for Code Simplification of Pre-trained Large Language Models

Yanan Zheng, Shaohua Wang, Thi Thu Huong Nguyen, Yan Wang, Ling Ding
article en
1 citations

Abstract

Large Language Models for code often entail significant computational complexity, which grows significantly with the length of the input code sequence.We propose LEANCODE for code simplification to reduce training and prediction time, leveraging code contexts in utilizing attention scores to represent the tokens' importance.We advocate for the selective removal of tokens based on the average context-aware attention scores rather than average scores across all inputs.LEANCODE uses the attention scores of 'CLS' tokens within the encoder for classification tasks, such as code search.It also employs the encoderdecoder attention scores to determine token significance for sequence-to-sequence tasks like code summarization.Our evaluation shows LEANCODE's superiority over the SOTAs DI-ETCODE and SLIMCODE, with improvements of 60% and 16% for code search, and 29% and 27% for code summarization, respectively.

National Science Foundation, National Security Agency
Quality Education
Openalex Percentile: Top 9%
Text Readability and Simplification
2.48
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.