Human-Aligned Code Readability Assessment with Large Language Models

Fuente: arXiv
Saved in:
Bibliographic Details
Main Authors: Ouédraogo, Wendkûuni C., Li, Yinghua, Dang, Xueqi, Borsukiewicz, Pawel, Zhou, Xin, Koyuncu, Anil, Klein, Jacques, Lo, David, Bissyandé, Tegawendé F.
Format: Preprint
Published: 2025
Subjects:
Online Access:
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866912659317719040
author Ouédraogo, Wendkûuni C.
Li, Yinghua
Dang, Xueqi
Borsukiewicz, Pawel
Zhou, Xin
Koyuncu, Anil
Klein, Jacques
Lo, David
Bissyandé, Tegawendé F.
author_facet Ouédraogo, Wendkûuni C.
Li, Yinghua
Dang, Xueqi
Borsukiewicz, Pawel
Zhou, Xin
Koyuncu, Anil
Klein, Jacques
Lo, David
Bissyandé, Tegawendé F.
contents Code readability is crucial for software comprehension and maintenance, yet difficult to assess at scale. Traditional static metrics often fail to capture the subjective, context-sensitive nature of human judgments. Large Language Models (LLMs) offer a scalable alternative, but their behavior as readability evaluators remains underexplored. We introduce CoReEval, the first large-scale benchmark for evaluating LLM-based code readability assessment, comprising over 1.4 million model-snippet-prompt evaluations across 10 state of the art LLMs. The benchmark spans 3 programming languages (Java, Python, CUDA), 2 code types (functional code and unit tests), 4 prompting strategies (ZSL, FSL, CoT, ToT), 9 decoding settings, and developer-guided prompts tailored to junior and senior personas. We compare LLM outputs against human annotations and a validated static model, analyzing numerical alignment (MAE, Pearson's, Spearman's) and justification quality (sentiment, aspect coverage, semantic clustering). Our findings show that developer-guided prompting grounded in human-defined readability dimensions improves alignment in structured contexts, enhances explanation quality, and enables lightweight personalization through persona framing. However, increased score variability highlights trade-offs between alignment, stability, and interpretability. CoReEval provides a robust foundation for prompt engineering, model alignment studies, and human in the loop evaluation, with applications in education, onboarding, and CI/CD pipelines where LLMs can serve as explainable, adaptable reviewers.
format Preprint
id arxiv_https___arxiv_org_abs_2510_16579
institution arXiv
publishDate 2025
record_format arxiv
spellingShingle Human-Aligned Code Readability Assessment with Large Language Models
Ouédraogo, Wendkûuni C.
Li, Yinghua
Dang, Xueqi
Borsukiewicz, Pawel
Zhou, Xin
Koyuncu, Anil
Klein, Jacques
Lo, David
Bissyandé, Tegawendé F.
Software Engineering
Code readability is crucial for software comprehension and maintenance, yet difficult to assess at scale. Traditional static metrics often fail to capture the subjective, context-sensitive nature of human judgments. Large Language Models (LLMs) offer a scalable alternative, but their behavior as readability evaluators remains underexplored. We introduce CoReEval, the first large-scale benchmark for evaluating LLM-based code readability assessment, comprising over 1.4 million model-snippet-prompt evaluations across 10 state of the art LLMs. The benchmark spans 3 programming languages (Java, Python, CUDA), 2 code types (functional code and unit tests), 4 prompting strategies (ZSL, FSL, CoT, ToT), 9 decoding settings, and developer-guided prompts tailored to junior and senior personas. We compare LLM outputs against human annotations and a validated static model, analyzing numerical alignment (MAE, Pearson's, Spearman's) and justification quality (sentiment, aspect coverage, semantic clustering). Our findings show that developer-guided prompting grounded in human-defined readability dimensions improves alignment in structured contexts, enhances explanation quality, and enables lightweight personalization through persona framing. However, increased score variability highlights trade-offs between alignment, stability, and interpretability. CoReEval provides a robust foundation for prompt engineering, model alignment studies, and human in the loop evaluation, with applications in education, onboarding, and CI/CD pipelines where LLMs can serve as explainable, adaptable reviewers.
title Human-Aligned Code Readability Assessment with Large Language Models
topic Software Engineering
url https://arxiv.org/abs/2510.16579