跳到主要内容

评估结果的等级、分数和通过与否之间的关系是怎样的?

对于每个样本的评估结果形式,可能会有以下三种,分别是:

  • 等级(Grade)
  • 得分(Score)
  • 通过与否(Passed/Failed)

针对不同的评估指标,最终呈现出哪几种结果形式,取决于评估指标本身的设定。比如,对于Match类型的评估指标,评估结果形式有得分和通过与否两种,而对于基于大模型评级的评估指标,评估的结果可能只有等级。

等级、得分和通过与否之间是可以转换的,它们的转换关系如下:

转换图

等级转化为得分

等级转换表是用来将等级转换为得分的,主要用于在自定义大模型评级中使用,定义的方式与OpenAI Evals中的model-graded eval template中的choice_strings和choice_scores参数格式兼容。

choice_strings: The choices that we expect the model completion to contain given the evaluation prompt. For example, "ABCDE" or ["Yes", "No", "Unsure"]. Any other choices returned by the model are parsed into "invalid".

choice_scores (optional): A mapping of each choice to its score, which is logged as a metric. For example, if a response of "Yes" (resp. "No") indicates that the model's original completion was good (resp. bad), we may assign this choice a score of 1 (resp. 0).

OpenAI Evals中的评估模版说明详见:https://github.com/openai/evals/blob/main/docs/eval-templates.md

得分转化为通过与否

通过为评估指标设置阈值threshold和计分方向,评估结果中的得分可以转化为通过与否,并可以在统计报告中得到总体的通过率。

有的自定义指标类型(如:字符串距离)允许用户在创建时填写阈值(threshold)。

在完全自定义的大模型评级指标中,可以在配置文件中通过设置threshold和reverse_score参数来将分数转化为通过与否。

threshold (optional): 如果设定了阈值,那么得分高于改阈值的样本将被视为评估通过。如果未设置,则不会生成包含得分的评估结果。

reverse_score (optional): 默认为0,代表高于阈值的得分将被视为评估通过;如果设置为1,代表低于阈值的得分将被视为评估通过。需要与阈值一起使用。