arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2507.00699cs.SE
收藏

具有多轮反馈的细粒度代码指令遵循的分层与可演化基准

A Hierarchical and Evolvable Benchmark for Fine-Grained Code Instruction Following with Multi-Turn Feedback

Guoliang Duan, Mingwei Liu, Yanlin Wang, Chong Wang, Xin Peng, Zibin Zheng

AI总结:

本文提出MultiCodeIF基准,通过结构化约束分类与多轮反馈评估LLM代码指令遵循能力,发现模型在隐式与多层级约束上表现较差,但结构化反馈可显著提升约束满足率。

摘要:

大型语言模型(LLMs)在代码生成方面取得了显著进展,但它们遵循具有分层和多样化约束的复杂编程指令的能力仍有待深入研究。现有基准通常优先考虑功能正确性,忽略了实际开发中存在的细微要求。我们引入了MultiCodeIF,这是一个全面的基准,旨在评估代码生成中跨多个维度的指令遵循能力:约束类型、分层级别和迭代细化。基于包含9个类别和27个约束类型的结构化分类体系,MultiCodeIF能够对功能性和非功能性指令遵守情况进行细粒度评估。使用自动化流水线ConstraGen,我们合成并演化了源自14种编程语言的2,021个代码任务,通过反馈驱动的任务变体支持多轮评估。对六个最先进的LLMs的实证评估揭示了显著的性能差异。表现最佳的模型Claude-3-7-Sonnet实现了63.0%的平均约束满足率,而较小的模型如Qwen3-1.7B则降至44.8%。模型在显式约束上表现良好,但在隐式或抽象约束上表现挣扎。具有多个分层约束的任务显著降低了模型成功率,从单级别的54.5%降至多级别场景的仅18.8%。然而,结构化反馈实现了渐进式改进:在四轮迭代细化中,平均约束满足率从63.0%上升至83.4%。MultiCodeIF提供了一个可扩展、约束感知且反馈敏感的框架,用于在现实代码生成场景中对LLMs进行基准测试,弥合了合成评估与真实世界指令复杂性之间的差距。完整的基准数据集、评估流水线和源代码可在https://github.com/SYSUSELab/MultiCodeIF获取。

英文摘要:

Large language models (LLMs) have advanced significantly in code generation, yet their ability to follow complex programming instructions with layered and diverse constraints remains underexplored. Existing benchmarks often prioritize functional correctness, overlooking the nuanced requirements found in real-world development. We introduce MultiCodeIF, a comprehensive benchmark designed to evaluate instruction-following in code generation across multiple dimensions: constraint type, hierarchical levels, and iterative refinement. Built upon a structured taxonomy of 9 categories and 27 constraint types, MultiCodeIF enables granular assessment of both functional and non-functional instruction adherence. Using an automated pipeline, ConstraGen, we synthesize and evolve 2,021 code tasks sourced from 14 programming languages, supporting multi-turn evaluation through feedback-driven task variants. Empirical evaluation of six state-of-the-art LLMs uncovers substantial performance disparities. The top-performing model, Claude-3-7-Sonnet, achieves 63.0% average constraint satisfaction, while smaller models like Qwen3-1.7B fall to 44.8%. Models perform well on explicit constraints, but struggle with implicit or abstract constraints. Tasks with multiple hierarchical constraints significantly reduce model success rates, from 54.5% in single-level to just 18.8% in multi-level scenarios. However, structured feedback enables progressive improvement: average constraint satisfaction rises from 63.0% to 83.4% over four iterative refinement rounds. MultiCodeIF provides a scalable, constraint-aware, and feedback-sensitive framework to benchmark LLMs under realistic code generation scenarios, bridging the gap between synthetic evaluations and real-world instruction complexity. The full benchmark dataset, evaluation pipeline, and source code are available at https://github.com/SYSUSELab/MultiCodeIF.

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

↑