DivAlgo: A systematic evaluation of algorithmic diversity for code generation models
Abstract
Code generation models are actively being used in professional and educational settings. However, the competence of large language models (LLMs) to generate algorithmically diverse code remains largely unknown. We propose the DivAlgo benchmark, a large-scale dataset constituting algorithmically diverse solutions to programming problems. We also introduce a lightweight similarity metric to enable large-scale evaluation. Our experiments across 24 modern code generation models found that uncontrolled model-generated code is significantly less diverse than human solutions (capturing ~31% of human diversity), and even the best diverse code generation strategy could achieve only ~70% of human diversity. Moreover, while it was possible to steer the models to generate solutions based on human strategies, they were unable to reproduce the diversity of the human solutions. These findings indicate the limitations of code generation models in capturing the algorithmic diversity humans exhibit, and that overexposure to model-generated code can narrow programmers' algorithmic vocabulary.
Create a lesson
Metadata
- Categories
- cs.SE, cs.CL
- Comments
- 24 pages, 18 figures
Related papers
Benchmarking the Quantum Leap: Auditing LLM Evaluation for Quantum Code Generation
Shared title terminologycs.SEEthan Seefried, Romit Ghosh, Sharmin Afrose et al.
SCCGBench: Executability-Oriented Evaluation for Real-World Web Service-Call Code Generation
Shared title terminologycs.SEShuo Wang, Guodong Fan, Ming Zhu et al.
fx(hash): Salvaging The Source Code of 28k Generative Artworks
Shared title terminologycs.SEBenoit Baudry, Valeriia Bezklynska, Martin Monperrus
Micro Operational Robustness of LLMs on Code Generation
Shared title terminologycs.SEDebalina Ghosh Paul, Hong Zhu, Ian Bayley
From Observation to Explanation: Mechanistic Interpretability of LLM-Generated Code for Principled Repair
Shared title terminologycs.SEMusfiqur Rahman
Static Analysis Guidance for Secure LLM Code Generation
Shared title terminologycs.SEDaniele Lunghi, Alberick Euraste Djiré, Zacharie Chenail-Larcher et al.