mlsanityData to 7 Oct 2026

Is Functional Correctness Enough to Evaluate Code Language Models? Exploring Diversity of Generated Codes

arXiv 2408.14504 ↗First posted 24 Aug 2024cs.SE cs.AI cs.PLcited by 5

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

  1. 2020Language Models are Few-Shot Learnerscited by 32,199
  2. 2019Sentence-BERT: Sentence Embeddings using Siamese BERT-Networkscited by 9,049
  3. 2021Evaluating Large Language Models Trained on Codecited by 8,053
  4. 2022Large Language Models are Zero-Shot Reasonerscited by 4,323
  5. 2021Program Synthesis with Large Language Modelscited by 3,509
  6. 2023Sparks of Artificial General Intelligence: Early experiments with GPT-4cited by 2,579
  7. 2023Code Llama: Open Foundation Models for Codecited by 2,105
  8. 2023Is Your Code Generated by ChatGPT Really Correct? Rigorous Evaluation of Large Language Models for Code Generationcited by 1,332
  9. 2020CodeBERT: A Pre-Trained Model for Programming and Natural Languagescited by 1,286
  10. 2024DeepSeek-Coder: When the Large Language Model Meets Programming -- The Rise of Code Intelligencecited by 1,154
  11. 2022Program of Thoughts Prompting: Disentangling Computation from Reasoning for Numerical Reasoning Taskscited by 1,057
  12. 2021Measuring Coding Challenge Competence With APPScited by 879
13 more
  1. 2023StarCoder: may the source be with you!cited by 790
  2. 2019CodeSearchNet Challenge: Evaluating the State of Semantic Code Searchcited by 638
  3. 2022Large Language Models Are Reasoning Teacherscited by 318
  4. 2022Can language models learn from explanations in context?cited by 248
  5. 2023The CoT Collection: Improving Zero-shot and Few-shot Learning of Language Models via Chain-of-Thought Fine-Tuningcited by 106
  6. 2022ReCode: Robustness Evaluation of Code Generation Modelscited by 100
  7. 2024Code Generation with AlphaCodium: From Prompt Engineering to Flow Engineeringcited by 100
  8. 2023A Survey of Large Language Models for Code: Evolution, Benchmarking, and Future Trendscited by 66
  9. 2022MCoNaLa: A Benchmark for Code Generation from Multiple Natural Languagescited by 41
  10. 2015SourcererCC: Scaling Code Clone Detection to Big Codecited by 40
  11. 2023Towards Understanding the Capability of Large Language Models on Code Clone Detection: A Surveycited by 14
  12. 2024DolphCoder: Echo-Locating Code Large Language Models with Diverse and Multi-Objective Instruction Tuningcited by 11
  13. 2022An ensemble meta-estimator to predict source code testabilitycited by 5

Built on by

Cited by year (2026 to 7 Oct)

Citing papers per year: 2024: 1; 2025: 2; 2026: 2.

5 papers.