TL;DR
This paper presents the first comprehensive empirical study evaluating whether Large Language Models (LLMs) can reliably act as automated judges for software engineering (SE) tasks. The authors find that while output-based LLM judges achieve near-human alignment in code translation and generation, they fail dramatically in code summarization due to an inherent "verbosity bias."
What Problem Does This Paper Address?
Evaluating the quality of LLM-generated code and technical text is notoriously difficult. The gold standard metric, Pass@k, requires executing code against extensive unit tests within fully configured environments—a process that is resource-intensive, costly, and completely inapplicable to text-based SE tasks like code summarization. Alternatively, conventional lexical metrics like BLEU or ROUGE only measure surface-level token overlaps rather than actual semantic correctness.
While the NLP community has increasingly adopted "LLM-as-a-judge" frameworks to automate evaluation, their effectiveness and alignment with human preferences in complex, real-world software engineering scenarios remained completely unexplored until now.
Methods
The authors systematically evaluated three main categories of LLM-as-a-judge frameworks:
- Embedding-based methods: Using models like UniXcoder to extract contextual token representations of both the generated response and a reference answer, computing their semantic similarity (e.g., BERTScore, MoverScore).
- Probability-based methods: Utilizing token generation probabilities from decoders (like
davinci-002) to score outputs based on how likely the model is to generate them given a specific prompt (e.g., GPTScore, FFLM). - Output-based methods: Prompting generative LLMs (like GPT-4o and DeepSeek-V2.5) to directly output a numerical score or a pairwise comparison verdict. This included testing advanced inference strategies like G-Eval (Chain-of-Thought step generation) and BatchEval (multi-round batch scoring), as well as models explicitly fine-tuned for evaluation (SFT) like Auto-J and Prometheus 2.
The meta-evaluation compared these automated judges against human scores across two setups: individual scoring (assigning a 1-5 score) and pairwise comparison (choosing the better of two responses or declaring a tie).
Datasets
The study curated a meta-evaluation dataset consisting of 450 distinct (instruction, response, human score) triplets and 900 response pairs. The samples were drawn from three representative SE datasets covering different input-output modalities:
- Code Translation (Code-to-Code): CodeTransOcean (MultilingualTrans subset)
- Code Generation (Text-to-Code): ComplexCodeEval
- Code Summarization (Code-to-Text): CodeXGLUE (code-text subset)
Responses were generated using a diverse suite of 12 open- and closed-source code LLMs, and then manually annotated by two human software engineering experts to establish a reliable ground truth.
Key Insights and Ideas
- Extreme Task Dependency: LLM judges are not a one-size-fits-all solution for SE. They excel at structural code-to-code tasks but struggle when natural language descriptions are involved.
- The Verbosity Bias Trap: In code summarization, LLM judges failed completely, often showing a negative correlation with human preferences. Humans prefer concise, docstring-style summaries, whereas LLMs inherently favor long, step-by-step explanations, mistakenly giving perfect scores to overly verbose, low-quality summaries.
- Scale Trumps Specialization: Massive general-purpose models (>100B parameters like GPT-4o) drastically outperformed smaller models (~13B–47B) that were explicitly fine-tuned on NLP evaluation datasets (SFT). This highlights a significant domain gap between general NLP evaluation and specialized SE evaluation.
- Pairwise Inconsistency: Despite claims in NLP literature that pairwise comparisons are easier for LLMs than absolute scoring, they performed poorly in SE. The judges suffered from severe position bias, frequently changing their verdict simply when the order of the two code snippets in the prompt was reversed.
Key Results
- Code Translation: Output-based methods achieved near-human performance. GPT-4o paired with BatchEval reached a remarkable 81.32 Pearson correlation ($R$) with human scores, vastly outperforming ChrF++ (34.23), one of the best conventional metrics.
- Code Generation: DeepSeek-V2.5 achieved the highest alignment with a Pearson correlation of 68.51, slightly edging out the best conventional metric, METEOR (65.55).
- Code Summarization: Conventional metrics like ROUGE-L ($R = 47.01$) completely outclassed LLM judges. GPT-4o only managed a weak correlation ($R = 23.15$), while probability-based methods dropped to a negative correlation ($-15.04$).
- Pairwise Accuracy: Capped out at a modest 65.33% for translation and 54.67% for generation, with consistency (agreement after swapping positions) falling below 25% for the top-performing models.
Limitations and Future Work
The authors acknowledge that their study is limited by the lack of multi-task human preference datasets specifically tailored for software engineering evaluation. Furthermore, current prompting techniques fail to mitigate the structural biases (like verbosity and position bias) inherent to LLMs when dealing with code.
Future research directions include curating difficult, SE-specific human preference datasets to fine-tune smaller open-source judges, developing multi-agent consensus evaluation systems, and designing task-specific evaluation prompts that explicitly account for code structure and developer preferences.
Summary updated