Large language models (LLMs) often generate content that contains factual errors when responding to fact-seeking prompts on open-ended topics. To benchmark a model's long-form factuality in open domains, we first use GPT-4 to generate LongFact, a prompt set comprising thousands of questions spanning 38 topics. We then propose that LLM agents can be used as automated evaluators for long-form factuality through a method which we call Search-Augmented Factuality Evaluator (SAFE). SAFE utilizes an LLM to break down a long-form response into a set of individual facts and to evaluate the accuracy of each fact using a multi-step reasoning process comprising sending search queries to Google Search and determining whether a fact is supported by the search results. Furthermore, we propose extending F1 score as an aggregated metric for long-form factuality. To do so, we balance the percentage of supported facts in a response (precision) with the percentage of provided facts relative to a hyperparameter representing a user's preferred response length (recall). Empirically, we demonstrate that LLM agents can outperform crowdsourced human annotators - on a set of ~16k individual facts, SAFE agrees with crowdsourced human annotators 72% of the time, and on a random subset of 100 disagreement cases, SAFE wins 76% of the time. At the same time, SAFE is more than 20 times cheaper than human annotators. We also benchmark thirteen language models on LongFact across four model families (Gemini, GPT, Claude, and PaLM-2), finding that larger language models generally achieve better long-form factuality. LongFact, SAFE, and all experimental code are available at https://github.com/google-deepmind/long-form-factuality.
翻译:大型语言模型(LLMs)在回应开放领域的事实查询提示时,常生成包含事实错误的内容。为评估模型在开放领域的长篇事实准确性,我们首先使用GPT-4构建了LongFact——一个涵盖38个主题、包含数千个问题的提示集。我们提出可通过搜索增强事实性评估器(SAFE)方法,将LLM智能体用作长篇事实性的自动化评估工具。SAFE利用LLM将长篇回答分解为独立事实集合,并通过多步推理流程评估每个事实的准确性:该流程包括向谷歌搜索发送查询请求,并根据搜索结果判定事实是否得到支持。此外,我们提出将F1分数扩展为长篇事实性的聚合指标:通过平衡回答中受支持事实的比例(精确率)与提供事实相对于用户期望回答长度超参数的比例(召回率)来实现这一目标。实证研究表明,LLM智能体能够超越众包人工标注者——在约1.6万个独立事实的评估中,SAFE与人工标注结果的一致性达到72%;在随机选取的100个分歧案例中,SAFE在76%的情况下判断更准确。同时,SAFE的成本仅为人工标注的1/20。我们还在LongFact上对来自四个模型家族(Gemini、GPT、Claude和PaLM-2)的十三个语言模型进行了基准测试,发现更大规模的模型通常具有更好的长篇事实准确性。LongFact、SAFE及所有实验代码已发布于https://github.com/google-deepmind/long-form-factuality。