Semantic vs. Structural Signals: Log-Probability and LLM-as-a-Judge for Reference-Free Code Evaluation

ยท Source: Paper Index on ACL Anthology ยท Field: Technology & Digital โ€” Artificial Intelligence & Machine Learning ยท Depth: Expert, quick

Summary

A study on reference-free evaluation of LLM-generated code compares two distinct paradigms: explicit LLM-as-a-Judge scoring and log-probability scoring, which uses log P๐œƒ(code โˆฃ task) as an instruction-free signal. Across the HumanEval-X dataset, the research reveals these approaches capture qualitatively different aspects of code correctness. Explicit judges, particularly larger models, excel at evaluating generated code by reasoning about task-solution alignment but struggle to differentiate correct solutions from minimally mutated ones. Conversely, log-probability shows weaker performance on generated code but consistently separates canonical from mutated solutions. These findings highlight a "discrimination-ranking dissociation," indicating that explicit judges capture semantic correctness, while log-probability captures local structural consistency, making them complementary signals.

Key takeaway

For AI Scientists and ML Engineers evaluating LLM-generated code without execution, understand that explicit LLM-as-a-Judge models excel at semantic correctness and task alignment, while log-probability is superior for detecting subtle structural inconsistencies. You should consider integrating both methods to achieve a robust, multi-faceted evaluation, leveraging each approach's unique strengths to ensure both functional correctness and structural integrity in your code outputs.

Key insights

LLM-as-a-Judge and log-probability offer complementary signals for reference-free code evaluation, revealing a discrimination-ranking dissociation.

Principles

Method

The study compares explicit LLM-as-a-Judge scoring with log-probability scoring on HumanEval-X to analyze their efficacy in reference-free code evaluation and distinguish their respective strengths.

In practice

Topics

Best for: Research Scientist, AI Engineer, AI Scientist, Machine Learning Engineer, NLP Engineer

Related on AIssential

Open in AIssential โ†’

Editorial summary, takeaway, and curation by AIssential. Original article published by Paper Index on ACL Anthology.