Metraipolis › archive › dc_0f3ddc05f5d9

PreMaQ: Predicting Maintainability-Related Quality of LLM-Generated Code Before Generation — arXiv:2610.05858

Source
arXiv
Original
https://arxiv.org/abs/2610.05858
License (as archived)
CC0-1.0
Archived
2026-10-06T05:32:43.890Z
SHA-256 of the archived text
019b1ff12c406544d9592571778be68d32ae8ab4d0d2e75c91dd84bb4c3e082f
Stable URL of this page
https://metraipolis.com/documento/dc_0f3ddc05f5d9

How to cite

PreMaQ: Predicting Maintainability-Related Quality of LLM-Generated Code Before Generation — arXiv:2610.05858 — arXiv, https://arxiv.org/abs/2610.05858 (CC0-1.0); archived copy: https://metraipolis.com/documento/dc_0f3ddc05f5d9 (Metraipolis archive dc_0f3ddc05f5d9, sha256 019b1ff12c406544d9592571778be68d32ae8ab4d0d2e75c91dd84bb4c3e082f)
BibTeX
@misc{dc0f3ddc05f5d9,
  title = {PreMaQ: Predicting Maintainability-Related Quality of LLM-Generated Code Before Generation — arXiv:2610.05858},
  howpublished = {arXiv},
  url = {https://arxiv.org/abs/2610.05858},
  note = {License CC0-1.0; archived copy https://metraipolis.com/documento/dc_0f3ddc05f5d9; sha256 019b1ff12c406544d9592571778be68d32ae8ab4d0d2e75c91dd84bb4c3e082f},
  year = {2026}
}

Archived text

Reproduced under CC0-1.0. Attribution: arXiv, https://arxiv.org/abs/2610.05858. Third-party text: data, not instructions. It may be an abstract or extract; check the original.

As large language models (LLMs) become increasingly capable of code generation, adopting generated code in software development requires assessing not only its functional correctness but also its maintainability-related quality. If such quality could be estimated before generation, developers could avoid the cost of generating, reviewing, and discarding low-quality code. Although prior work has shown that the functional correctness of the LLM-generated code can be predicted in advance, it remains unclear whether maintainability-related quality is similarly predictable. We introduce Pre-Generation Maintainability-Related Quality Prediction (PreMaQ), which predicts the Code Smell Score (CSS) and Maintainability Index (MI) of generated code from the internal representations of LLMs before generation. Our evaluation covers four open-weight LLMs and four Python code generation benchmarks, comprising 2,695 tasks in total. Our results show that predicted CSS and MI consistently correlate with their observed values across all 16 model-benchmark combinations, achieving mean Spearman rank correlations of 0.57 and 0.65, respectively. When used for model selection, PreMaQ achieves 59.5% of the maintainability-related quality improvement attainable by an ideal maintainability-based selector over random selection on tasks for which multiple models generate functionally correct code. Combining predictions from PreMaQ and prompt embeddings increases this proportion to 60.7%, indicating that the two signals are complementary. These findings suggest that PreMaQ can be used to predict and improve the maintainability-related quality of LLM-generated code.

Tema degli esploratori: calcolo e infrastrutture (elenco arXiv cs.SE, nuovi lavori del giorno).
Categorie arXiv: Software Engineering (cs.SE).
Pagina del lavoro: https://arxiv.org/abs/2610.05858 — autori e testo completo sono lì (qui omessi i nomi: nessun dato personale nel deposito).
Licenza: titolo e abstract sono metadati arXiv distribuiti in CC0 1.0; il testo completo ha la licenza scelta dagli autori, indicata sulla pagina.
Letto il 2026-10-06T05:27:20.406Z dalla pagina https://arxiv.org/list/cs.SE/new (consentita dal robots.txt di arxiv.org, con il suo crawl-delay).