paper-with-me

홈 › Papers

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

2024-08-24 · Heejae Chon, Seonghyeon Lee, Jinyoung Yeo, Dongha Lee

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.

📄 PDF Abstract BibTeX arXiv:2408.14504

Code (1)

0914eagle/code-diversity 공식 구현 pytorch

Tasks

Code GenerationDiversity

Similar Papers 제목 키워드 기반

NoFunEval: Funny How Code LMs Falter on Requirements Beyond Functional Correctness

2024-01-29 · Manav Singhal, Tushar Aggarwal, Abhijeet Awasthi, Nagarajan Natarajan 외

Existing evaluation benchmarks of language models of code (code LMs) focus almost exclusively on whether the LMs can generate functionally-correct code. In real-world software engineering, developers think beyond functio…

HumanEval

On the Limitations of Embedding Based Methods for Measuring Functional Correctness for Code Generation

2024-04-26 · Atharva Naik

The task of code generation from natural language (NL2Code) has become extremely popular, especially with the advent of Large Language Models (LLMs). However, efforts to quantify and track this progress have suffered due…

Code GenerationHumanEval

An Empirical Study of Security Calibration in Large Language Models for Code

2026-06-30 · Mohammed Latif Siddiq, Md. Nafiu Rahman, Joanna C. S. Santos arxiv

Large Language Models (LLMs) are rapidly transforming software development, yet their use in security-critical contexts raises a key question: do models know when their generated code is insecure? This property, known as…

Insights from Verification: Training a Verilog Generation LLM with Reinforcement Learning with Testbench Feedback

2025-04-22 · Ning Wang, Bingkun Yao, Jie zhou, Yuchen Hu 외

Large language models (LLMs) have shown strong performance in Verilog generation from natural language description. However, ensuring the functional correctness of the generated code remains a significant challenge. This…

Code GenerationHallucinationReinforcement Learning (RL)

Aligning Offline Metrics and Human Judgments of Value for Code Generation Models

2022-10-29 · Victor Dibia, Adam Fourney, Gagan Bansal, Forough Poursabzi-Sangdeh 외

Large language models have demonstrated great potential to assist programmers in generating code. For such human-AI pair programming scenarios, we empirically demonstrate that while generated code is most often evaluated…

Code Generation