Evaluation of large language models for assessing code maintainability
Not on the map. Why?
Abstract (arXiv)
Increased availability of open-source software repositories and recent advances in code analysis using large language models (LLMs) has triggered a wave of new work to automate software engineering tasks that were previously very difficult to automate. In this paper, we investigate a recent line of work that hypothesises that comparing the probability of code generated by LLMs with the probability the current code would have had can indicate potential quality problems. We investigate the association between the cross-entropy of code generated by ten different models (based on GPT2 and Llama2) and the following quality aspects: readability, understandability, complexity, modularisation, and overall maintainability assessed by experts and available in an benchmark dataset. Our results show that, controlling for the number of logical lines of codes (LLOC), cross-entropy computed by LLMs is indeed a predictor of maintainability on a class level (the higher the cross-entropy the lower the maintainability). However, this relation is reversed when one does not control for LLOC (e.g., comparing small classes with longer ones). Furthermore, while the complexity of LLMs affects the range of cross-entropy (smaller models tend to have a wider range of cross-entropy), this plays a significant role in predicting maintainability aspects. Our study limits itself on ten different pretrained models (based on GPT2 and Llama2) and on maintainability aspects collected by Schnappinger et al. When controlling for logical lines of code (LLOC), cross-entropy is a predictor of maintainability. However, while related work has shown the potential usefulness of cross-entropy at the level of tokens or short sequences, at the class level this criterion alone may prove insufficient to predict maintainability and further research is needed to make best use of this information in practice.
Key facts. Cited by 5 papers in the map (data through 14 Oct 2026). Builds on 3 of its 14 references that are in the map. First posted on arXiv 23 Jan 2024.
Builds on
3 of 14 references.
References · 3
- 2017A Survey of Machine Learning for Big Code and Naturalnesscited by 221
- 2020A Survey on Deep Learning for Software Engineeringcited by 38
- 2022A Survey of Deep Learning Models for Structural Code Understandingcited by 4
Built on by
Citing papers per year: 2024: 2; 2025: 1; 2026: 2.
5 papers.
- 2024Beyond Correctness: Benchmarking Multi-dimensional Code Generation for Large Language Modelscited by 10
- 2025Generating Energy-Efficient Code via Large-Language Models -- Where are we now?cited by 6
- 2024Sparsity-Accelerated Training for Large Language Modelscited by 5
- 2026Not All Code Is Equal: A Data-Centric Study of Code Complexity and LLM Reasoningcited by 1
- 2026Prompt Coverage Adequacycited by 0
- 2026Prompt Coverage Adequacy2 Jul 2026
- 2026Not All Code Is Equal: A Data-Centric Study of Code Complexity and LLM Reasoning29 Jan 2026
- 2025Generating Energy-Efficient Code via Large-Language Models -- Where are we now?12 Sep 2025
- 2024Beyond Correctness: Benchmarking Multi-dimensional Code Generation for Large Language Models16 Jul 2024
- 2024Sparsity-Accelerated Training for Large Language Models3 Jun 2024