Abstract
One core capability of Large Language Models (LLMs) is to follow natural language instructions. However, the evaluation of such abilities is not standardized: Human evaluations are expensive, slow, and not objectively reproducible, while LLM-based auto-evaluation is potentially biased or limited by the ability of the evaluator LLM. To overcome these issues, we introduce Instruction-Following Eval (IFEval) for large language models. IFEval is a straightforward and easy-to-reproduce evaluation benchmark. It focuses on a set of "verifiable instructions" such as "write in more than 400 words" and "mention the keyword of AI at least 3 times". We identified 25 types of those verifiable instructions and constructed around 500 prompts, with each prompt containing one or more verifiable instructions. We show evaluation results of two widely available LLMs on the market. Our code and data can be found at https://github.com/google-research/google-research/tree/master/instruction_following_eval
Introduction
As Large Language Models (LLMs) become the backbone of complex production systems, their ability to follow precise instructions is paramount for safety and reliability. Whether it is formatting a response as JSON or adhering to a strict word count, instruction following is a critical utility feature. However, evaluating this ability is notoriously difficult. Current methods generally fall into three buckets: expensive and subjective human evaluation, biased "LLM-as-a-judge" systems, or task-specific benchmarks that fail to capture general constraint adherence.
To address these challenges, we introduce Instruction-Following Eval (IFEval). This benchmark provides an objective, scalable, and reproducible framework by focusing on "verifiable instructions"—atomic constraints that can be checked by a deterministic program rather than a human or another model.
The IFEval Framework
The core innovation of IFEval is the identification of 25 types of verifiable instructions. These are grouped into categories such as Keywords (including or forbidding specific words), Format (JSON wrapping, specific bullet points), Length (word, sentence, or paragraph counts), and Punctuation constraints.
Methodology and Dataset Construction
The IFEval dataset consists of 541 prompts synthesized through a four-step pipeline: base generation, filtering illogical combinations, rephrasing for linguistic diversity, and final manual curation. To account for the conversational nature of LLMs, we employ two scoring metrics:
- Strict Metric: An exact check of the raw model output.
- Loose Metric: A check performed after stripping common conversational "chatter" (e.g., "Sure, here is the response:") to avoid penalizing models for being overly helpful.
Experimental Results
We baselined two prominent models: GPT-4 (November 2023) and PaLM 2 Small (August 2023). The results demonstrate a significant performance gap between state-of-the-art models and smaller counterparts, while also highlighting universal challenges in constraint adherence.
| Model | Prompt-level Strict Accuracy | Instruction-level Strict Accuracy |
|---|---|---|
| GPT-4 | 76.89% | 83.57% |
| PaLM 2 S | 43.07% | 55.76% |
GPT-4 significantly outperformed PaLM 2 S across almost all categories, particularly in Language and Punctuation constraints. However, even GPT-4 failed nearly 25% of the prompts at a strict level. Both models struggled most with Length Constraints and Combinations, suggesting that tracking word counts and managing multiple simultaneous rules remains a significant cognitive challenge for current architectures.
Conclusion
IFEval provides a necessary "unit testing" framework for LLM instruction following. By narrowing the scope to what can be objectively verified, it offers a clear signal for model developers to improve reliability. Future work will expand the benchmark to include multi-modal verifiable instructions and a broader diversity of atomic constraints.
Summary updated