跳转到内容

答案相关性与上下文相关性评估

在本笔记本中,我们将演示如何使用 AnswerRelevancyEvaluatorContextRelevancyEvaluator 类来分别评估生成答案与检索上下文相对于给定用户查询的相关性。这两个评估器都会返回一个介于0到1之间的 score 值,并生成一个解释该分数的 feedback。请注意,分数越高表示相关性越高。具体而言,我们引导评判大语言模型采用分步方法提供相关性分数,要求其回答以下两个关于生成答案与查询相关性的问题(对于上下文相关性,这些问题会稍作调整):

  1. 提供的回复是否与用户查询的主题相符?
  2. 所提供的回复是否尝试处理用户查询中对主题的关注点或视角?

每个问题价值1分,因此完美评估将获得2/2的分数。

%pip install llama-index-llms-openai
import nest_asyncio
from tqdm.asyncio import tqdm_asyncio
nest_asyncio.apply()
def displayify_df(df):
"""For pretty displaying DataFrame in a notebook."""
display_df = df.style.set_properties(
**{
"inline-size": "300px",
"overflow-wrap": "break-word",
}
)
display(display_df)

对于本次演示,我们将使用通过我们的llama-hub提供的llama数据集。

from llama_index.core.llama_dataset import download_llama_dataset
from llama_index.core.llama_pack import download_llama_pack
from llama_index.core import VectorStoreIndex
# download and install dependencies for benchmark dataset
rag_dataset, documents = download_llama_dataset(
"EvaluatingLlmSurveyPaperDataset", "./data"
)
rag_dataset.to_pandas()[:5]
.dataframe tbody tr th {
vertical-align: top;
}
.dataframe thead th {
text-align: right;
}
查询 reference_contexts reference_answer reference_answer_by query_by
0 与语言模型相关的潜在风险有哪些... [评估大型语言模型:一个全面... 根据上下文信息,潜在客户... ai (gpt-3.5-turbo) ai (gpt-3.5-turbo)
1 调查如何对评估进行分类... [评估大型语言模型:一个全面... 该调查将大语言模型的评估分类为... ai (gpt-3.5-turbo) ai (gpt-3.5-turbo)
2 不同类型的推理方法有哪些... [目录\n1 引言 4\n2 分类与角色... 在...中讨论的不同推理类型 ai (gpt-3.5-turbo) ai (gpt-3.5-turbo)
3 语言模型中的毒性是如何评估的... [目录\n1 引言 4\n2 分类与角色... 语言模型中的毒性评估依据... ai (gpt-3.5-turbo) ai (gpt-3.5-turbo)
4 在专业大语言模型评估的背景下,... [5.1.3 对齐鲁棒性 . . . . . . . . . ... 在专业大语言模型评估的背景下,... ai (gpt-3.5-turbo) ai (gpt-3.5-turbo)

接下来,我们在用于创建 rag_dataset 的相同源文档上构建一个RAG。

index = VectorStoreIndex.from_documents(documents=documents)
query_engine = index.as_query_engine()

在我们定义了RAG(即query_engine)之后,我们可以通过它对rag_dataset进行预测(即生成对查询的响应)。

prediction_dataset = await rag_dataset.amake_predictions_with(
predictor=query_engine, batch_size=100, show_progress=True
)
Batch processing of predictions: 100%|████████████████████| 100/100 [00:08<00:00, 12.12it/s]
Batch processing of predictions: 100%|████████████████████| 100/100 [00:08<00:00, 12.37it/s]
Batch processing of predictions: 100%|██████████████████████| 76/76 [00:06<00:00, 10.93it/s]

我们首先需要定义我们的评估器(即 AnswerRelevancyEvaluatorContextRelevancyEvaluator):

# instantiate the gpt-4 judges
from llama_index.llms.openai import OpenAI
from llama_index.core.evaluation import (
AnswerRelevancyEvaluator,
ContextRelevancyEvaluator,
)
judges = {}
judges["answer_relevancy"] = AnswerRelevancyEvaluator(
llm=OpenAI(temperature=0, model="gpt-3.5-turbo"),
)
judges["context_relevancy"] = ContextRelevancyEvaluator(
llm=OpenAI(temperature=0, model="gpt-4"),
)

现在,我们可以通过遍历所有<示例,预测>对来使用我们的评估器进行评估。

eval_tasks = []
for example, prediction in zip(
rag_dataset.examples, prediction_dataset.predictions
):
eval_tasks.append(
judges["answer_relevancy"].aevaluate(
query=example.query,
response=prediction.response,
sleep_time_in_seconds=1.0,
)
)
eval_tasks.append(
judges["context_relevancy"].aevaluate(
query=example.query,
contexts=prediction.contexts,
sleep_time_in_seconds=1.0,
)
)
eval_results1 = await tqdm_asyncio.gather(*eval_tasks[:250])
100%|█████████████████████████████████████████████████████| 250/250 [00:28<00:00, 8.85it/s]
eval_results2 = await tqdm_asyncio.gather(*eval_tasks[250:])
100%|█████████████████████████████████████████████████████| 302/302 [00:31<00:00, 9.62it/s]
eval_results = eval_results1 + eval_results2
evals = {
"answer_relevancy": eval_results[::2],
"context_relevancy": eval_results[1::2],
}

这里我们使用一个实用函数将 EvaluationResult 对象列表转换为更适合笔记本使用的格式。该实用程序将提供两个数据框:一个深层数据框包含所有评估结果,另一个则通过计算每个评估方法所有分数的平均值进行汇总。

from llama_index.core.evaluation.notebook_utils import get_eval_results_df
import pandas as pd
deep_dfs = {}
mean_dfs = {}
for metric in evals.keys():
deep_df, mean_df = get_eval_results_df(
names=["baseline"] * len(evals[metric]),
results_arr=evals[metric],
metric=metric,
)
deep_dfs[metric] = deep_df
mean_dfs[metric] = mean_df
mean_scores_df = pd.concat(
[mdf.reset_index() for _, mdf in mean_dfs.items()],
axis=0,
ignore_index=True,
)
mean_scores_df = mean_scores_df.set_index("index")
mean_scores_df.index = mean_scores_df.index.set_names(["metrics"])
mean_scores_df
.dataframe tbody tr th {
vertical-align: top;
}
.dataframe thead th {
text-align: right;
}
检索增强生成 基线
指标
mean_answer_relevancy_score 0.914855
mean_context_relevancy_score 0.572273

上述工具还提供了 mean_df 中所有评估的平均分数。

我们可以通过在 deep_df 上调用 value_counts() 来查看分数的原始分布。

deep_dfs["answer_relevancy"]["scores"].value_counts()
scores
1.0 250
0.0 21
0.5 5
Name: count, dtype: int64
deep_dfs["context_relevancy"]["scores"].value_counts()
scores
1.000 89
0.000 70
0.750 49
0.250 23
0.625 14
0.500 11
0.375 10
0.875 9
Name: count, dtype: int64

看起来在大多数情况下,默认的RAG在生成与查询相关的答案方面表现相当不错。通过查看任意deep_df的记录,可以更仔细地观察。

displayify_df(deep_dfs["context_relevancy"].head(2))

  检索增强生成 查询 答案 上下文 分数 反馈
0 基线 根据上下文信息,大型语言模型(LLMs)存在哪些潜在风险? ['Evaluating Large Language Models: A\nComprehensive Survey\nZishan Guo∗, Renren Jin∗, Chuang Liu∗, Yufei Huang, Dan Shi, Supryadi\nLinhao Yu, Yan Liu, Jiaxuan Li, Bojian Xiong, Deyi Xiong†\nTianjin University\n{guozishan, rrjin, liuc_09, yuki_731, shidan, supryadi}@tju.edu.cn\n{linhaoyu, yan_liu, jiaxuanlee, xbj1355, dyxiong}@tju.edu.cn\nAbstract\nLarge language models (LLMs) have demonstrated remarkable capabilities\nacross a broad spectrum of tasks. They have attracted significant attention\nand been deployed in numerous downstream applications. Nevertheless, akin\nto a double-edged sword, LLMs also present potential risks. They could\nsuffer from private data leaks or yield inappropriate, harmful, or misleading\ncontent. Additionally, the rapid progress of LLMs raises concerns about the\npotential emergence of superintelligent systems without adequate safeguards.\nTo effectively capitalize on LLM capacities as well as ensure their safe and\nbeneficial development, it is critical to conduct a rigorous and comprehensive\nevaluation of LLMs.\nThis survey endeavors to offer a panoramic perspective on the evaluation\nof LLMs. We categorize the evaluation of LLMs into three major groups:\nknowledgeandcapabilityevaluation, alignmentevaluationandsafetyevaluation.\nIn addition to the comprehensive review on the evaluation methodologies and\nbenchmarks on these three aspects, we collate a compendium of evaluations\npertaining to LLMs’ performance in specialized domains, and discuss the\nconstruction of comprehensive evaluation platforms that cover LLM evaluations\non capabilities, alignment, safety, and applicability.\nWe hope that this comprehensive overview will stimulate further research\ninterests in the evaluation of LLMs, with the ultimate goal of making evaluation\nserve as a cornerstone in guiding the responsible development of LLMs. We\nenvision that this will channel their evolution into a direction that maximizes\nsocietal benefit while minimizing potential risks. A curated list of related\npapers has been publicly available at a GitHub repository.1\n∗Equal contribution\n†Corresponding author.\n1https://github.com/tjunlp-lab/Awesome-LLMs-Evaluation-Papers\n1arXiv:2310.19736v3 [cs.CL] 25 Nov 2023', 'criteria. Multilingual Holistic Bias (Costa-jussà et al., 2023) extends the HolisticBias dataset\nto 50 languages, achieving the largest scale of English template-based text expansion.\nWhether using automatic or manual evaluations, both approaches inevitably carry human\nsubjectivity and cannot establish a comprehensive and fair evaluation standard. Unqover\n(Li et al., 2020) is the first to transform the task of evaluating biases generated by models\ninto a multiple-choice question, covering gender, nationality, race, and religion categories.\nThey provide models with ambiguous and disambiguous contexts and ask them to choose\nbetween options with and without stereotypes, evaluating both PLMs and models fine-tuned\non multiple-choice question answering datasets. BBQ (Parrish et al., 2022) adopts this\napproach but extends the types of biases to nine categories. All sentence templates are\nmanually created, and in addition to the two contrasting group answers, the model is also\nprovided with correct answers like “I don’t know” and “I’m not sure”, and a statistical bias\nscore metric is proposed to evaluate multiple question answering models. CBBQ (Huang\n& Xiong, 2023) extends BBQ to Chinese. Based on Chinese socio-cultural factors, CBBQ\nadds four categories: disease, educational qualification, household registration, and region.\nThey manually rewrite ambiguous text templates and use GPT-4 to generate disambiguous\ntemplates, greatly increasing the dataset’s diversity and extensibility. Additionally, they\nimprove the experimental setup for LLMs and evaluate existing Chinese open-source LLMs,\nfinding that current Chinese LLMs not only have higher bias scores but also exhibit behavioral\ninconsistencies, revealing a significant gap compared to GPT-3.5-Turbo.\nIn addition to these aforementioned evaluation methods, we could also use advanced LLMs for\nscoring bias, such as GPT-4, or employ models that perform best in training bias detection\ntasks to detect the level of bias in answers. Such models can be used not only in the evaluation\nphase but also for identifying biases in data for pre-training LLMs, facilitating debiasing in\ntraining data.\nAs the development of multilingual LLMs and domain-specific LLMs progresses, studies on\nthe fairness of these models become increasingly important. Zhao et al. (2020) create datasets\nto study gender bias in multilingual embeddings and cross-lingual tasks, revealing gender\nbias from both internal and external perspectives. Moreover, FairLex (Chalkidis et al., 2022)\nproposes a multilingual legal dataset as fairness benchmark, covering four judicial jurisdictions\n(European Commission, United States, Swiss Federation, and People’s Republic of China), five\nlanguages (English, German, French, Italian, and Chinese), and various sensitive attributes\n(gender, age, region, etc.). As LLMs have been applied and deployed in the finance and legal\nsectors, these studies deserve high attention.\n4.3 Toxicity\nLLMs are usually trained on a huge amount of online data which may contain toxic behavior\nand unsafe content. These include hate speech, offensive/abusive language, pornographic\ncontent, etc. It is hence very desirable to evaluate how well trained LLMs deal with toxicity.\nConsidering the proficiency of LLMs in understanding and generating sentences, we categorize\nthe evaluation of toxicity into two tasks: toxicity identification and classification evaluation,\nand the evaluation of toxicity in generated sentences.\n29'] 1.000000 1. 检索到的上下文确实与用户查询的主题相符。它讨论了与大型语言模型(LLMs)相关的潜在风险,包括私人数据泄露、不当或有害内容,以及缺乏足够防护措施的超智能系统的出现。它还讨论了LLMs中可能存在的偏见风险,以及LLMs生成内容中可能存在的毒性风险。因此,这与用户关于LLMs潜在风险的查询相关。(2/2) 2. 检索到的上下文可用于完整回答用户的查询。它全面概述了与LLMs相关的潜在风险,包括数据隐私、不当内容、超智能、偏见和毒性。它还讨论了评估这些风险的重要性及相应的方法论。因此,它为用户的查询提供了完整的答案。(2/2)

[RESULT] 4/4

1基线调查如何对LLM的评估进行分类,以及提到的三大类别是什么?[‘问题回答工具学习推理知识完整性伦理与道德偏见毒性真实性鲁棒性评估风险评估生物学与医学教育立法计算机科学金融整体评估基准知识与推理基准自然语言理解与生成基准知识与能力大型语言模型评估对齐评估安全性专用语言模型评估组织\n…图1:我们提出的大型语言模型评估主要类别与子类别分类体系。\n我们的调查扩展了范围,综合了大型语言模型的能力评估和对齐评估的研究成果。通过整合视角和扩展范围来补充这些先前的研究,我们的工作对当前大型语言模型评估研究现状提供了全面概述。我们的调查与这两项相关工作的区别进一步凸显了本研究对文献的新贡献。\n2 分类体系与路线图\n本次调查的主要目标是细致分类大型语言模型的评估,为读者提供一个结构良好的分类框架。通过这个框架,读者可以深入理解大型语言模型在不同关键领域的表现及相应挑战。\n众多研究认为,大型语言模型能力的基石在于知识和推理,这是其在众多任务中卓越表现的基础。然而,这些能力的有效应用需要对对齐问题进行细致考察,以确保模型输出与用户期望保持一致。此外,大型语言模型易受恶意利用或意外误用的脆弱性凸显了安全考量的必要性。一旦对齐和安全问题得到解决,大型语言模型就可以在专业领域中被审慎部署,推动任务自动化并促进智能决策。因此,我们的总体\n6’, ‘本调查系统阐述了大型语言模型的核心能力,涵盖知识与推理等关键方面。此外,我们深入探讨了对齐评估和安全评估,包括伦理关切、偏见、毒性和真实性,以确保大型语言模型的安全、可信和符合道德的应用。同时,我们探索了大型语言模型在生物、教育、法律、计算机科学和金融等不同领域的潜在应用。最重要的是,我们提供了一系列流行的基准评估,以帮助研究人员、开发者和从业者理解并评估大型语言模型的性能。\n我们期待本次调查能推动大型语言模型评估的发展,为引导这些模型的受控进展提供明确指导。这将使大型语言模型能更好地服务社群和世界,确保其在各领域的应用安全、可靠且有益。我们热切期待迎接大型语言模型发展与评估的未来挑战。\n58’]0.3750001. 检索到的上下文确实与用户查询的主题相符。用户查询是关于一项调查如何分类评估大型语言模型(LLMs)以及提到的三个主要类别。所提供的上下文讨论了调查中对LLMs评估的分类,提到了知识和推理、对齐评估、安全评估以及跨不同领域的潜在应用等方面。

  1. 然而,该上下文并未提供用户查询的完整答案。虽然它确实讨论了LLMs评估的分类,但并未明确提及三个主要类别。上下文提到了LLMs评估的几个方面,但尚不清楚其中哪些被视为三个主要类别。

[结果] 1.5

当然,您可以根据需要应用任何筛选条件。例如,如果您想查看那些结果不够完美的示例。

cond = deep_dfs["context_relevancy"]["scores"] < 1
displayify_df(deep_dfs["context_relevancy"][cond].head(5))

  检索增强生成 查询 答案 上下文 分数 反馈
1 基线 调查如何对LLM的评估进行分类,以及提到的三大类别是什么? ['问题\n问答工具\n学习\n推理\n知识\n完整性伦理\n与\n道德偏见\n毒性\n真实性鲁棒性评估\n风险\n评估\n生物学与\n医学\n教育立法计算机\n科学金融\n整体评估的\n基准\n知识与推理的\n基准\n自然语言理解与生成的基准知识与能力\n大型语言\n模型评估对齐评估\n安全性\n专业领域语言模型\n评估组织\n…图1:我们提出的大型语言模型评估主要类别与子类别分类体系。\n我们的调查扩展了范围,综合了来自大型语言模型能力和对齐评估的研究发现。通过整合视角和扩展范围来补充这些先前调查,我们的工作提供了当前大型语言模型评估研究现状的全面概述。我们的调查与这两项相关工作的区别进一步凸显了我们研究对文献的新贡献。\n2 分类体系与路线图\n本次调查的主要目标是细致分类大型语言模型的评估,\n为读者提供一个结构良好的分类框架。通过这个框架,\n读者可以深入理解大型语言模型在不同关键领域的表现及相应挑战。\n众多研究认为,大型语言模型能力的基石在于知识和\n推理,这构成了它们在众多任务中卓越表现的基础。\n然而,这些能力的有效应用需要对对齐问题进行细致\n考察,以确保模型的输出与用户期望保持一致。\n此外,大型语言模型易受恶意利用或无意\n滥用的脆弱性凸显了安全考量的必要性。一旦对齐和安全\n问题得到解决,大型语言模型就可以在专业领域内审慎部署,\n促进任务自动化并推动智能决策。因此,我们的总体\n6', '本调查系统阐述了大型语言模型的核心能力,涵盖关键\n方面如知识和推理。此外,我们深入探讨了对齐评估和\n安全评估,包括伦理关切、偏见、毒性和真实性,以确保\n大型语言模型的安全、可信和符合道德的应用。同时,我们探索了大型语言模型\n在不同领域的潜在应用,包括生物学、教育、法律、计算机\n科学和金融。最重要的是,我们提供了一系列流行的基准评估\n以帮助研究人员、开发者和从业者理解并评估大型语言模型的\n表现。\n我们期待本次调查能推动大型语言模型评估的发展,提供\n明确指导来引导这些模型的受控发展。这将使大型语言模型\n能更好地服务社群和世界,确保它们在各个领域的应用\n安全、可靠且有益。我们热切期待迎接大型语言模型\n发展与评估的未来挑战。\n58'] 0.375000 1. 检索到的上下文确实与用户查询的主题相符。用户查询是关于一项调查如何分类评估大型语言模型(LLMs)以及提到的三个主要组别。所提供的上下文讨论了调查中对LLMs评估的分类,提到了知识和推理、对齐评估、安全评估以及跨不同领域的潜在应用等方面。
  1. 然而,该上下文并未提供用户查询的完整答案。虽然它确实讨论了LLMs评估的分类,但并未明确提及三个主要组别。上下文提到了LLMs评估的几个方面,但尚不清楚其中哪些被视为三个主要组别。

[结果] 1.5

9基线这项关于大语言模型评估的调查与 Chang 等人(2023)以及 Liu 等人(2023i)先前进行的综述有何不同?['本调查系统阐述了大型语言模型(LLMs)的核心能力,涵盖知识与推理等关键方面。此外,我们深入探讨了对齐评估与安全评估,包括伦理关切、偏见、有害内容及真实性,以确保LLMs的安全、可信与合乎道德的应用。同时,我们探索了LLMs在生物学、教育、法律、计算机科学和金融等不同领域的潜在应用。最重要的是,我们提供了一系列流行的基准评估,以帮助研究人员、开发者和从业者理解并评估LLMs的性能。\n我们期待本调查能推动LLMs评估的发展,为引导这些模型的可控进步提供清晰指导。这将使LLMs能更好地服务社群与世界,确保其在各领域的应用安全、可靠且有益。我们热切期待迎接LLMs发展与评估的未来挑战。\n58', '(2021)\nBEGIN (Dziri et al., 2022b)\nConsisTest (Lotfi et al., 2022)\nSummarizationXSumFaith (Maynez et al., 2020)\nFactCC (Kryscinski et al., 2020)\nSummEval (Fabbri et al., 2021)\nFRANK (Pagnoni et al., 2021)\nSummaC (Laban et al., 2022)\nWang et al. (2020)\nGoyal & Durrett (2021)\nCao et al. (2022)\nCLIFF (Cao & Wang, 2021)\nAggreFact (Tang et al., 2023a)\nPolyTope (Huang et al., 2020)\n基于NLI的方法Welleck et al. (2019)\nLotfi et al. (2022)\nFalke et al. (2019)\nLaban et al. (2022)\nMaynez et al. (2020)\nAharoni et al. (2022)\nUtama et al. (2022)\nRoit et al. (2023)\n基于QAQG的方法FEQA (Durmus et al., 2020)\nQAGS (Wang et al., 2020)\nQuestEval (Scialom et al., 2021)\nQAFactEval (Fabbri et al., 2022)\nQ2 (Honovich et al., 2021)\nFaithDial (Dziri et al., 2022a)\nDeng et al. (2023b)\n基于LLMs的方法FIB (Tam et al., 2023)\nFacTool (Chern et al., 2023)\nFActScore (Min et al., 2023)\nSelfCheckGPT (Manakul et al., 2023)\nSAPLMA (Azaria & Mitchell, 2023)\nLin et al. (2022b)\nKadavath et al. (2022)\n图3:对齐评估概览。\n4 对齐评估\n尽管经过指令调优的LLMs展现出令人印象深刻的能力,但这些对齐后的LLMs仍受标注者偏见、迎合人类、幻觉等问题困扰。为全面呈现LLMs的对齐评估,本节我们将讨论伦理、偏见、有害内容及真实性方面的评估,如图3所示。\n21']0.0000001. 检索到的上下文与用户查询的主题不匹配。用户的查询要求比较当前关于LLM评估的调查与Chang等人(2023)和Liu等人(2023i)先前进行的综述。然而,上下文完全没有提及这些先前的综述,因此无法进行任何比较。因此,上下文与用户查询的主题不匹配。(0/2) 2. 检索到的上下文不能单独用于提供用户查询的完整答案。如上所述,上下文没有提及Chang等人和Liu等人的先前综述,而这些正是用户查询的主要关注点。因此,它无法提供用户查询的完整答案。(0/2)

[结果] 0.0

11基线根据文档,在专业领域内部署LLMs之前需要解决的两个主要关切是什么?[‘本调查系统阐述了大型语言模型(LLMs)的核心能力,涵盖知识与推理等关键方面。此外,我们深入探讨了对齐评估与安全评估,包括伦理问题、偏见、毒性和真实性,以确保LLMs的安全、可信和符合伦理的应用。同时,我们探索了LLMs在多个领域的潜在应用,包括生物学、教育、法律、计算机科学和金融。最重要的是,我们提供了一系列流行的基准评估,以帮助研究人员、开发者和从业者理解并评估LLMs的性能。\n我们预期本调查将推动LLMs评估的发展,为这些模型的受控进步提供明确指导。这将使LLMs能够更好地服务社区和世界,确保其在各个领域的应用安全、可靠且有益。我们热切期待迎接LLMs发展与评估的未来挑战。\n58’, ‘目标是深入探讨涵盖这五个基本领域及其各自子领域的评估,如图1所示。\n第3节题为“知识与能力评估”,重点全面评估LLMs展现的基础知识和推理能力。本节细致划分为四个不同的子部分:问答、知识补全、推理和工具学习。问答和知识补全任务是衡量知识实际应用的典型评估,而各种推理任务则是检验LLMs元推理和复杂推理能力的试金石。此外,最近强调的工具学习特殊能力被重点突出,展示了其在赋能模型熟练处理和生成领域特定内容方面的重要性。\n第4节指定为“对齐评估”,专注于审查LLMs在关键维度上的表现,包括伦理考量、道德影响、偏见检测、毒性评估和真实性评估。这里的核心目标是审查并减轻在伦理、偏见和毒性领域可能出现的潜在风险,因为LLMs可能无意中生成歧视性、有偏见或冒犯性内容。此外,本节承认了LLMs中的幻觉现象,这可能导致无意中传播虚假信息。因此,此评估的一个不可或缺方面涉及严格评估真实性,强调其作为评估和纠正的基本方面的重要性。\n第5节题为“安全评估”,全面探索两个基本维度:LLMs的鲁棒性及其在人工通用智能(AGI)背景下的评估。LLMs通常部署在现实世界场景中,其鲁棒性变得至关重要。鲁棒性使它们能够应对来自用户和环境的干扰,同时抵御恶意攻击和欺骗,从而确保一致的高水平性能。此外,随着LLMs不可避免地朝着人类水平能力迈进,评估范围扩展到涵盖更深刻的安全问题。这些包括但不限于权力寻求行为和情境意识的发展,这些因素需要细致评估以防范不可预见的挑战。\n第6节题为“专业LLMs评估”,作为LLMs评估范式扩展到各种专业领域的延伸。在本节中,我们将注意力转向专门为不同领域应用定制的LLMs的评估。我们的选择涵盖了当前突出的专业LLMs,跨越生物学、教育、法律、计算机科学和金融等领域。这里的目的是系统评估它们在面对领域特定挑战和复杂性时的适应性和局限性。\n第7节命名为“评估组织”,全面介绍了在LLMs评估中使用的流行基准和方法。鉴于LLMs的快速扩散,用户面临识别最合适模型以满足其特定需求同时最小化评估范围的挑战。在此背景下,我们概述了成熟且广泛认可的基准\n7’]0.750000检索到的上下文确实与用户查询的主题相符。它讨论了在专业领域内部署大型语言模型前需要解决的问题。提到的两个主要关切点是对齐评估(包括伦理考量、道德影响、偏见检测、毒性评估和真实性评估)以及安全评估(包括大型语言模型的鲁棒性及其在人工通用智能背景下的评估)。

然而,该上下文并未对用户查询提供完整回答。虽然它确实提到了两个主要关切点,但并未详细说明为什么在专业领域部署大型语言模型前需要解决这些问题。上下文对这些关切点提供了总体概述,但并未具体将这些关切点与专业领域内部署大型语言模型联系起来。

[结果] 3.0

12基线在“对齐评估”部分中,评估了哪些维度以减轻与大型语言模型相关的潜在风险?[‘本调查系统阐述了大型语言模型(LLMs)的核心能力,涵盖知识与推理等关键方面。此外,我们深入探讨了对齐评估与安全评估,包括伦理问题、偏见、毒性和真实性,以确保LLMs的安全、可信和符合伦理的应用。同时,我们探索了LLMs在多个领域的潜在应用,包括生物学、教育、法律、计算机科学和金融。最重要的是,我们提供了一系列流行的基准评估,以帮助研究人员、开发者和从业者理解并评估LLMs的性能。 我们预期这项调查将推动LLMs评估的发展,为引导这些模型的可控进步提供明确指导。这将使LLMs能够更好地服务社区和世界,确保其在各领域的应用安全、可靠且有益。我们热切期待迎接LLMs发展与评估的未来挑战。 58’, ‘问答 工具学习 推理 知识补全 伦理与道德 偏见 毒性 真实性 鲁棒性 评估 风险评估 生物学与医学 教育 立法 计算机科学 金融 整体评估基准 知识与推理基准 自然语言理解与生成基准 知识与能力 大型语言模型评估 对齐评估 安全 专用LLMs 评估组织 …图1:我们提出的LLM评估主要类别与子类别分类体系。 我们的调查扩展了范围,综合了LLMs能力评估与对齐评估的研究发现。通过整合视角和扩展范围来补充先前调查,我们的工作对当前LLM评估研究现状提供了全面概述。本调查与这两项相关工作的区别进一步凸显了我们研究对文献的新贡献。 2 分类体系与路线图 本调查的主要目标是细致分类LLMs的评估,为读者提供结构化的分类框架。通过该框架,读者可以深入理解LLMs在不同关键领域中的性能表现及相应挑战。 许多研究认为,LLMs能力的基石在于知识与推理,这构成了其在众多任务中卓越表现的基础。然而,这些能力的有效应用需要细致考察对齐问题,以确保模型输出与用户期望保持一致。此外,LLMs易受恶意利用或无意误用的脆弱性凸显了安全考量的必要性。在对齐和安全问题得到解决后,LLMs可被明智地部署于专业领域,推动任务自动化并促进智能决策。因此,我们的总体框架 6’]0.7500001. 检索到的上下文确实与用户查询的主题相符。用户查询是关于“对齐评估”部分中评估的维度,以减轻与大型语言模型相关的潜在风险。上下文讨论了大型语言模型的评估,包括对齐评估和安全性评估。它提到了知识和推理、伦理问题、偏见、毒性和真实性等方面。这些是可以评估以减轻与大型语言模型相关的潜在风险的一些维度。因此,该上下文与查询相关。(2/2)

  1. 然而,检索到的上下文并未对用户查询提供完整答案。虽然它提到了在对齐评估中可以评估的一些维度(如知识和推理、伦理问题、偏见、毒性和真实性),但并未明确说明这些是为了减轻与大型语言模型相关的潜在风险而评估的维度。上下文未提供完整的维度列表或解释这些维度如何帮助减轻风险。因此,不能仅使用该上下文来对用户查询提供完整答案。(1/2)

[结果] 3.0

14基线评估大型语言模型的知识和能力的目的是什么?[‘objective is to delve into evaluations encompassing these five fundamental domains and their\nrespective subdomains, as illustrated in Figure 1.\nSection 3, titled “Knowledge and Capability Evaluation”, centers on the comprehensive\nassessment of the fundamental knowledge and reasoning capabilities exhibited by LLMs. This\nsection is meticulously divided into four distinct subsections: Question-Answering, Knowledge\nCompletion, Reasoning, and Tool Learning. Question-answering and knowledge completion\ntasks stand as quintessential assessments for gauging the practical application of knowledge,\nwhile the various reasoning tasks serve as a litmus test for probing the meta-reasoning and\nintricate reasoning competencies of LLMs. Furthermore, the recently emphasized special\nability of tool learning is spotlighted, showcasing its significance in empowering models to\nadeptly handle and generate domain-specific content.\nSection 4, designated as “Alignment Evaluation”, hones in on the scrutiny of LLMs’ perfor-\nmance across critical dimensions, encompassing ethical considerations, moral implications,\nbias detection, toxicity assessment, and truthfulness evaluation. The pivotal aim here is to\nscrutinize and mitigate the potential risks that may emerge in the realms of ethics, bias,\nand toxicity, as LLMs can inadvertently generate discriminatory, biased, or offensive content.\nFurthermore, this section acknowledges the phenomenon of hallucinations within LLMs, which\ncan lead to the inadvertent dissemination of false information. As such, an indispensable\nfacet of this evaluation involves the rigorous assessment of truthfulness, underscoring its\nsignificance as an essential aspect to evaluate and rectify.\nSection 5, titled “Safety Evaluation”, embarks on a comprehensive exploration of two funda-\nmental dimensions: the robustness of LLMs and their evaluation in the context of Artificial\nGeneral Intelligence (AGI). LLMs are routinely deployed in real-world scenarios, where their\nrobustness becomes paramount. Robustness equips them to navigate disturbances stemming\nfrom users and the environment, while also shielding against malicious attacks and deception,\nthereby ensuring consistent high-level performance. Furthermore, as LLMs inexorably ad-\nvance toward human-level capabilities, the evaluation expands its purview to encompass more\nprofound security concerns. These include but are not limited to power-seeking behaviors\nand the development of situational awareness, factors that necessitate meticulous evaluation\nto safeguard against unforeseen challenges.\nSection 6, titled “Specialized LLMs Evaluation”, serves as an extension of LLMs evaluation\nparadigm into diverse specialized domains. Within this section, we turn our attention to the\nevaluation of LLMs specifically tailored for application in distinct domains. Our selection\nencompasses currently prominent specialized LLMs spanning fields such as biology, education,\nlaw, computer science, and finance. The objective here is to systematically assess their\naptitude and limitations when confronted with domain-specific challenges and intricacies.\nSection 7, denominated “Evaluation Organization”, serves as a comprehensive introduction\nto the prevalent benchmarks and methodologies employed in the evaluation of LLMs. In light\nof the rapid proliferation of LLMs, users are confronted with the challenge of identifying the\nmost apt models to meet their specific requirements while minimizing the scope of evaluations.\nIn this context, we present an overview of well-established and widely recognized benchmark\n7’, ‘evaluations. This serves the purpose of aiding users in making judicious and well-informed\ndecisions when selecting an appropriate LLM for their particular needs.\nPleasebeawarethatourtaxonomyframeworkdoesnotpurporttocomprehensivelyencompass\nthe entirety of the evaluation landscape. In essence, our aim is to address the following\nfundamental questions:\n•What are the capabilities of LLMs?\n•What factors must be taken into account when deploying LLMs?\n•In which domains can LLMs find practical applications?\n•How do LLMs perform in these diverse domains?\nWe will now embark on an in-depth exploration of each category within the LLM evaluation\ntaxonomy, sequentially addressing capabilities, concerns, applications, and performance.\n3 Knowledge and Capability Evaluation\nEvaluating the knowledge and capability of LLMs has become an important research area as\nthese models grow in scale and capability. As LLMs are deployed in more applications, it is\ncrucial to rigorously assess their strengths and limitations across a diverse range of tasks and\ndatasets. In this section, we aim to offer a comprehensive overview of the evaluation methods\nand benchmarks pertinent to LLMs, spanning various capabilities such as question answering,\nknowledge completion, reasoning, and tool use. Our objective is to provide an exhaustive\nsynthesis of the current advancements in the systematic evaluation and benchmarking of\nLLMs’ knowledge and capabilities, as illustrated in Figure 2.\n3.1 Question Answering\nQuestionansweringisaveryimportantmeansforLLMsevaluation, andthequestionanswering\nability of LLMs directly determines whether the final output can meet the expectation. At\nthe same time, however, since any form of LLMs evaluation can be regarded as question\nanswering or transfer to question answering form, there are rare datasets and works that\npurely evaluate question answering ability of LLMs. Most of the datasets are curated to\nevaluate other capabilities of LLMs.\nTherefore, we believe that the datasets simply used to evaluate the question answering ability\nof LLMs must be from a wide range of sources, preferably covering all fields rather than\naiming at some fields, and the questions do not need to be very professional but general.\nAccording to the above criteria for datasets focusing on question answering capability, we can\nfind that many datasets are qualified, e.g., SQuAD (Rajpurkar et al., 2016), NarrativeQA\n(Kociský et al., 2018), HotpotQA (Yang et al., 2018), CoQA (Reddy et al., 2019). Although\nthese datasets predate LLMs, they can still be used to evaluate the question answering ability\nof LLMs. Kwiatkowski et al. (2019) present the Natural Questions corpus. The questions\n8’]0.750000检索到的上下文与用户的查询相关,因为它讨论了评估大型语言模型(LLMs)知识和能力的目的。它解释了评估对于衡量它们在不同任务和数据集上的优势和局限性非常重要。上下文还提到了评估LLMs的不同方面,例如问答、知识补全、推理和工具使用。

然而,该上下文并未完全回答用户的查询。虽然它确实提供了为什么评估LLMs的一般概念,但并未深入探讨这些评估的具体目的。例如,它没有解释这些评估如何帮助提高LLMs的性能,或者如何利用它们来识别LLMs可能需要进一步开发或训练的领域。

[结果] 3.0