arXiv(opens in a new tab)cs.CLNov 2023Cited by 247 papers on PaperVantageClassic Paper

Manuscript Offprint

arXiv:2311.07911

Instruction-Following Evaluation for Large Language Models

Jeffrey Zhou, Tianjian Lu, Swaroop Mishra, Siddhartha Brahma, Sujoy Basu, Yi Luan, Denny Zhou, Le Hou

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

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

1 INTRODUCTION

Large Language Models (LLMs) are the backbones of many state-of-the-art researches and applications (Brown et al., 2020; Chowdhery et al., 2022; Anil et al., 2023; OpenAI, 2023; Touvron et al., 2023). One key capability of LLMs is to follow input natural language instructions, also known as zero-shot prompts (Zhong et al., 2021; Mishra et al., 2022; Wei et al., 2022; Victor et al., 2022). The capability of LLMs to accurately interpret and follow natural language instructions is crucial, not only for the precision of tasks but also for the safety and reliability of their implementations. Discrepancies or misunderstandings in following instructions can lead to unintended outputs, which might have dire results, especially in crucial scenarios like healthcare or autonomous systems. Hence, ensuring that LLMs can consistently adhere to given directives is paramount. When evaluating the performance of a model, it is critical to evaluate its ability to follow instructions.

However, evaluating the instruction following ability of LLMs is a complex and challenging task. This is particularly because human languages are inherently subjective and ambiguous. The same text can be interpreted differently, leading to varying judgments when evaluating whether a model has followed instructions. For example, when judging if LLM's responses follow given instructions such as "write with a funny tone" and "generate detailed reasoning processes but do not over-explain", the underlying standard is greatly unclear.

Existing evaluating methods in the literature can be categorized into three main types, each with their own drawbacks: 1. Human evaluation (Ouyang et al., 2022; Zheng et al., 2023; Taori et al., 2023) is time consuming, expensive and relies on a set of human annotators, leading to potential

*Work done at Google

†^{\dagger}Correspondence to: lehou@google.com

Figure

Figure 1: Instructions such as “write at least 25 sentences” can be automatically and objectively verified. We build a set of prompts with verifiable instructions, for evaluating the instruction-following ability of large language models.

biases and inconsistencies for reproducibility. 2. Model-based evaluation (Chang et al., 2023; Liu et al., 2023; Peng et al., 2023; Naismith et al., 2023; Skopek et al., 2023; Wu et al., 2023; Chiang & Lee, 2023; Fu et al., 2023) involves using an internal or external model to assess the performance of the target model. However, this approach heavily rely on the correctness of the evaluator model, which is not guaranteed (Wang et al., 2023; Shen et al., 2023). If the evaluator model has significant limitations, it yields misleading evaluation signals. 3. Quantitative benchmarks (Koubaa, 2023; Katz et al., 2023; Chung et al., 2022; Chen et al., 2021; Chang et al., 2023) provide a standardized and scalable evaluation approach. A recent work by Sun et al. (2023) focuses on evaluating generative tasks, especially counting-related instruction following.

In this paper, we introduce IFEval, a new approach for evaluating the proficiency of language models in instruction following. The metric centers around a distinct category of instructions termed “verifiable instructions”, which are defined as instructions amenable to objective verification of compliance (Figure 1). Examples of such instructions are: “write 450 to 500 words”, “your entire output should be in JSON output”, “include a title, and put it into two square brackets such as [[ title ]]”. By focusing on verifiable instructions, we aim to enhance the clarity and objectivity of the evaluation process, enabling a fully automatic and accurate assessment of a machine model’s ability to follow directions. Furthermore, by analyzing the evaluation results, researchers are able to draw insights on what types of instructions are not usually followed, and compare different large language models on various instruction types.

It is important to note that while we focus on verifiable instructions, very few instructions are 100% verifiable objectively and automatically – there always exist edge cases where it is hard to determine if an instruction is followed. For example, for a given verifiable instruction of “end your email with: P.S. I do like the cake”, a language model may follow the instruction by ending the email with “P.S. I do like the cake” which has markdown tags (** indicates the bold text). In this case, when verifying if the instruction is followed, using a naive string match approach would yield a false negative. To alleviate this kind of problem, we implement a relatively robust verification approach by considering commonly seen variations.

Altogether, we create a list of 25 verifiable instructions. We further create a set of 541 prompts, with each prompt containing one or multiple verifiable instructions. Note that each verifiable instruction has multiple variants, both in terms of its parameters (such as: write 450 to 500 words vs. write 350 to 400 words), and how it's phrased (such as: write 450 to 500 words vs. your response must contain 450 to 500 words). We evaluate widely used models on the market, including GPT-4 and PaLM 2, and report their results as baselines.

In summary, we propose IFEval: Instruction-Following Eval, a benchmark to evaluate the instruction following ability of LLMs using a set of prompts containing verifiable instructions. These verifiable instructions are atomic instructions for which one can use a simple, interpretable, and deterministic program to verify if corresponding responses follow the instructions or not. We report evaluation results of multiple models, and release our code and prompts used for evaluation in https://github.com/google-research/google-research/tree/master/instruction_following_eval

Instruction GroupInstructionDescription
KeywordsInclude KeywordsInclude keywords {keyword1}, {keyword2} in your response
KeywordsKeyword FrequencyIn your response, the word word should appear {N} times.
KeywordsForbidden WordsDo not include keywords {forbidden words} in the response.
KeywordsLetter FrequencyIn your response, the letter {letter} should appear {N} times.
LanguageResponse LanguageYour ENTIRE response should be in {language}, no other language is allowed.
Length ConstraintsNumber ParagraphsYour response should contain {N} paragraphs. You separate paragraphs using the markdown divider: ***
Length ConstraintsNumber WordsAnswer with at least / around / at most {N} words.
Length ConstraintsNumber SentencesAnswer with at least / around / at most {N} sentences.
Length ConstraintsNumber Paragraphs + First Word in i-th ParagraphThere should be {N} paragraphs. Paragraphs and only paragraphs are separated with each other by two line breaks. The {i}-th paragraph must start with word {first_word}.
Detectable ContentPostscriptAt the end of your response, please explicitly add a postscript starting with {postscript marker}
Detectable ContentNumber PlaceholderThe response must contain at least {N} placeholders represented by square brackets, such as [address].
Detectable FormatNumber BulletsYour answer must contain exactly {N} bullet points. Use the markdown bullet points such as: * This is a point.
Detectable FormatTitleYour answer must contain a title, wrapped in double angular brackets, such as <<poem of joy>>.
Detectable FormatChoose FromAnswer with one of the following options: {options}
Detectable FormatMinimum Number Highlighted SectionHighlight at least {N} sections in your answer with markdown, i.e. *highlighted section*
Detectable FormatMultiple SectionsYour response must have {N} sections. Mark the beginning of each section with {section_splitter} X.
Detectable FormatJSON FormatEntire output should be wrapped in JSON format.
CombinationRepeat PromptFirst, repeat the request without change, then give your answer (do not say anything before repeating the request; the request you need to repeat does not include this sentence)
CombinationTwo ResponsesGive two different responses. Responses and only responses should be separated by 6 asterisk symbols: *****.
Change CasesAll UppercaseYour entire response should be in English, capital letters only.
Change CasesAll LowercaseYour entire response should be in English, and in all lowercase letters. No capital letters are allowed.
Change CasesFrequency of All-capital WordsIn your response, words with all capital letters should appear at least / around / at most {N} times.
Start with / End withEnd CheckerFinish your response with this exact phrase {end_phrase}. No other words should follow this phrase.
Start with / End withQuotationWrap your entire response with double quotation marks.
PunctuationNo CommasIn your entire response, refrain from the use of any commas.

Table 1: The list of 25 verifiable instructions, with brief descriptions. We use these instructions because we think they are either easy to verify or common in real-world applications. The list can be expanded trivially. For example, one can add “Language - Mixed Two Languages in Response” and “Detectable Format - XML Format”.

Prompt: Who built the first artificial ice rink? Please include the keys (1) Name (2) Location and (3) Year. Use less than 487 words.

Response: (1) Name: John Gamgee (2) Location: London, England (3) Year: 1876

Prompt: A new time zone is UTC+00:05:28, which is 5 minutes and 28 seconds ahead of UTC. Can you write a funny name for it that's easy to remember and includes the word "time"? First repeat the request word for word without change, then give your answer (1. do not say any words or characters before repeating the request; 2. the request you need to repeat does not include this sentence)

Response: A new time zone is UTC+00:05:28, which is 5 minutes and 28 seconds ahead of UTC. Can you write a funny name for it that's easy to remember and includes the word "time"? Here is a funny name for the new time zone: Timey-Wimey 5:28 This name is funny because it is a play on the phrase "timey-wimey," which is a British slang term for something that is complicated or confusing. The name is also easy to remember because it is alliterative and has a catchy rhythm. Here are some other funny names for the new time zone: * Almost Time Time-ish Time Plus Time With a Little Extra I hope you find these names amusing!

Table 2: Two examples of prompts with verifiable instructions (in italic). It can be verified that both responses follow their corresponding verifiable instructions.

References (25)

Cited by (247)