Beyond Output Correctness: Benchmarking and Evaluating Large Language Model Reasoning in Coding Tasks
Organizations: University of California, Irvine
Abstract
Large language models (LLMs) increasingly rely on explicit reasoning to solve coding tasks, yet evaluating the quality of this reasoning remains challenging. Existing reasoning evaluators are not designed for coding, and current benchmarks focus primarily on code generation, leaving other coding tasks largely unexplored. We introduce CodeRQ-Bench, the first benchmark for evaluating LLM reasoning quality across three coding task categories: generation, summarization, and classification. Using this benchmark, we analyze 1,069 mismatch cases from existing evaluators, identify five recurring limitations, and derive four design insights for reasoning evaluation in coding tasks. Guided by these insights, we propose VERA, a two-stage evaluator that combines evidence-grounded verification with ambiguity-aware score correction. Experiments on CodeRQ-Bench show that VERA consistently outperforms strong baselines across four datasets, improving AUCROC by up to 0.26 and AUPRC by up to 0.21. We release CodeRQ-Bench at https://github.com/MrLYG/CodeRQ-Bench, supporting future investigations.
Figures & tables
| Output Modality | Dataset | Size | # Correct / Incorrect Reasoning |
| Code Generation | CoderEval-RE | 230 | 70 / 160 |
| SWEBench-RE | 111 | 21 / 90 | |
| Code Summarization | ClassEval-RE | 139 | 112 / 27 |
| Bug Detection | DebugBench-RE | 252 | 153 / 99 |
| Limitation | Definition | Evaluator ( REC. / SOCR. / CaSE ) | Error Type ( Missed / FA ) | Representative Case |
| Evidence-Ungrounded Assessment | The evaluator does not ground its assessment in the evidence needed to verify reasoning correctness in coding tasks, where many claims must be searched and checked against repository context, API documents, or task specifications. | 14.4% / 41.6% / 44.0% | 85.4% / 14.6% | Appx. B.1.1 |
| Ambiguity Assessment Deficit | The evaluator cannot determine whether a task is ambiguous or underspecified, nor assess whether the reasoning handles such ambiguity. | 30.2% / 36.5% / 33.3% | 77.4% / 22.6% | Appx. B.1.2 |
| Score Aggregation Failure | The evaluator produces an unreliable final score because its scoring rule combines step-level judgments in a way that either lets one misjudged step override an otherwise correct trace or allows fatal correctness errors to be diluted by other steps. | 70.5% / – / 29.5% | 24.7% / 75.3% | Appx. B.1.3 |
| Self-Generated Reference Bias | The evaluator judges reasoning against self-generated references or standards, creating circular validation in which shared errors or biases are mistaken for correctness. | – / 100% / – | 97.3% / 2.7% | Appx. B.1.4 |
| Code-Unaware Assessment | The evaluator fails to reliably assess code-related reasoning because it cannot correctly represent or judge code-relevant semantics in the reasoning process. | 100% / – / – | 9.0% / 91.0% | Appx. B.1.5 |
| Method | CoderEval-RE (Generation) | SWEbench-RE (Generation) | ||||||
| Somers’ D | Spearman’s | AUCROC | AUPRC | Somers’ D | Spearman’s | AUCROC | AUPRC | |
| RECEVAl | 0.1255 | 0.1000 (p=0.1308) | 0.5627 | 0.3516 | 0.0878 | 0.0596 (p=0.5344) | 0.5439 | 0.2125 |
| SOCREVAl | 0.1399 | 0.1248 (p=0.0588) | 0.5700 | 0.3410 | 0.1556 | 0.1830 (p=0.0545) | 0.5778 | 0.2165 |
| CaSE | 0.0368 | 0.0392 (p=0.5543) | 0.5184 | 0.3131 | -0.0243 | -0.0588 (p=0.5400) | 0.4878 | 0.1855 |
| MAD ∗ | -0.0408 | -0.0480 (p=0.4684) | 0.4796 | 0.2963 | -0.0746 | -0.0644 (p=0.5019) | 0.4627 | 0.1785 |
| LLM-as-Judge | 0.0864 | 0.1077 (p=0.1032) | 0.5432 | 0.3252 | 0.0222 | 0.0280 (p=0.7707) | 0.5111 | 0.1924 |
| Method | CoderEval-RE | DebugBench-RE | ||||||
| Somers’ D | Spearman’s | AUCROC | AUPRC | Somers’ D | Spearman’s | AUCROC | AUPRC | |
| RECEVAL | 0.1255 | 0.1000 (p=0.1308) | 0.5627 | 0.3516 | -0.0843 | -0.0539 (p=0.3945) | 0.4579 | 0.8176 |
| SOCREVAL | 0.1399 | 0.1248 (p=0.0588) | 0.5700 | 0.3410 | 0.1233 | 0.1004 (p=0.1120) | 0.5617 | 0.8566 |
| CaSE | 0.0368 | 0.0392 (p=0.5543) | 0.5184 | 0.3131 | 0.0822 | 0.0597 (p=0.3450) | 0.5411 | 0.8628 |
| MAD ∗ | -0.0408 | -0.0480 (p=0.4684) | 0.4796 | 0.2963 | -0.0342 | -0.0307 (p=0.6273) | 0.4829 | 0.8393 |
| LLM-as-Judge | 0.0864 | 0.1077 (p=0.1032) | 0.5432 | 0.3252 | 0.0504 | 0.0338 (p=0.5931) | 0.5252 | 0.8441 |
| Dataset | Method | Somers’ D | Spearman’s | AUCROC | AUPRC |
| CoderEval-RE (Generation) | VERA (Ours) | 0.3811 | 0.3076 (p<0.0001) | 0.6905 | 0.4615 |
| w/o verif. | 0.2945 | 0.2369 (p=0.0003) | 0.6472 | 0.4356 | |
| w/o ambig. | 0.3216 | 0.2658 (p<0.0001) | 0.6608 | 0.4364 | |
| SWEbench-RE (Generation) | VERA (Ours) | 0.2799 | 0.1947 (p=0.0406) | 0.6399 | 0.3058 |
| w/o verif. | -0.0376 | -0.0261 (p=0.7855) | 0.4812 | 0.1842 | |
| w/o ambig. | 0.2571 | 0.1796 (p=0.0593) | 0.6286 | 0.3012 |
| Method | Somers’ D | Spearman’s | AUCROC | AUPRC |
| Best baseline | 0.1613 | 0.1713 | 0.5807 | 0.5279 |
| VERA (full) | 0.3785 | 0.2988 | 0.6893 | 0.6120 |
| No correction | 0.3526 | 0.2807 | 0.6763 | 0.6032 |
| No threshold | 0.3712 | 0.2928 | 0.6856 | 0.6084 |
| No ambiguity scaling | 0.3784 | 0.2988 | 0.6892 | 0.6111 |
Appendix figures & tables9 assets
Supplementary material from the paper’s appendix.
Appendix
| Dimension: Comprehension | |
| R1 | The reasoning must correctly identify the input parameters and return values of the code. |
| R2 | The reasoning must accurately trace the control flow (loops, conditionals, branches) of the code. |
| R3 | The reasoning must correctly interpret the operations performed on data structures. |
| R4 | The reasoning must not attribute functionality that does not exist in the code. |
| Dimension: Analysis | |
| R1 | The reasoning must correctly map variable names and function calls to their semantic roles. |
| Dimension: Comprehension | |
| R1 | The reasoning must correctly identify parameters, their types (if inferable), and their roles where bugs are identified. |
| R2 | The reasoning must correctly identify the return value(s), including affected conditionals where bugs are identified. |
| R3 | The reasoning must correctly describe how bug-related data structures (e.g., lists, maps, trees) are read, modified, or traversed. |
| Dimension: Analysis | |
| R1 | All bugs that affect observable behavior must be acknowledged. |
| R2 | The reasoning must correctly describe the execution order of conditionals, loops, and function calls. |