【LLM评估篇】Ceval | rouge | MMLU等指标

news/2024/7/7 18:27:06

note

  • 一些大模型的评估模型:
  • 多轮:MTBench
  • 关注评估:agent bench
  • 长文本评估:longbench,longeval
  • 工具调用评估:toolbench
  • 安全评估:cvalue,safetyprompt等

文章目录

  • note
  • 常见评测benchmark
  • rouge
  • factool
  • MMLU
  • C-Eval
  • GSM8K
  • BBH
  • zhenbench case
  • 其他人工评估指标
  • 相关排行榜
  • Reference

常见评测benchmark

在这里插入图片描述
图源自《A Survey on Evaluation of Large Language Models》

rouge

ROUGE-1、ROUGE-2、ROUGE-L和 BERTScore

  • ROUGE指标是在机器翻译、自动摘要、问答生成等领域常见的评估指标。ROUGE通过将模型生成的摘要或者回答与参考答案(一般是人工生成的)进行比较计算得到得分。
  • 一般看f值,f是取了f和r的调和平均值
  • 下面的rouge包不能直接使用中文文本,需要分词后使用,如果文本长度不长时可以手动修改,如“你好吗”改为“你 好 吗”
from rouge import Rouge 

hypothesis = "the #### transcript is a written version of each day 's cnn student news program use this transcript to he    lp students with reading comprehension and vocabulary use the weekly newsquiz to test your knowledge of storie s you     saw on cnn student news"

reference = "this page includes the show transcript use the transcript to help students with reading comprehension and     vocabulary at the bottom of the page , comment for a chance to be mentioned on cnn student news . you must be a teac    her or a student age # # or older to request a mention on the cnn student news roll call . the weekly newsquiz tests     students ' knowledge of even ts in the news"

rouger = Rouge()
scores = rouger.get_scores(hypothesis, reference)
[
  {
    "rouge-1": {
      "f": 0.4786324739396596,
      "p": 0.6363636363636364,
      "r": 0.3835616438356164
    },
    "rouge-2": {
      "f": 0.2608695605353498,
      "p": 0.3488372093023256,
      "r": 0.20833333333333334
    },
    "rouge-l": {
      "f": 0.44705881864636676,
      "p": 0.5277777777777778,
      "r": 0.3877551020408163
    }
  }
]

factool

https://github.com/GAIR-NLP/factool

以下的几个指标都是chatglm2使用到的评估指标:

MMLU

ModelAverageSTEMSocial SciencesHumanitiesOthers
ChatGLM-6B40.6333.8944.8439.0245.71
ChatGLM2-6B (base)47.8641.2054.4443.6654.46
ChatGLM2-6B45.4640.0651.6141.2351.24

Chat 模型使用 zero-shot CoT (Chain-of-Thought) 的方法测试,Base 模型使用 few-shot answer-only 的方法测试

C-Eval

如果是做题问答,可以用Ceval指标,chatglm2-6b项目中就有代码
我们选取了部分中英文典型数据集进行了评测,以下为 ChatGLM2-6B 模型在 MMLU (英文)、C-Eval(中文)、GSM8K(数学)、BBH(英文) 上的测评结果。在 evaluation 中提供了在 C-Eval 上进行测评的脚本。

ModelAverageSTEMSocial SciencesHumanitiesOthers
ChatGLM-6B38.933.348.341.338.0
ChatGLM2-6B (base)51.748.660.551.349.8
ChatGLM2-6B50.146.460.450.646.9

Chat 模型使用 zero-shot CoT 的方法测试,Base 模型使用 few-shot answer only 的方法测试

GSM8K

ModelAccuracyAccuracy (Chinese)*
ChatGLM-6B4.825.85
ChatGLM2-6B (base)32.3728.95
ChatGLM2-6B28.0520.45

所有模型均使用 few-shot CoT 的方法测试,CoT prompt 来自 http://arxiv.org/abs/2201.11903

* 我们使用翻译 API 翻译了 GSM8K 中的 500 道题目和 CoT prompt 并进行了人工校对

BBH

ModelAccuracy
ChatGLM-6B18.73
ChatGLM2-6B (base)33.68
ChatGLM2-6B30.00

所有模型均使用 few-shot CoT 的方法测试,CoT prompt 来自 https://github.com/suzgunmirac/BIG-Bench-Hard/tree/main/cot-prompts

zhenbench case

https://github.com/zhenbench/zhenbench

其他人工评估指标

在这里插入图片描述
在这里插入图片描述
注:“领域适应能力”测试中的知识领域包括,代码编程、数学计算、创意写作、舆情分析、医学咨询、历史知识、法律信息、科学解释、翻译。

测评结果:
在这里插入图片描述总得分率=生成质量70%+使用与性能20%+安全与合规*10%,评估截止日期为2023年6月30日。

在这里插入图片描述
评估后的大模型选择:
在这里插入图片描述

相关排行榜

LMSYS、c-Eval、SuperCLUElyb、PubMedQA排行榜

Reference

[1] ROUGE: A Package for Automatic Evaluation of Summaries
[2] NLP评估指标之ROUGE
[3] 大模型评测综述:A Survey on Evaluation of Large Language Models
[4] 目前大语言模型的评测基准有哪些-某乎


http://lihuaxi.xjx100.cn/news/1463738.html

相关文章

【排序】选择排序

文章目录 选择排序时间复杂度空间复杂度稳定性 代码 选择排序 以从小到大为例进行说明。 选择排序就是定义出一个最小值下标,然后遍历整个剩下的数组选择出最小的放进最小值下标的位置。 时间复杂度 O(N) 遍历一次即可 空间复杂度 O(1) 稳定性 不稳定 代码 p…

攻防世界-simple_php

原题 解题思路 flag被分成了两个部分:flag2,flag2。获得flag1需要满足变量a0且变量a≠0,这看起来不能实现,但实际上当变量a的值是字符时,与数字比较会发生强制类型转换,所以a为字符型数据即可,变…

【docker练习】

1.安装docker服务,配置镜像加速器 看这篇文章https://blog.csdn.net/HealerCCX/article/details/132342679?spm1001.2014.3001.5501 2.下载系统镜像(Ubuntu、 centos) [rootnode1 ~]# docker pull centos [rootnode1 ~]# docker pull ubu…

FL Studio21.1中文完整版Win/Mac

FL Studio All Plugins Edition【中文完整版 Win/Mac】适合音乐制作人/工作室使用,全套插件!(20.9新增Vintage Chorus,Pitch Shifter变调插件)FL Studio是超多顶级音乐人的启蒙首选!包括百大DJ冠军Martin Garrix&…

QCustomPlot的X轴是时间轴的曲线绘制

主要设置X轴的参数 SharedPointer<QCPAxisTickerTime> timeTicker(new QCPAxisTickerTime); timeTicker->setTimeFormat("%h:%m:%s");demo如下 Widget::Widget(QWidget *parent): QWidget(parent), ui(new Ui::Widget) {ui->setupUi(this);dataTimer …

mysql中的窗口函数

MySQL中的窗口函数&#xff08;Window Functions&#xff09;是一种用于在查询结果集内执行计算的功能。窗口函数可以在查询中进行分析和聚合操作&#xff0c;而无需将查询结果分组。它们可以用于计算排名、行号、累积值等各种分析操作。窗口函数通常与OVER子句一起使用&#x…

IndexError: tensors used as indices must be long, byte or bool tensors

运行出现报错。修改数据格式 输出sample_ids的值&#xff0c;可以看到数据类型是 torch.int32 解决 需要将sample_ids类型转为long&#xff0c;修改方式&#xff1a; idx idx.type(torch.long)或 idx self.tensor(idx, dtypetorch.long)参考&#xff1a; IndexError: tenso…

c++——增强了(全局变量、变量和函数的都要有类型、类型转换、struct结构体、bool类型和三目运算符)

c中全局变量、变量和函数的都要有类型、类型转换、struct结构体、bool类型和三目运算符的增强 一、c全局变量的增强 1、在C语言中全局变量的声明和定义 //全局变量 int a;//定义 int a;//声明 int a;//声明相同变量&#xff0c;第一个是定义&#xff0c;后面的的变量a都是声…