代码大模型评测易受提示词微小变化影响,需重新评估基准可靠性。
Re-Evaluating Code LLM Benchmarks Under Semantic Mutation
- 提出语义保真的提示词变异框架,保持结构与含义一致。
- 8个任务100个相似提示下,模型表现波动显著,排名不稳定。
- 警示评测设计需考虑提示敏感性,尤其对开源代码模型评估。
在大语言模型时代,代码基准测试已成为软件工程的重要研究方向,并被广泛应用于实践。这些基准测试用于评估大模型在代码理解与生成等任务中的性能。构建代码基准的关键步骤是提示词设计。然而,现有代码基准通常每个任务仅使用单一提示模板,易受提示敏感性影响——微小的提示变化可能导致性能大幅波动,从而导致模型能力评估不可靠。尽管已有研究探讨过提示敏感性,但其实验设计和结论仅限于传统自然语言处理任务。本文首次针对代码基准开展实证研究,提出一种通用框架,可在最大程度保持提示语义与结构的前提下进行变异。基于该框架,我们在10个代表性开源大模型上对8个代码基准任务进行了广泛实验,每个任务包含100个语义相近的提示模板。通过多种统计指标分析结果,重点关注模型绝对与相对性能表现。发现即使微小的提示变化也会引发性能显著波动,且可能造成不同模型间性能排名不一致。这些发现表明,在未来代码基准设计中必须考虑提示敏感性,以确保模型能力评估的可靠性和准确性。
原文摘要 · Abstract (English)
In the era of large language models (LLMs), code benchmarks have become an important research area in software engineering and are widely used by practitioners. These benchmarks evaluate the performance of LLMs on specific code-related tasks, such as code understanding and generation. A critical step in constructing code benchmarks is the design of prompts. However, as existing code benchmarks typically rely on a single prompt template per task, they are prone to the issue of prompt sensitivity, where minor prompt variations could result in substantial performance variations, leading to unreliable evaluations of model capabilities. While previous studies have explored prompt sensitivity, their experimental designs and findings are limited to traditional natural language processing (NLP) tasks. In this paper, we present an empirical study to investigate prompt sensitivity in code benchmarks. We first propose a general framework that modifies prompt templates in a manner that preserves both their semantics and their structure as much as possible. Based on the framework, we conduct extensive experiments across eight code benchmark tasks on 10 representative open-source LLMs, with each task featuring 100 semantically similar prompt templates. We then analyze the evaluation results using various statistical metrics, focusing on both absolute and relative model performance. Our findings suggest that even slight prompt variations can lead to significant shifts in performance. Additionally, we observe that such variations can introduce inconsistencies in the performance rankings across different models. These insights highlight the need for considering prompt sensitivity when designing future code benchmarks, to ensure more reliable and accurate evaluation of LLM capabilities.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。