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
- Yanan Zheng (ORCID: https://orcid.org/0000-0002-9823-0191)
- Shaohua Wang (ORCID: https://orcid.org/0000-0001-5777-7759)
- Thi Thu Huong Nguyen (ORCID: https://orcid.org/0000-0001-8032-2701)
- Yan Wang (ORCID: https://orcid.org/0000-0002-6408-7366)
- Ling Ding (ORCID: https://orcid.org/0000-0002-4871-2352)
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
- National Science Foundation
- National Security Agency