Is Functional Correctness Enough to Evaluate Code Language Models? Exploring Diversity of Generated Codes
Not on the map. Why?
Abstract (arXiv)
Language models (LMs) have exhibited impressive abilities in generating codes from natural language requirements. In this work, we highlight the diversity of code generated by LMs as a critical criterion for evaluating their code generation capabilities, in addition to functional correctness. Despite its practical implications, there is a lack of studies focused on assessing the diversity of generated code, which overlooks its importance in the development of code LMs. We propose a systematic approach to evaluate the diversity of generated code, utilizing various metrics for inter-code similarity as well as functional correctness. Specifically, we introduce a pairwise code similarity measure that leverages large LMs' capabilities in code understanding and reasoning, demonstrating the highest correlation with human judgment. We extensively investigate the impact of various factors on the quality of generated code, including model sizes, temperatures, training approaches, prompting strategies, and the difficulty of input problems. Our consistent observation of a positive correlation between the test pass score and the inter-code similarity score indicates that current LMs tend to produce functionally correct code with limited diversity.
Key facts. Cited by 5 papers in the map (data through 7 Oct 2026). Builds on 25 of its 33 references that are in the map. First posted on arXiv 24 Aug 2024.
Builds on
25 of 33 references.
References · 25
- 2020Language Models are Few-Shot Learnerscited by 32,199
- 2019Sentence-BERT: Sentence Embeddings using Siamese BERT-Networkscited by 9,049
- 2021Evaluating Large Language Models Trained on Codecited by 8,053
- 2022Large Language Models are Zero-Shot Reasonerscited by 4,323
- 2021Program Synthesis with Large Language Modelscited by 3,509
- 2023Sparks of Artificial General Intelligence: Early experiments with GPT-4cited by 2,579
- 2023Code Llama: Open Foundation Models for Codecited by 2,105
- 2023Is Your Code Generated by ChatGPT Really Correct? Rigorous Evaluation of Large Language Models for Code Generationcited by 1,332
- 2020CodeBERT: A Pre-Trained Model for Programming and Natural Languagescited by 1,286
- 2024DeepSeek-Coder: When the Large Language Model Meets Programming -- The Rise of Code Intelligencecited by 1,154
- 2022Program of Thoughts Prompting: Disentangling Computation from Reasoning for Numerical Reasoning Taskscited by 1,057
- 2021Measuring Coding Challenge Competence With APPScited by 879
13 more
- 2023StarCoder: may the source be with you!cited by 790
- 2019CodeSearchNet Challenge: Evaluating the State of Semantic Code Searchcited by 638
- 2022Large Language Models Are Reasoning Teacherscited by 318
- 2022Can language models learn from explanations in context?cited by 248
- 2023The CoT Collection: Improving Zero-shot and Few-shot Learning of Language Models via Chain-of-Thought Fine-Tuningcited by 106
- 2022ReCode: Robustness Evaluation of Code Generation Modelscited by 100
- 2024Code Generation with AlphaCodium: From Prompt Engineering to Flow Engineeringcited by 100
- 2023A Survey of Large Language Models for Code: Evolution, Benchmarking, and Future Trendscited by 66
- 2022MCoNaLa: A Benchmark for Code Generation from Multiple Natural Languagescited by 41
- 2015SourcererCC: Scaling Code Clone Detection to Big Codecited by 40
- 2023Towards Understanding the Capability of Large Language Models on Code Clone Detection: A Surveycited by 14
- 2024DolphCoder: Echo-Locating Code Large Language Models with Diverse and Multi-Objective Instruction Tuningcited by 11
- 2022An ensemble meta-estimator to predict source code testabilitycited by 5
Built on by
Citing papers per year: 2024: 1; 2025: 2; 2026: 2.
5 papers.
- 2025Exploring Multi-Temperature Strategies for Token- and Rollout-Level Control in RLVRcited by 8
- 2024Exploring Empty Spaces: Human-in-the-Loop Data Augmentationcited by 6
- 2025LLM-Supported Natural Language to Bash Translationcited by 2
- 2026Bridging Generation and Training: A Systematic Review of Quality Issues in LLMs for Codecited by 1
- 2026Functional Cache Grafting: Robust and Rapid Code-Policy Synthesis for Embodied Agentscited by 0
- 2026Functional Cache Grafting: Robust and Rapid Code-Policy Synthesis for Embodied Agents11 Jun 2026
- 2026Bridging Generation and Training: A Systematic Review of Quality Issues in LLMs for Code6 May 2026
- 2025Exploring Multi-Temperature Strategies for Token- and Rollout-Level Control in RLVR10 Oct 2025
- 2025LLM-Supported Natural Language to Bash Translation7 Feb 2025
- 2024Exploring Empty Spaces: Human-in-the-Loop Data Augmentation1 Oct 2024