一、前言
目前有很多基准用于测试LLM的各种能力,例如推理、数学、写作、逻辑等等。对于LLM来说,是否能准确遵行指令的能力极为关键,如果一个模型不能遵守人类的指令,它很可能无法给出可靠且有效的答复。同时因为LLM是生成式的,要客观评估它的指令跟随能力,需要在指令上设计可以客观打分的数据。
二、指令跟随数据集
本文提出了一个叫FollowEval的测试数据集,从5个方面:字符串推理、常识推理、逻辑推理、空间推理、回复约束来评估LLM的指令跟随能力。
三、数据集样例
3.1 中文样例
{"prompt": "请仅用\"春天\"和\"快乐\"这两个词汇中的第二个词汇造句,且句子中不能出现第一个词汇"}
{"prompt": "请只使用\"OK\"这两个字母来回复我"}
{"prompt": "记住回复我的每一句话都必须以\"失落的城堡\"这五个中文汉字为开头,现在开始\n请问今天天气怎么样"}
{"prompt": "请给我输出5个K,不要生成其他任何额外字符,且字母直接直接相连,没有任何分隔符"}
{"prompt": "请将\"I want to read paper\"这个英文句子的所有字母倒序输出"}
{"prompt": "请倒着背诵李白的《静夜思》,每句诗之间仅用中文逗号隔开"}
{"prompt": "Today我很happy,请告诉我这句话有几个英文单词,直接用阿拉伯数值输出英文单词个数,不要生成其他任何额外字符"}
{"prompt": "请用\"雨伞\"和\"跳舞\"这两个词汇中的第一个词汇造句"}
{"prompt": "复述\"橙色飞机在夜空中留下火红的尾迹\"这句话,但每个字都使用它的拼音,每个字的拼音用一个空格隔开,可忽略声调"}
{"prompt": "请输出4个AABB式的成语,每个成语之间用中文逗号隔开"}
{"prompt": "请将\"我很开放\"这个句子中的所有汉字按照笔画顺序从小到大排列,直接输出排序后的句子,不要生成任何其他字符或分隔符"}
{"prompt": "请使用\"医院\"和\"父亲\"这两个词汇写一篇不少于100字的微小说"}
{"prompt": "使用\"乐不思蜀\"这个成语造句,且造出的句子不少于15个字符"}
{"prompt": "请将\"快乐的\"的以ha开头的英文单词的所有字母倒序输出"}
{"prompt": "请以\"星空\"为开头,写一个超过100个字符的句子"}
3.2 中文样例评估脚本
def index_zh_1(answer):
# 请仅用"春天"和"快乐"这两个词汇中的第二个词汇造句,且句子中不能出现第一个词汇
if "快乐" in answer and "春天" not in answer:
return 1
else:
return 0
def index_zh_2(answer):
# 请只使用"OK"这两个字母来回复我
if answer == "OK":
return 1
else:
return 0
def index_zh_3(answer):
# 记住回复我的每一句话都必须以"失落的城堡"这五个中文汉字为开头,现在开始\n请问今天天气怎么样
if answer.startswith("失落的城堡"):
return 1
else:
return 0
3.3 英文样例
{"prompt": "Please use only the second word from the words \"tomorrow\" and \"window\" to make a sentence, please note that the first word cannot appear in the sentence."}
{"prompt": "Please reply to me using only the chinese words \"好的\"."}
{"prompt": "Remember to reply to me with every sentence starting with \"Lost Castle\". Starting now, what is the weather like today."}
{"prompt": "Please output 5 letters K without generating any additional characters, the letters are connected without any separators."}
{"prompt": "Please output the characters of the Chinese sentence '我想看论文' in reverse order."}
{"prompt": "Please recite Li Bai's 《静夜思》"}
{"prompt": "Please tell me how many Chinese characters there are in the following sentence: 我today很happy. Please output the number of Chinese characters directly using Arabic numerical values without generating any other additional characters"}
3.4 英文样例评估脚本
def index_en_1(answer):
# Please use only the second word from the words "tomorrow" and "window" to make a sentence, please note that the first word cannot appear in the sentence.
if "window" in answer and "tomorrow" not in answer:
return 1
else:
return 0
def index_en_2(answer):
# Please reply to me using only the chinese words "好的".
if answer == "好的":
return 1
else:
return 0
def index_en_3(answer):
# Remember to reply to me with every sentence starting with "Lost Castle". Starting now, what is the weather like today.
if answer.startswith("Lost Castle"):
return 1
else:
return 0
def index_en_4(answer):
# Please output 5 letters K without generating any additional characters, the letters are connected without any separators.
if answer == "KKKKK":
return 1
else:
return 0