Diet Code Is Healthy: Simplifying Programs for Pre-trained Models of Code
Not on the map. Why?
Abstract (arXiv)
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. Experimental results on two downstream tasks show that DietCodeBERT provides comparable results to CodeBERT with 40% less computational cost in fine-tuning and testing.
Key facts. Cited by 24 papers in the map (data through 14 Oct 2026). First posted on arXiv 29 Jun 2022.
Builds on
No reference list yet.
Built on by
Citing papers per year: 2023: 6; 2024: 5; 2025: 8; 2026: 5.
24 papers.
Sort:
By area:
- 2023Domain Specialization as the Key to Make Large Language Models Disruptive: A Comprehensive Surveycited by 135
- 2025Reducing Cost of LLM Agents with Trajectory Reductioncited by 48
- 2026SWE-Pruner: Self-Adaptive Context Pruning for Coding Agentscited by 44
- 2025LongCodeZip: Compress Long Context for Code Language Modelscited by 39
- 2023Deep Learning for Code Intelligence: Survey, Benchmark and Toolkitcited by 22
- 2024Do Machines and Humans Focus on Similar Code? Exploring Explainability of Large Language Models in Code Summarizationcited by 16
- 2023Do Large Language Models Pay Similar Attention Like Human Programmers When Generating Code?cited by 14
- 2026Seeing is Coding: On the Effectiveness of Vision Language Models in Code Understandingcited by 13
- 2025The Hidden Cost of Readability: How Code Formatting Silently Consumes Your LLM Budgetcited by 12
- 2023Pitfalls in Language Models for Code Intelligence: A Taxonomy and Surveycited by 9
- 2026Can Vision-Language Models Handle Long-Context Code? An Empirical Study on Visual Compressioncited by 5
- 2024A Critical Study of What Code-LLMs (Do Not) Learncited by 4
12 more
- 2023Study of Distractors in Neural Models of Codecited by 2
- 2024Trojans in Large Language Models of Code: A Critical Review through a Trigger-Based Taxonomycited by 2
- 2025Analyzing Latent Concepts in Code Language Modelscited by 2
- 2026SWE-Pruner Pro: The Coder LLM Already Knows What to Prunecited by 2
- 2023Redundancy and Concept Analysis for Code-trained Language Modelscited by 1
- 2024Beyond Self-learned Attention: Mitigating Attention Bias in Transformer-based Models Using Attention Guidancecited by 1
- 2024CONCORD: Towards a DSL for Configurable Graph Code Representationcited by 0
- 2025LEANCODE: Understanding Models Better for Code Simplification of Pre-trained Large Language Modelscited by 0
- 2025Repairing Regex Vulnerabilities via Localization-Guided Instructionscited by 0
- 2025When Compression Becomes an Attack Surface: Black-Box Attacks on Prompt-Compressed LLM Agentscited by 0
- 2025From User Interface to Agent Interface: Efficiency Optimization of UI Representations for LLM Agentscited by 0
- 2026CodeShrink: Adaptive Visual Compression for Efficient Multimodal Code Understandingcited by 0
- 2026CodeShrink: Adaptive Visual Compression for Efficient Multimodal Code Understanding31 Jul 2026
- 2026SWE-Pruner Pro: The Coder LLM Already Knows What to Prune20 Jul 2026
- 2026Seeing is Coding: On the Effectiveness of Vision Language Models in Code Understanding2 Feb 2026
- 2026Can Vision-Language Models Handle Long-Context Code? An Empirical Study on Visual Compression31 Jan 2026
- 2026SWE-Pruner: Self-Adaptive Context Pruning for Coding Agents23 Jan 2026
- 2025From User Interface to Agent Interface: Efficiency Optimization of UI Representations for LLM Agents15 Dec 2025
- 2025When Compression Becomes an Attack Surface: Black-Box Attacks on Prompt-Compressed LLM Agents27 Oct 2025
- 2025Repairing Regex Vulnerabilities via Localization-Guided Instructions10 Oct 2025
- 2025Analyzing Latent Concepts in Code Language Models1 Oct 2025
- 2025LongCodeZip: Compress Long Context for Code Language Models1 Oct 2025
- 2025Reducing Cost of LLM Agents with Trajectory Reduction28 Sep 2025
- 2025The Hidden Cost of Readability: How Code Formatting Silently Consumes Your LLM Budget19 Aug 2025
12 more
- 2025LEANCODE: Understanding Models Better for Code Simplification of Pre-trained Large Language Models20 May 2025
- 2024A Critical Study of What Code-LLMs (Do Not) Learn17 Jun 2024
- 2024Trojans in Large Language Models of Code: A Critical Review through a Trigger-Based Taxonomy5 May 2024
- 2024Beyond Self-learned Attention: Mitigating Attention Bias in Transformer-based Models Using Attention Guidance26 Feb 2024
- 2024Do Machines and Humans Focus on Similar Code? Exploring Explainability of Large Language Models in Code Summarization22 Feb 2024
- 2024CONCORD: Towards a DSL for Configurable Graph Code Representation31 Jan 2024
- 2023Deep Learning for Code Intelligence: Survey, Benchmark and Toolkit30 Dec 2023
- 2023Pitfalls in Language Models for Code Intelligence: A Taxonomy and Survey27 Oct 2023
- 2023Do Large Language Models Pay Similar Attention Like Human Programmers When Generating Code?2 Jun 2023
- 2023Domain Specialization as the Key to Make Large Language Models Disruptive: A Comprehensive Survey30 May 2023
- 2023Redundancy and Concept Analysis for Code-trained Language Models1 May 2023
- 2023Study of Distractors in Neural Models of Code3 Mar 2023
- 2025Reducing Cost of LLM Agents with Trajectory Reductioncited by 48
- 2026SWE-Pruner: Self-Adaptive Context Pruning for Coding Agentscited by 44
- 2026SWE-Pruner Pro: The Coder LLM Already Knows What to Prunecited by 2
- 2025When Compression Becomes an Attack Surface: Black-Box Attacks on Prompt-Compressed LLM Agentscited by 0
- 2025From User Interface to Agent Interface: Efficiency Optimization of UI Representations for LLM Agentscited by 0
- 2026SWE-Pruner Pro: The Coder LLM Already Knows What to Prune20 Jul 2026
- 2026SWE-Pruner: Self-Adaptive Context Pruning for Coding Agents23 Jan 2026
- 2025From User Interface to Agent Interface: Efficiency Optimization of UI Representations for LLM Agents15 Dec 2025
- 2025When Compression Becomes an Attack Surface: Black-Box Attacks on Prompt-Compressed LLM Agents27 Oct 2025
- 2025Reducing Cost of LLM Agents with Trajectory Reduction28 Sep 2025
- 2026Seeing is Coding: On the Effectiveness of Vision Language Models in Code Understandingcited by 13
- 2026Can Vision-Language Models Handle Long-Context Code? An Empirical Study on Visual Compressioncited by 5
- 2026CodeShrink: Adaptive Visual Compression for Efficient Multimodal Code Understandingcited by 0
- 2026CodeShrink: Adaptive Visual Compression for Efficient Multimodal Code Understanding31 Jul 2026
- 2026Seeing is Coding: On the Effectiveness of Vision Language Models in Code Understanding2 Feb 2026
- 2026Can Vision-Language Models Handle Long-Context Code? An Empirical Study on Visual Compression31 Jan 2026
- 2023Domain Specialization as the Key to Make Large Language Models Disruptive: A Comprehensive Surveycited by 135
- 2025LongCodeZip: Compress Long Context for Code Language Modelscited by 39
- 2023Deep Learning for Code Intelligence: Survey, Benchmark and Toolkitcited by 22
- 2024Do Machines and Humans Focus on Similar Code? Exploring Explainability of Large Language Models in Code Summarizationcited by 16
- 2023Do Large Language Models Pay Similar Attention Like Human Programmers When Generating Code?cited by 14
- 2023Pitfalls in Language Models for Code Intelligence: A Taxonomy and Surveycited by 9
- 2024A Critical Study of What Code-LLMs (Do Not) Learncited by 4
- 2023Study of Distractors in Neural Models of Codecited by 2
- 2024Trojans in Large Language Models of Code: A Critical Review through a Trigger-Based Taxonomycited by 2
- 2025Analyzing Latent Concepts in Code Language Modelscited by 2
- 2023Redundancy and Concept Analysis for Code-trained Language Modelscited by 1
- 2024Beyond Self-learned Attention: Mitigating Attention Bias in Transformer-based Models Using Attention Guidancecited by 1
12 most cited of 15 All 15 (JSON)
- 2025Repairing Regex Vulnerabilities via Localization-Guided Instructions10 Oct 2025
- 2025Analyzing Latent Concepts in Code Language Models1 Oct 2025
- 2025LongCodeZip: Compress Long Context for Code Language Models1 Oct 2025
- 2025LEANCODE: Understanding Models Better for Code Simplification of Pre-trained Large Language Models20 May 2025
- 2024A Critical Study of What Code-LLMs (Do Not) Learn17 Jun 2024
- 2024Trojans in Large Language Models of Code: A Critical Review through a Trigger-Based Taxonomy5 May 2024
- 2024Beyond Self-learned Attention: Mitigating Attention Bias in Transformer-based Models Using Attention Guidance26 Feb 2024
- 2024Do Machines and Humans Focus on Similar Code? Exploring Explainability of Large Language Models in Code Summarization22 Feb 2024
- 2024CONCORD: Towards a DSL for Configurable Graph Code Representation31 Jan 2024
- 2023Deep Learning for Code Intelligence: Survey, Benchmark and Toolkit30 Dec 2023
- 2023Pitfalls in Language Models for Code Intelligence: A Taxonomy and Survey27 Oct 2023
- 2023Do Large Language Models Pay Similar Attention Like Human Programmers When Generating Code?2 Jun 2023
12 newest of 15 All 15 (JSON)