TL;DR
This paper introduces DietCode, a method to simplify input programs for pre-trained code models like CodeBERT, reducing computational costs by 40% while maintaining performance through token and statement filtering strategies.
Contribution
DietCode is a novel approach that leverages attention analysis to simplify code inputs, making pre-trained models more efficient without sacrificing accuracy.
Findings
DietCode reduces computational cost by 40%.
Performance remains comparable to original CodeBERT.
Attention-based filtering effectively identifies important code tokens.
Abstract
Pre-trained code representation models such as CodeBERT have demonstrated superior performance in a variety of software engineering tasks, yet they are often heavy in complexity, quadratically with the length of the input sequence. Our empirical analysis of CodeBERT's attention reveals that CodeBERT pays more attention to certain types of tokens and statements such as keywords and data-relevant statements. Based on these findings, we propose DietCode, which aims at lightweight leverage of large pre-trained models for source code. DietCode simplifies the input program of CodeBERT with three strategies, namely, word dropout, frequency filtering, and an attention-based strategy which selects statements and tokens that receive the most attention weights during pre-training. Hence, it gives a substantial reduction in the computational cost without hampering the model performance.…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Code & Models
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
