Cited by 43Software Engineering ResearchTopic ModelingSoftware Testing and Debugging Techniques

Diet code is healthy: simplifying programs for pre-trained models of code

Open access
Zhang, Zhaowei, Zhang, Hongyu, Shen, Beijun, Gu, Xiaodong·2022·Proceedings of the 30th ACM Joint European Software Engineering Conference and Symposium on the Foundations of Software Engineering

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 that 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. Experimental results on two downstream tasks show that DietCode provides comparable results to CodeBERT with 40% less computational cost in fine-tuning and testing.

The claims and statistics of this paper haven’t been checked yet.

Run the check — free, no account needed. It reads the open-access text and checks the sources it cites.

A few free checks a day · papers already verified open instantly · results are public

Integrity signals

Registry

Crossref · 10.1145/3540250.3549094

Cites

50 of 50 references verified0 citation errors · 0 not checkable

Statistics

Claims the paper makes

The claims and statistics of this paper haven’t been checked yet.

Run the check — free, no account needed. It reads the open-access text and checks the sources it cites.

A few free checks a day · papers already verified open instantly · results are public

Claims other papers make about this one

Each is checked against this paper’s own text: does it say what the citing paper says it does?

  • Traditional code compressors such as DietCode and SlimCode improve syntax and structure awareness but are generally limited to function-level pruning or short code examples, leaving compression of long context for code largely unaddressed.

    “Traditional code compressors such as DietCode [26] and SlimCode [27] improve syntax and structure awareness but are generally limited to function-level pruning or short code examples, leaving compression of long context for code largely unaddressed.”

    From LongCodeZip: Compress Long Context for Code Language Models (2025) · cites this paper as [26]

    The Introduction (p. 1) and Datasets section (p. 7) describe DietCode pruning tokens and statements from input code, with experiments on function-level code. But the Implications for Future Research section (p. 10) says CodeBERT does not recognize grammar and structural information well and treats better incorporation of code structure as future work; it does not establish the claimed improvement in syntax and structure awareness. The paper motivates pruning partly by the cost of long sequences (p. 5), but does not assess long-context code compression as a field-wide gap. (LLM, conf=0.86)

    Experimental — accuracy not yet measured

Self-check

Percentages, sums and reported differences re-computed from the paper’s own numbers.

The self-check needs the paper’s full text.

Cites

Flagged first, then by citations

Research works printed but not linked: 3

  1. [6][6] Casey Casalnuovo, E Morgan, and P Devanbu. 2020. Does surprisal predict code comprehension difficulty. In Proceedings of the 42nd Annual Meeting of the Cognitive Science Society . Cognitive Science Society Toronto, Canada. -
  2. [35][35] Alec Radford, Jeffrey Wu, Rewon Child, David Luan, Dario Amodei, Ilya Sutskever, et al. 2019. Language models are unsupervised multitask learners. OpenAI blog 1, 8 (2019), 9. -
  3. [49][49] Andreas Zeller and Ralf Hildebrandt. 2002. Simplifying and isolating failureinducing input. IEEE Transactions on Software Engineering 28, 2 (2002), 183-200. -

Cited by

Sorted by citations

Authors
Zhang, Z., Zhang, H., Shen, B., & Gu, X.
Affiliations
  • Shanghai Jiao Tong University (CN)
  • University of Newcastle, Australia
Venue
Proceedings of the 30th ACM Joint European Software Engineering Conference and Symposium on the Foundations of Software Engineering
Publisher
ACM
Published
2022-11-07
Pages
1073-1084
OpenAlex
W4283751459
Cited by
41
References
50
Citations by year
2026: 5 · 2025: 9 · 2024: 18 · 2023: 7 · 2022: 2
FWCI
8.05
Type
conference paper
Language
en
Open access
Locations
  • ACM Joint European Software Engineering Conference and Symposium on the Foundations of Software Engineering (ESEC/FSE) (publishedVersion)
  • arXiv (Cornell University) (submittedVersion)
  • NOVA (University of Newcastle Australia) (submittedVersion)
  • arXiv (Cornell University) (cc-by)
Funders
  • NSF (National Science Foundation) (62102244)
  • CCF-Baidu Open Fund (2021PP15002000)
  • CCF-Tencent Rhino-Bird Young Faculty Open Research Fund
Topics
  • Physical Sciences › Computer Science › Information Systems › Software Engineering Research
  • Physical Sciences › Computer Science › Artificial Intelligence › Topic Modeling
  • Physical Sciences › Computer Science › Software › Software Testing and Debugging Techniques
Keywords
CodeBERT, attention analysis, program simplification, frequency filtering, computational complexity reduction, fine-tuning efficiency

About these checks

Registry, retraction, Cites and statistics results are computed, not judged, with one exception: a printed reference that no index lists is read once by a model before it counts as a citation error. Claims are extracted by a model and kept only when their quote appears verbatim in the text; each cited source is then checked, with a model’s help, for whether it says what the claim relies on. Those verdicts can be wrong — read the claim’s quote and the cited source before relying on one.

Statistics and arithmetic are recomputed, not judged.

Confidence bands are shown only for fields calibrated on our annotated test set. None is calibrated yet, so no band is shown.

What counts as a claim ›How we measure confidence ›How we check this ›

Are you an author, or do you see a problem with this page? Request a review