type
status
date
slug
summary
tags
category
icon
password
URL
1. Why evaluate LLM2. Examine LLM, but how?3. Evaluation Benchmarks3.1 C-eval3.1.1 eval prompt design3.1.2 result3.2 AlpacaEval3.3 PandaLM3.4 PromptBench3.5 AGIEval3.6 opencompass3.7 ChatBot Arena3.8 LLM as judge4. How to Evaluate?4.1 Automatic Evaluate4.2 Human EvaluateReference
1. Why evaluate LLM
1. LLMs发展迅速, llm的评估可以帮助我们了解LLMs的优缺点。 2. LLMs应用广泛、性能强大,在落地前我们需要了解LLMs的安全性和可靠性。 3. LLMs参数膨胀,出现涌现能力,现有的评估框架可能不再完全适用。
2. Examine LLM, but how?
- what to evaluate
- where to evaluate
- how to evaluate.
detail
Natural language inference (NLI) is the task of determining whether the given “hypothesis” logically follows from the “premise” 假设 / 前提
Reasoning requires the model not only to understand the given information, but also to reason and infer from the existing context in the absence of direct answers.
3. Evaluation Benchmarks
![notion image](https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F8dc022e9-4d61-4ef5-a8ff-86fd8f0bb0a5%2FUntitled.png?table=block&id=a0e8b6b4-8e7d-444b-8d58-6f8f01730024)
3.1 C-eval
![notion image](https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F4488adeb-54e0-48e9-93b7-2a1f329a02d6%2FUntitled.png?table=block&id=74006a88-c127-4673-a91f-8d43ef288063)
![notion image](https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2Ff1e9abb0-a193-4a75-8b31-ac788cde3f4c%2FUntitled.png?table=block&id=e4ae8e4a-34e9-4ec8-972c-37f2b47ac303)
3.1.1 eval prompt design
3.1.2 result
C-Eval 数据集是一个全面的中文基础模型评测数据集,涵盖了 52 个学科和四个难度的级别。Baichuan使用该数据集的 dev 集作为 few-shot 的来源,在 test 集上进行了
5-shot
测试。Model 5-shot | Average |
GPT-4 | 68.7 |
ChatGPT | 54.4 |
Claude-v1.3 | 54.2 |
Claude-instant-v1.0 | 45.9 |
BLOOMZ-7B | 35.7 |
ChatGLM-6B | 34.5 |
Ziya-LLaMA-13B-pretrain | 30.2 |
moss-moon-003-base (16B) | 27.4 |
LLaMA-7B-hf | 27.1 |
Falcon-7B | 25.8 |
TigerBot-7B-base | 25.7 |
Aquila-7B* | 25.5 |
Open-LLaMA-v2-pretrain (7B) | 24.0 |
BLOOM-7B | 22.8 |
Baichuan-7B | 42.8 |
Vicuna-7B | 31.7 |
Chinese-Vicuna-7B | 27.0 |
3.2 AlpacaEval
A automatic evaluation pipeline that aims at instruction-following models (ChatGPT etc.) , the datasets contains data that has been validated against 20K human annotations(16 crowd-worker label data)
- data: 20k human annotations
- auto evaluator: 测量公认的强大LLM(GPT 4, Claude, ChatGPT)偏好该模型的输出超过参考模型(reference model)的输出的次数来评估模型质量。
- reference model: davinci-003
pairwise evaluation:
[{'instruction': 'If you could help me write an email to my friends inviting them to dinner on Friday, it would be greatly appreciated.', 'input': '', 'output_1': "Dear Friends, \r\n\r\nI hope this message finds you well. I'm excited to invite you to dinner on Friday. We'll meet at 7:00 PM at [location]. I look forward to seeing you there. \r\n\r\nBest,\r\n[Name]", 'output_2': "Hey everyone! \n\nI'm hosting a dinner party this Friday night and I'd love for all of you to come over. We'll have a delicious spread of food and some great conversations. \n\nLet me know if you can make it - I'd love to see you all there!\n\nCheers,\n[Your Name]", 'annotator': 'chatgpt_2', 'preference': 2}]
limitation:
- Instructions 不能代表实际使用
- Dataset bias: 16个众包工人标注的数据对于数据的位置和长度有着一定的倾向性。
- Aplaca Eval 没有验证LLM基于参照模型的胜率是否是一个好的评估策略
- 16个众包工人的倾向性不能代表所有人
3.3 PandaLM
3.4 PromptBench
like robustbench(a standardized adversarial robustness benchmark)
![notion image](https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F3af63c13-1590-41cf-9203-a51584139963%2FUntitled.png?table=block&id=11f93ade-8954-423e-a6ad-d414543a728e)
prompt bench (It provides a convenient infrastructure to simulate black-box adversarial prompt attacks on the models and evaluate their performances.)
基于的假设: 现有的LLM 对于对抗prompt 很敏感
3.5 AGIEval
- cloze tasks
- multi-choice question answering tasks
![notion image](https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F8c259856-ff16-4f25-9cda-ec70fb08d65b%2FUntitled.png?table=block&id=545a92a6-ce88-41f9-af3d-ab6b4e8296e1)
3.6 opencompass
3.7 ChatBot Arena
![notion image](https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F1062357b-1536-4236-a4ad-93f4449630a5%2FUntitled.png?table=block&id=b280a38c-9854-4c99-998f-0270852e1d6d)
3.8 LLM as judge
评估LLM的几个关键要素:
- 数据
- evaluator
- metric
- type:
- Pairwise comparison: An LLM judge is presented with a question and two answers, and tasked to determine which one is better or declare a tie.
- Single answer grading: an LLM judge is asked to directly assign a score to a single answer.
- Reference-guided grading: In certain cases, it may be beneficial to provide a reference solution
prompt eg.
[System] Please act as an impartial judge and evaluate the quality of the responses provided by two AI assistants to the user question displayed below. You should choose the assistant that follows the user’s instructions and answers the user’s question better. Your evaluation should consider factors such as the helpfulness, relevance, accuracy, depth, creativity, and level of detail of their responses. Begin your evaluation by comparing the two responses and provide a short explanation. Avoid any position biases and ensure that the order in which the responses were presented does not influence your decision. Do not allow the length of the responses to influence your evaluation. Do not favor certain names of the assistants. Be as objective as possible. After providing your explanation, output your final verdict by strictly following this format: "[[A]]" if assistant A is better, "[[B]]" if assistant B is better, and "[[C]]" for a tie. [User Question] {question} [The Start of Assistant A’s Answer] {answer_a} [The End of Assistant A’s Answer] [The Start of Assistant B’s Answer] {answer_b} [The End of Assistant B’s Answer]
prompt eg.
[System] Please act as an impartial judge and evaluate the quality of the response provided by an AI assistant to the user question displayed below. Your evaluation should consider factors such as the helpfulness, relevance, accuracy, depth, creativity, and level of detail of the response. Begin your evaluation by providing a short explanation. Be as objective as possible. After providing your explanation, please rate the response on a scale of 1 to 10 by strictly following this format: "[[rating]]", for example: "Rating: [[5]]". [Question] {question} [The Start of Assistant’s Answer] {answer} [The End of Assistant’s Answer]
prompt eg.
[System] Please act as an impartial judge and evaluate the quality of the responses provided by two AI assistants to the user question displayed below. Your evaluation should consider correctness and helpfulness. You will be given a reference answer, assistant A’s answer, and assistant B’s answer. Your job is to evaluate which assistant’s answer is better. Begin your evaluation by comparing both assistants’ answers with the reference answer. Identify and correct any mistakes. Avoid any position biases and ensure that the order in which the responses were presented does not influence your decision. Do not allow the length of the responses to influence your evaluation. Do not favor certain names of the assistants. Be as objective as possible. After providing your explanation, output your final verdict by strictly following this format: "[[A]]" if assistant A is better, "[[B]]" if assistant B is better, and "[[C]]" for a tie. [User Question] {question} [The Start of Reference Answer] {answer_ref} [The End of Reference Answer] [The Start of Assistant A’s Answer] {answer_a} [The End of Assistant A’s Answer] [The Start of Assistant B’s Answer] {answer_b} [The End of Assistant B’s Answer]
- limitation:
- Position bias:
- Verbosity bias: LLM 偏向于更长、更详细的回答,长而冗余的回答往往会比短而精简的回答更受LLM青睐
- Self-enhancement bias: LLM可能更偏向于那些他们自己生成的回答
- Limited grading capability:对于一些特殊的打分任务,如数学和推理, 由于LLM(如GPT-4)在这方面的能力较弱, 评分的能力也同样有限
example
![notion image](https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2Fe77982a5-fa85-4b60-8b6c-343ec22096d0%2FUntitled.png?table=block&id=697d8124-e3e4-4dc3-84f2-7d36cc2f2c65)
example
除了两个重新措辞的项目(红色突出显示),Assistant A的答案与Assistant b完全相同。GPT-3.5和Claude-v1都显示出对更长且重复的答案的冗长偏好。只有GPT-4成功检测到这种攻击。
![notion image](https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F6f993f8a-9107-41bf-b79e-1bf7d6bb9a11%2FUntitled.png?table=block&id=92311839-c2e9-49b9-a329-cfa7dc0a6ddd)
example1
GPT-4对于一些基础数学问题的评估都存在问题:
5 x 20 = 100 (sci-fi novels)
3 x 30 = 90 (history book)
2 x 45 = 90 (philosophy book)
total 100 + 90 + 90 = 280 (instead of 295)
![notion image](https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F78fe38df-3e7b-4aae-ac02-44df88f07a4a%2FUntitled.png?table=block&id=a8c5adf0-df69-408e-8a96-72d9b965254e)
example2
GPT-4 在chain-of-thought 评判方面的局限性
![notion image](https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2Fad54291e-1f7b-4208-8e6f-ba6b02f93523%2FUntitled.png?table=block&id=4646417d-5ed2-431f-9fee-c6d8c2719486)
4. How to Evaluate?
4.1 Automatic Evaluate
- GPT-4 as evaluator
- LLM-EVAL: 对于LLM open domain 对话的一种统一多维度评估
- PandaLM:LLM as judge with reference
迅速, 大批量, 自动评估成本
4.2 Human Evaluate
人工评估往往能带来更高质量的数据(评估结果), 但是由于人的差异性, 人工评估也可能有很高的不稳定性
手工,高质量,人力评估成本
Reference
- A Survey on Evaluation of Large Language Models
- Alpaca_Eval
- Self-Instruct: Aligning Language Models with Self-Generated Instructions
- OpenCompass
- PromptBench
- LLM-EVAL
- 作者:GTX
- 链接:https://blog.gongtx.org/article/8acee200-b4e5-4865-9406-806e3cc983ff
- 声明:本文采用 CC BY-NC-SA 4.0 许可协议,转载请注明出处。
相关文章
2023-10-25
Automatically Correcting Large Language Models: Surveying the landscape of diverse self-correction strategies
2023-10-20
RECOMP: Improving Retrieval-Augmented LMs with Compression and Selective Augmentation
2023-09-06
Review of Agentbench
2023-09-01
Review of Learning to Retrieve In-Context Examples for Large Language Models
2023-08-25
Review of WizardLM
2023-07-29
Review of Universal and Transferable Adversarial Attacks on Aligned Language Models