IFEvalCode: Controlled Code Generation

Jian Yang, Wei Zhang, Shukai Liu, Linzheng Chai, Yingshui Tan +7 more
7/30/2025
cs.CL

No confident code implementation found for this paper.

Abstract

Code large language models (Code LLMs) have made significant progress in code generation by translating natural language descriptions into functional code; however, real-world applications often demand stricter adherence to detailed requirements such as coding style, line count, and structural constraints, beyond mere correctness. To address this, the paper introduces forward and backward constraints generation to improve the instruction-following capabilities of Code LLMs in controlled code generation, ensuring outputs align more closely with human-defined guidelines. The authors further present IFEvalCode, a multilingual benchmark comprising 1.6K test samples across seven programming languages (Python, Java, JavaScript, TypeScript, Shell, C++, and C#), with each sample featuring both Chinese and English queries. Unlike existing benchmarks, IFEvalCode decouples evaluation into two metrics: correctness (Corr.) and instruction-following (Instr.), enabling a more nuanced assessment. Experiments on over 40 LLMs reveal that closed-source models outperform open-source ones in controllable code generation and highlight a significant gap between the models' ability to generate correct code versus code that precisely follows instructions.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. Any repos shown below are weak matches — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{yang2025ifevalcode,
  title  = {IFEvalCode: Controlled Code Generation},
  author = {Jian Yang and Wei Zhang and Shukai Liu and Linzheng Chai and Yingshui Tan and Jiaheng Liu and Ge Zhang and Wangchunshu Zhou and Guanglin Niu and Zhoujun Li and Binyuan Hui and Junyang Lin},
  year   = {2025},
  eprint = {2507.22462},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2507.22462v2}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2507.22462.svg)](https://codeofpaper.com/paper/2507.22462)

Discussion