试点 Copilot、Codex 和 StarCoder2:高温、冷提示,还是黑魔法?
Piloting Copilot, Codex, and StarCoder2: Hot Temperature, Cold Prompts, or Black Magic?
AI总结:
本文研究输入参数变化对三个LLM代码助手性能的影响,发现调整参数可大幅提升成功率,但最佳设置因问题而异,并揭示了模型的脆弱性。
摘要:
语言模型是解决日益复杂问题的有前景的解决方案。在软件工程领域,它们最近在代码助手中受到关注,这些助手根据自然语言任务描述(提示)生成程序。它们有潜力节省时间和精力,但仍未被充分理解,限制了其最佳使用。在本文中,我们研究了输入变化对语言模型两种配置的影响,重点关注任务描述、周围上下文、模型创造力和生成解决方案数量等参数。我们设计了特定的操作符来修改这些输入,并将其应用于三个基于LLM的代码助手(Copilot、Codex、StarCoder2)和两个代表算法问题的基准(HumanEval、LeetCode)。我们的研究考察了这些变化是否显著影响程序质量,以及这些影响如何跨模型泛化。我们的结果表明,改变输入参数可以大幅提升性能,在单次生成中达到高达79.27%的成功率,而Codex在默认设置下为22.44%,Copilot为31.1%。在实践中发挥这一潜力具有挑战性,因为我们的研究中存在复杂的相互作用——温度、提示和生成解决方案数量的最佳设置因问题而异。使用StarCoder2复现我们的研究证实了这些发现,表明它们并非特定于模型。我们还发现了令人惊讶的行为(例如,完全移除提示可能是有效的),揭示了模型的脆弱性和改进空间。
英文摘要:
Language models are promising solutions for tackling increasing complex problems. In software engineering, they recently gained attention in code assistants, which generate programs from a natural language task description (prompt). They have the potential to save time and effort but remain poorly understood, limiting their optimal use. In this article, we investigate the impact of input variations on two configurations of a language model, focusing on parameters such as task description, surrounding context, model creativity, and the number of generated solutions. We design specific operators to modify these inputs and apply them to three LLM-based code assistants (Copilot, Codex, StarCoder2) and two benchmarks representing algorithmic problems (HumanEval, LeetCode). Our study examines whether these variations significantly affect program quality and how these effects generalize across models. Our results show that varying input parameters can greatly improve performance, achieving up to 79.27% success in one-shot generation compared to 22.44% for Codex and 31.1% for Copilot in default settings. Actioning this potential in practice is challenging due to the complex interplay in our study - the optimal settings for temperature, prompt, and number of generated solutions vary by problem. Reproducing our study with StarCoder2 confirms these findings, indicating they are not model-specific. We also uncover surprising behaviors (e.g., fully removing the prompt can be effective), revealing model brittleness and areas for improvement.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。