Lune

EMNLP2024Top-tier venue

CodeJudge: Evaluating Code Generation with Large Language Models

Weixi Tong, Tianyi Zhang

Abstract

Large Language Models (LLMs) have shown promising performance in code generation. However, how to reliably evaluate code generated by LLMs remains an unresolved problem. This paper presents CODEJUDGE , a code evaluation framework that leverages LLMs to evaluate the semantic correctness of generated code without the need for test cases. We investigate different ways to guide the LLM in performing "slow thinking" to arrive at an in-depth and reliable evaluation. We experimented with four LLMs as evaluators on four code generation datasets and five programming languages. The results show that CODEJUDGE significantly outperformed existing methods in most settings. Furthermore, compared with a SOTA GPT-3.5-based code evaluation method, CODE-JUDGE achieved better results even when using a much smaller model, Llama-3-8B-Instruct. Our code and datasets are available on GitHub https://github.com/VichyTong/CodeJudge .

Ask Lune

Know this paper in minutes, not an afternoon.

Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.

19 top-tier papers have cited it since. Know what they found before your reviewers do.

Questions to start from

Lune can draw on

the full paper · the top-tier papers that cite it · related work

Get the answer

Free to start. No credit card required.

Lineage

  • From Generation to Judgment: Opportunities and Challenges of LLM-as-a-judge cites BARTScore: Evaluating Generated Text as Text Generation
  • From Generation to Judgment: Opportunities and Challenges of LLM-as-a-judge cites BERTScore: Evaluating Text Generation with BERT
  • From Generation to Judgment: Opportunities and Challenges of LLM-as-a-judge cites Chain-of-Thought Prompting Elicits Reasoning in Large Language Models
  • Towards Understanding the Characteristics of Code Generation Errors Made by Large Language Models cites CodeBERT: A Pre-Trained Model for Programming and Natural Languages
  • Towards Understanding the Characteristics of Code Generation Errors Made by Large Language Models cites Chain-of-Thought Prompting Elicits Reasoning in Large Language Models
  • KRAMABENCH: A Benchmark for AI Systems on Data-to-Insight Pipelines over Data Lakes cites Chain-of-Thought Prompting Elicits Reasoning in Large Language Models
  • Evaluating Text Creativity across Diverse Domains: a Dataset and Large Language Model Evaluator cites From Generation to Judgment: Opportunities and Challenges of LLM-as-a-judge
  • BARTScore: Evaluating Generated Text as Text Generation cites BERTScore: Evaluating Text Generation with BERT
Builds onCited byLeft to right by year; the more cited, the higher.

Cited by top-tier papers19

  1. From Generation to Judgment: Opportunities and Challenges of LLM-as-a-judgeDawei Li, Bohan Jiang, Liangjie Huang, Alimohammad Beigi et al.EMNLP 2025 · 37 citations
  2. KRAMABENCH: A Benchmark for AI Systems on Data-to-Insight Pipelines over Data LakesEugenie Lai, Gerardo Vitagliano, Ziyu Zhang, Om Chabra et al.ICLR 2026 · 37 citations
  3. Agents Under Siege: Breaking Pragmatic Multi-Agent LLM Systems with Optimized Prompt AttacksRana Muhammad Shahroz, Zhen Tan, Sukwon Yun, Charles Fleming et al.ACL 2025 · 18 citations
  4. Towards Understanding the Characteristics of Code Generation Errors Made by Large Language ModelsZhijie Wang, Zijie Zhou, Da Song, Yuheng Huang et al.ICSE 2025 · 12 citations
  5. Evaluating Text Creativity across Diverse Domains: a Dataset and Large Language Model EvaluatorQian Cao, Xiting Wang, Yuzhuo Yuan, Yahui Liu et al.ICLR 2026 · 11 citations

Builds on12

  1. Chain-of-Thought Prompting Elicits Reasoning in Large Language ModelsJason Wei, Xuezhi Wang, Dale Schuurmans, Maarten Bosma et al.NeurIPS 2022 · 22,562 citations
  2. BERTScore: Evaluating Text Generation with BERTTianyi Zhang, Varsha Kishore, Felix Wu, Kilian Q. Weinberger et al.ICLR 2020 · 8,443 citations
  3. CodeBERT: A Pre-Trained Model for Programming and Natural LanguagesZhangyin Feng, Daya Guo, Duyu Tang, Nan Duan et al.EMNLP Findings 2020 · 2,828 citations
  4. Is Your Code Generated by ChatGPT Really Correct? Rigorous Evaluation of Large Language Models for Code GenerationJiawei Liu, Chunqiu Steven Xia, Yuyao Wang, Lingming ZhangNeurIPS 2023 · 2,317 citations
  5. BARTScore: Evaluating Generated Text as Text GenerationWeizhe Yuan, Graham Neubig, Pengfei LiuNeurIPS 2021 · 1,143 citations

Related papers

  1. CodeJudgeBench: Benchmarking LLM-as-a-Judge for Coding TasksHongchao Jiang, Yiming Chen, Yushi Cao, Hung-Yi Lee et al.ACL 2026 · 33 citations
  2. Learning to Align Multi-Faceted Evaluation: A Unified and Robust FrameworkKaishuai Xu, Tiezheng Yu, Yi Cheng, Wenjun Hou et al.ACL Findings 2025
  3. COFFE: A Code Efficiency Benchmark for Code GenerationYun Peng, Jun Wan, Yichen Li, Xiaoxue RenFSE 2025 · 8 citations
  4. Beyond Accuracy: Evaluating Self-Consistency of Code Large Language Models with IdentityChainMarcus J. Min, Yangruibo Ding, Luca Buratti, Saurabh Pujar et al.ICLR 2024 · 39 citations
  5. CodeHalu: Investigating Code Hallucinations in LLMs via Execution-based VerificationYuchen Tian, Weixiang Yan, Qian Yang, Xuandong Zhao et al.AAAI 2025 · 41 citations
Dusk over the sea between two cliffs drawn in fine vertical lines