XPJudge: Explanation-Aware Pairwise Judging for Cost-Effective Code LLM Selection

Abstract

Large language models (LLMs) are widely adopted for code generation, but the high cost of deploying state-of-the-art models forces developers to choose among near-tied alternatives. Current code-generation benchmarks rely predominantly on execution-based unit tests, which approximate functional correctness but overlook developer-relevant software qualities such as readability, maintainability, and reliability, and provide limited discrimination among similarly performing models. Furthermore, parameter count is often treated as a proxy for capability, biasing selection toward larger models even when empirical performance differences are marginal. We introduce XPJudge, an eXplanation-aware, pairwise, judge-based evaluation framework that systematically compares model-generated code using explicit and fixed rubrics. XPJudge augments execution-based signals with rubric-driven scoring of functional and non-functional software quality attributes and evaluates explanation to code consistency to assess problem understanding. Pairwise judging enables fine-grained differentiation among closely performing models with modest evaluation overhead. We evaluate XPJudge on 148 BigCodeBench-Hard tasks comprising 848 unit tests. Functional scores produced by XPJudge strongly align with execution-based correctness, while non-functional quality scores expose distinctions obscured by pass-rate metrics. Judge-based evaluation consistently favors code-specialized, mid-sized models, yielding gains of up to 0.5 out of 5 on software quality attributes. Pairwise comparisons overturn leaderboard-based expectations, preferring smaller or specialized models in 56% to 60% of tasks despite near-equivalent correctness. These findings demonstrate that judge-based evaluation enables more informative and cost-aware model selection than execution-only benchmarks.

Type
Publication
2026 IEEE International Conference on Software Testing, Verification and Validation (ICST), pp. 732–743
Houssem Ben Braiek
Houssem Ben Braiek
Ph.D., M.Sc. in Software Engineering

I am a scientific entrepreneur with a background in software engineering for AI. My research focuses on trustworthy AI, and I’m especially excited about the part physical AI could play in the next industrial revolution. I contribute to the research and engineering community through open- source work, talks, and workshops. I also teach MLOps and LLMOps and write for practitioners.

Cite

Download

Search

Preview