arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2512.17387cs.SEcs.CL
收藏

CIFE:代码指令遵循评估

CIFE: Code Instruction-Following Evaluation

IIT Bombay(印度班加罗尔理工学院);IBM Research India(IBM印度研究)

Sravani Gunnu, Shanmukha Guttula, Hima Patel

AI总结:

CIFE评估了1000个Python任务的代码生成模型,通过13类约束测试,揭示了模型在遵循开发者要求方面的不足,提出C2A分数衡量正确性与约束遵循性。

摘要:

大型语言模型(LLMs)越来越多地应用于现实世界中的代码生成,其中仅功能性正确性不足以保证可靠的部署,开发者还期望模型能够遵循显式要求以确保稳健性、格式和安全性。现有基准主要通过测试用例执行来评估正确性,提供有限的关于模型如何可靠地遵循这些约束的见解。我们引入了一个包含1000个Python任务的基准,每个任务配对平均7个开发者指定的约束,涵盖13个类别。约束通过四阶段的人机流程进行筛选,以确保其原子性、相关性和客观性。我们使用互补的遵循度指标评估了14个开源和闭源模型,并提出了C2A分数,一个综合度量,同时捕捉正确性和约束遵循性。结果揭示了部分满足和严格满足之间存在显著差距,而强大的模型在部分满足方面达到90%以上,严格满足仍在39-66%之间。这些发现强调,可信赖的代码生成不仅需要正确性,还需要一致地遵循开发者意图。

英文摘要:

Large Language Models (LLMs) are increasingly applied to real-world code generation, where functional correctness alone is insufficient for reliable deployment, developers also expect adherence to explicit requirements for robustness, formatting, and security. Existing benchmarks primarily assess correctness through test-case execution, offering limited insight into how reliably models follow such constraints. We introduce a benchmark of 1,000 Python tasks, each paired with an average of 7 developer-specified constraints spanning 13 categories. Constraints are curated through a four-stage human-LLM pipeline to ensure they are atomic, relevant, and objective. We evaluate 14 open- and closed-source models using complementary adherence metrics and propose the C2A Score, a composite measure that jointly captures correctness and constraint compliance. Results reveal a substantial gap between partial and strict satisfaction, while strong models achieve over 90% partial adherence, strict adherence remains between 39-66%. These findings highlight that trustworthy code generation requires not only correctness but also consistent adherence to developer intent.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑