arXiv:2412.08109cs.SEcs.AI2024-12中稿 · the 47th Internati…被引 18

用代码混淆技术更真实地评估大模型的代码生成能力。

Unseen Horizons: Unveiling the Real Capability of LLM Code Generation Beyond the Familiar

  • 通过符号、结构、语义三层混淆构建新评测集
  • 混淆后模型测试通过率平均下降62.5%
  • 适合关注模型真实能力而非数据泄露的开发者

大语言模型在代码生成上表现强劲,但现有评估存在‘熟识幻觉’问题:因训练数据中代码重复暴露、案例过时及依赖缺失,导致评估结果虚高。本文提出OBFUSEVAL基准,从五个真实项目收集1354个原始案例,采用符号、结构、语义三层次混淆策略改写描述、代码与依赖关系,在保证功能一致前提下实现代码去曝光。在四个LLM上测试,使用项目官方测试套件评估生成代码质量。结果显示,混淆后平均测试通过率下降达62.5%,揭示当前评估方法的严重偏差,验证了新基准对真实能力的更可靠测量。

原文摘要 · Abstract (English)

Recently, large language models (LLMs) have shown strong potential in code generation tasks. However, there are still gaps before they can be fully applied in actual software development processes. Accurately assessing the code generation capabilities of large language models has become an important basis for evaluating and improving the models. Some existing works have constructed datasets to evaluate the capabilities of these models. However, the current evaluation process may encounter the illusion of "Specialist in Familiarity", primarily due to three gaps: the exposure of target code, case timeliness, and dependency availability. The fundamental reason for these gaps is that the code in current datasets may have been extensively exposed and exercised during the training phase, and due to the continuous training and development of LLM, their timeliness has been severely compromised. The key to solve the problem is to, as much as possible, evaluate the LLMs using code that they have not encountered before. Thus, the fundamental idea in this paper is to draw on the concept of code obfuscation, changing code at different levels while ensuring the functionality and output. To this end, we build a code-obfuscation based benchmark OBFUSEVAL. We first collect 1,354 raw cases from five real-world projects, including function description and code. Then we use three-level strategy (symbol, structure and semantic) to obfuscate descriptions, code and context dependencies. We evaluate four LLMs on OBFU- SEVAL and compared the effectiveness of different obfuscation strategy. We use official test suites of these projects to evaluate the generated code. The results show that after obfuscation, the average decrease ratio of test pass rate can up to 62.5%.

代码生成模型评估混淆技术LLM

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。