再探追求模块化对代码生成的影响
Revisiting the Impact of Pursuing Modularity for Code Generation
AI总结:
该研究针对大语言模型代码生成场景,引入新型量化指标评估模块化的影响,发现模块化并非提升代码生成性能的核心因素,并探究了大语言模型不偏好模块化代码的潜在原因。
摘要:
模块化编程旨在通过整合更小的独立构建模块来构造最终程序,一直被视为软件开发中的理想实践。然而,随着近期基于大语言模型(LLMs)的代码生成智能体兴起,一个问题随之而来:这种传统实践对这些新工具是否同样有效?在本研究中,我们通过引入一种用于量化测量的新型指标,评估了模块化在代码生成中的影响。令人意外的是,与该主题的传统认知不同,我们发现模块化并非提升代码生成模型性能的核心因素。我们还探究了相较于非模块化代码,LLMs为何未表现出对模块化代码偏好的潜在原因。
英文摘要:
Modular programming, which aims to construct the final program by integrating smaller, independent building blocks, has been regarded as a desirable practice in software development. However, with the rise of recent code generation agents built upon large language models (LLMs), a question emerges: is this traditional practice equally effective for these new tools? In this work, we assess the impact of modularity in code generation by introducing a novel metric for its quantitative measurement. Surprisingly, unlike conventional wisdom on the topic, we find that modularity is not a core factor for improving the performance of code generation models. We also explore potential explanations for why LLMs do not exhibit a preference for modular code compared to non-modular code.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。