评测大模型在多轮交互中按指令生成代码的能力,填补现有基准空白。
CodeIF-Bench: Evaluating Instruction-Following Capabilities of Large Language Models in Interactive Code Generation
- 构建九类可验证指令,支持多轮交互场景下的客观评估
- 6个主流大模型在动态对话中平均遵循率仅63.2%
- 揭示上下文管理是提升指令遵循能力的关键瓶颈
大型语言模型(LLMs)在代码生成任务中表现出色,已成为开发者不可或缺的编程助手。然而,现有代码生成基准主要评估单轮交互中代码的功能正确性,难以反映模型在多轮交互中严格遵循用户指令的能力。本文提出CodeIF-Bench,一个用于评估大模型在交互式代码生成中指令遵循能力的基准。该基准包含九类与真实软件开发需求对齐的可验证指令,可通过指定测试用例独立、客观地验证。我们在静态对话和动态对话两种设置下,评估了6个顶尖大模型的表现,并总结出影响指令遵循能力的重要因素:额外仓库上下文及逐渐增加的交互历史。此外,我们识别出改进方向:上下文管理。代码与数据已公开于https://github.com/zhu-zhu-ding/CodeIF-Bench。
原文摘要 · Abstract (English)
Large Language Models (LLMs) have demonstrated exceptional performance in code generation tasks and have become indispensable programming assistants for developers. However, existing code generation benchmarks primarily assess the functional correctness of code generated by LLMs in single-turn interactions. They offer limited insight into LLMs' abilities to generate code that strictly follows users' instructions in multi-turn interaction scenarios. In this paper, we introduce CodeIF-Bench, a benchmark for evaluating the instruction-following capabilities of LLMs in interactive code generation. Specifically, CodeIF-Bench incorporates nine types of verifiable instructions aligned with the real-world software development requirements, which can be independently and objectively validated through specified test cases, facilitating the evaluation of instruction-following capability in multi-turn interactions. In both Static Conversation and Dynamic Conversation settings, we evaluate the performance of 6 state-of-the-art LLMs and summarize the important factors, additional repository context and gradually increasing interaction history influencing the instruction-following ability of LLMs in multi-turn interactions. Furthermore, we identify the potential direction for improvement: context management. The code and data are available at \href{https://github.com/zhu-zhu-ding/CodeIF-Bench}{https://github.com/zhu-zhu-ding/CodeIF-Bench}.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。