Complex Logical Instruction Generation
Mian Zhang, Shujian Liu, Sixun Dong, Ming Yin, Yebowen Hu, Xun Wang, Steven Ma, Song Wang, Sathish Reddy Indurthi, Haoyun Deng, Zhiyu Zoey Chen, Kaiqiang Song
TL;DR
This work tackles the evaluation gap in instruction-following when tasks require intricate logic by introducing LogicIFGen, a scalable framework that converts code functions into verifiable, logic-rich natural-language instructions, and LogicIFEval, a 426-task benchmark built from challenging simulation problems. The approach anonymizes functions, augments them with state trackers, and uses multi-turn generation and verification to ensure instructions precisely implement the full underlying logic, with complexity quantified via AST-based metrics. Experimental results reveal a substantial performance gap among both frontier and open-source LLMs, with best models around 85% accuracy while many lag below 60%, and a clear degradation as logic complexity increases. The findings suggest explicit thinking can improve instruction-following for large models and point to future work where LogicIFGen could support training and evaluation to build more robust, logic-aware agents and tools.
Abstract
Instruction following has catalyzed the recent era of Large Language Models (LLMs) and is the foundational skill underpinning more advanced capabilities such as reasoning and agentic behaviors. As tasks grow more challenging, the logic structures embedded in natural language instructions becomes increasingly intricate. However, how well LLMs perform on such logic-rich instructions remains under-explored. We propose LogicIFGen and LogicIFEval. LogicIFGen is a scalable, automated framework for generating verifiable instructions from code functions, which can naturally express rich logic such as conditions, loops, and function calls. We further curate a collection of complex code functions and use LogicIFGen to construct LogicIFEval, a benchmark comprising 426 verifiable logic-rich instructions. Our experiments demonstrate that current state-of-the-art LLMs still struggle to correctly follow the instructions in LogicIFEval. Most LLMs can only follow fewer than 60% of the instructions, revealing significant deficiencies in the instruction-following ability. Code and Benchmark: https://github.com/mianzhang/LogicIF
