Lune

FSE2024顶会

Natural Is the Best: Model-Agnostic Code Simplification for Pre-trained Large Language Models

Yan Wang, Xiaoning Li, Tien N. Nguyen, Shaohua Wang, Chao Ni, Ling Ding

2024年份
6被引次数
6顶会引用

摘要

Pre-trained Large Language Models (LLM) have achieved remarkable successes in several domains. However, code-oriented LLMs are often heavy in computational complexity, and quadratically with the length of the input code sequence. Toward simplifying the input program of an LLM, the state-of-the-art approach has the strategies to filter the input code tokens based on the attention scores given by the LLM. The decision to simplify the input program should not rely on the attention patterns of an LLM, as these patterns are influenced by both the model architecture and the pre-training dataset. Since the model and dataset are part of the solution domain, not the problem domain where the input program belongs, the outcome may differ when the model is pre-trained on a different dataset. We propose S lim C ode , a model-agnostic code simplification solution for LLMs that depends on the nature of input code tokens. As an empirical study on the LLMs including CodeBERT, CodeT5, and GPT-4 for two main tasks: code search and summarization, we reported that 1) the removal ratio of code has a linear-like relation with the saving ratio on training time, 2) the impact of categorized tokens on code simplification can vary significantly, 3) the impact of categorized tokens on code simplification is task-specific but model-agnostic, and 4) the above findings hold for the paradigm–prompt engineering and interactive in-context learning. The empirical results showed that S lim C ode can improve the state-of-the-art technique by <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" display="inline"> mml:mrow mml:mn9.46</mml:mn> mml:mtext%</mml:mtext> </mml:mrow> </mml:math> and <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" display="inline"> mml:mrow mml:mn5.15</mml:mn> mml:mtext%</mml:mtext> </mml:mrow> </mml:math> in terms of MRR and BLEU score on code search and summarization, respectively. More importantly, S lim C ode is 133 times faster than the state-of-the-art approach. Additionally, S lim C ode can reduce the cost of invoking GPT-4 by up to <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" display="inline"> mml:mrow mml:mn24</mml:mn> mml:mtext%</mml:mtext> </mml:mrow> </mml:math> per API query, while still producing comparable results to those with the original code. With this result, we call for a new direction on code-based, model-agnostic code simplification solutions to further empower LLMs.

问问这篇 Paper

智能体会读完全文。

Lune 把这篇 Paper 索引到了最后一个公式,引用它的顶会 Paper 也一样。你提问,回答直接引用原文。

可以从这些问题问起

智能体调用

Luneget_paper_fulltext

在 Lune 里问

免费开始,无需绑卡

lune papers fulltext 1f5c4cd9-eb3e-4e3f-bc50-7ad6a88fe258

引用它的顶会 Paper6

问问它们各自怎么用它

它引用的顶会 Paper22

相关 Paper

黄昏的海面,两侧是细线勾勒的悬崖