IHEval: Evaluating Language Models on Following the Instruction Hierarchy
Zhihan Zhang, Shiyang Li, Zixuan Zhang, Xin Liu, Haoming Jiang, Xianfeng Tang, Yifan Gao, Zheng Li, Haodong Wang, Zhaoxuan Tan, Yichuan Li, Qingyu Yin, Bing Yin, Meng Jiang
TL;DR
This paper addresses the gap in evaluating language models on their ability to follow an instruction hierarchy that prioritizes system over user inputs, history, and tool outputs. It introduces IHEval, a programmable benchmark with 3,538 examples across nine tasks and four input types, designed to assess performance under aligned, conflict, and reference settings. Across 13 models, the study finds substantial performance drops when instructions conflict, with open-source models often under 50% accuracy in resolving conflicts, while larger models show better but incomplete resilience to hierarchy. The results reveal that current LMs struggle to internalize the hierarchy, with sensitivity to instruction strictness and minimal gains from prompting, underscoring a need for dedicated training to optimize hierarchical instruction following and to improve safety and reliability in real-world deployments.
Abstract
The instruction hierarchy, which establishes a priority order from system messages to user messages, conversation history, and tool outputs, is essential for ensuring consistent and safe behavior in language models (LMs). Despite its importance, this topic receives limited attention, and there is a lack of comprehensive benchmarks for evaluating models' ability to follow the instruction hierarchy. We bridge this gap by introducing IHEval, a novel benchmark comprising 3,538 examples across nine tasks, covering cases where instructions in different priorities either align or conflict. Our evaluation of popular LMs highlights their struggle to recognize instruction priorities. All evaluated models experience a sharp performance decline when facing conflicting instructions, compared to their original instruction-following performance. Moreover, the most competitive open-source model only achieves 48% accuracy in resolving such conflicts. Our results underscore the need for targeted optimization in the future development of LMs.
