@inproceedings{chen-etal-2025-dce,
title = "{DCE}-{LLM}: Dead Code Elimination with Large Language Models",
author = "Chen, Minyu and
Li, Guoqiang and
Wu, Ling-I and
Liu, Ruibang",
editor = "Chiruzzo, Luis and
Ritter, Alan and
Wang, Lu",
booktitle = "Proceedings of the 2025 Conference of the Nations of the Americas Chapter of the Association for Computational Linguistics: Human Language Technologies (Volume 1: Long Papers)",
month = apr,
year = "2025",
address = "Albuquerque, New Mexico",
publisher = "Association for Computational Linguistics",
url = "https://preview.aclanthology.org/Ingest-2025-COMPUTEL/2025.naacl-long.501/",
pages = "9942--9955",
ISBN = "979-8-89176-189-6",
abstract = "Dead code introduces several challenges in software development, such as increased binary size and maintenance difficulties. It can also obscure logical errors and be exploited for obfuscation in malware. For LLM-based code-related tasks, dead code introduces vulnerabilities that can mislead these models, raising security concerns. Although modern compilers and IDEs offer dead code elimination, sophisticated patterns can bypass these tools. A universal approach that includes classification, location, explanation, and correction is needed, yet current tools often require significant manual effort. We present DCE-LLM, a framework for automated dead code elimination using a small CodeBERT model with an attribution-based line selector to efficiently locate suspect code. LLMs then generate judgments and explanations, fine-tuned on a large-scale, annotated dead code dataset to provide detailed explanations and patches. DCE-LLM outperforms existing tools, with advanced unreachability detection, automated correction, and support for multiple programming languages. Experimental results show DCE-LLM achieves over 94{\%} F1 scores for unused and unreachable code, significantly surpassing GPT-4o by 30{\%}."
}
Markdown (Informal)
[DCE-LLM: Dead Code Elimination with Large Language Models](https://preview.aclanthology.org/Ingest-2025-COMPUTEL/2025.naacl-long.501/) (Chen et al., NAACL 2025)
ACL
- Minyu Chen, Guoqiang Li, Ling-I Wu, and Ruibang Liu. 2025. DCE-LLM: Dead Code Elimination with Large Language Models. In Proceedings of the 2025 Conference of the Nations of the Americas Chapter of the Association for Computational Linguistics: Human Language Technologies (Volume 1: Long Papers), pages 9942–9955, Albuquerque, New Mexico. Association for Computational Linguistics.