章鱼总结
00:00 / 50:15

Hamel Husain · 50:15

说话人 0

Welcome everybody. I'm really excited about this guest talk from these folks at glean. If you don't know, like glean is basically the goat in enterprise when it comes to retrieval. Like they have pretty much dominated the space. I wanted like the first people to focus on retrieval and enterprise and i've always wondered like how do they do evals? So go ahead and kick it off to Manav.

大家好。 我非常期待这次来自 Glean 团队的嘉宾分享。 如果你不了解,Glean 基本上就是企业检索领域的 GOAT(史上最佳)。 他们几乎主导了这个领域。 我想先请大家关注检索和企业场景,而且我一直很好奇他们是怎么做评测(evals)的? 那就请 Manav 开始吧。

说话人 1

Lauren, thank you very much, Hamel, for giving us the opportunity to present what we do here at Glean. And what we are going to be presenting is work of a lot of great engineers at Glean and years of iteration and experimentation. I'm Manav. I work in search quality. I've been at Glean for one and a half years.

非常感谢 Lauren 和 Hamel,给我们这个机会介绍 Glean 的工作。 我们要展示的内容,是 Glean 许多优秀工程师多年迭代和实验的成果。 我是 Manav。 我在搜索质量团队工作。 我来 Glean 已经一年半了。

说话人 2

Yeah, I'm Lauren. I'm also an engineer on Glean's search quality team. I've been here about a year. And yeah, super excited to be giving this talk.

嗯,我是 Lauren。 我同样是 Glean 搜索质量团队的工程师。 我来这里大约一年了。 能做这次分享,我非常兴奋。

说话人 1

Going on to like how we collect data, eval new work, ranking changes, and launch progress. so just to give like context, people sort of know what glean is about. so i'll just go over and give an idea of like, so this is like how a search works. you know, you can find all the documents across these different data sources. and then in chat, you know, you can ask any questions about a particular topic about the enterprise. you can create docs, you can create slides. and sort of this is sort of the interface for the chat. and then so like it goes through your corpus, finds the documents, looks at different data sources and then cites the answers over here. so this is just to give an idea of sort of what are we trying to evaluate? because i guess it's very important to sort of really understand the product and the data we are working with. but glean sort of started off as enterprise search and now we are doing. assistant, we are trying to do co-work, we are trying to build and help do work for you. so the agenda for today's talk, we'll be talking about how do we build eval sets, how do we run evals, how do we make sure that we can launch a change end-to-end, and also after launching, what other things are we monitoring or looking for?

接下来会讲我们如何收集数据、评测新功能、排序变更,以及上线进展。 先简单介绍一下背景,大家大致了解 Glean 是做什么的。 那我就简单讲讲,这大致就是搜索的工作方式。 你可以在这些不同的数据源中找到所有文档。 然后在聊天中,你可以询问关于企业内某个特定主题的任何问题。 你可以创建文档,也可以创建幻灯片。 这基本上就是聊天的交互界面。 然后它会遍历你的语料库,找到相关文档,查看不同的数据源,并在这里引用答案的来源。 所以这只是为了让大家大致了解我们要评估的是什么。 因为我想,真正理解产品以及我们所使用的数据非常重要。 但Glean最初是从企业搜索起步的,现在我们正在做…… 助手,我们正在尝试做协作工作(co-work),我们要构建并帮你完成工作。 所以今天演讲的议程包括:我们如何构建评估集,如何运行评估,如何确保能够端到端地上线一项变更,以及上线之后,我们还要监控或关注哪些其他事项?

and i think one of the questions that we generally ask or even sort of new joiners wonder is like, why are we not using more open source retrieval benchmarks? and so i wanted to highlight some of the problems that we have, and we can't just import a lot of the open source retrieval benchmarks, because number one is large indexes. we have customers over billions of documents, and these are diverse across tens of 20 data sources, and we have almost 275 plus app connectors. so it's really hard to get a good open source retrieval benchmark that has. good enough diverse and private data. and then, of course, like our search is very permissioned. you're going to see only whatever you have access to. so making sure that, you know, our search is correctly permissioned. and so a lot of these little benchmarks, you have documents sort of access to everyone and you do not know like which document has access to which person. and also we build a lot of signals from these documents, a lot of visits, a lot of authors like who's authoring which doc, how fresh a doc is. And a lot of these signals get lost in these open source benchmarks. Therefore, we need to be creating sort of our own eval sets and benchmarks that can accurately measure and reflect what we do here at Clean.

我想,我们常被问到的一个问题,新加入的同事也常常疑惑:为什么我们不使用更多开源的检索基准? 所以我想重点说明一些问题,我们无法直接引入很多开源检索基准,原因之一是索引规模太大。 我们的客户拥有数十亿份文档,这些文档分布在二十多个数据源中,并且我们拥有近275个以上的应用连接器。 因此,很难找到一个好的开源检索基准…… 它需要具备足够的多样性和私有数据。 而且,当然,我们的搜索是有权限控制的。 你只能看到你有权访问的内容。 所以要确保,你知道,我们的搜索权限控制是正确的。 很多这样的小型基准中,文档对所有人都可访问,你无法知道哪个文档对哪个人可见。 此外,我们从这些文档中构建了大量信号,比如大量的访问记录、作者信息,即谁撰写了哪份文档,以及文档的新鲜度。 而这些信号在许多开源基准中都会丢失。 因此,我们需要创建自己的评估集和基准,以准确衡量并反映我们在Glean所做的工作。

说话人 2

Yeah, so I can go ahead and talk about how we actually build those eval sets. So we primarily build two types of eval sets. We build some from historical usage data and then some from synthetic data that we produce. like based on a document corpus. so i'll talk first about the eval sets that we build from historical usage data. so this is built from real use of glean search and glean assistant by our internal users here at glean. so for info seeking, we build a few types of these eval sets. we build search eval sets for evaluating document retrieval, context selection eval sets for evaluating like selecting specific relevant snippets within documents. And then like full end-to-end chat eval sets. So first are search eval sets. These map the search query to, so you know, if you're making a search query for, you know, Monup's Walter launch document, you want that launch document to be at the top of your search result page. Um, so we're able to mine these from both Gleam search, which is the first thing Monup showed in the demo with like a user is typing a search query into the box and then clicking on a document. And we assume that the document they click on is the canonical that we should then try to retrieve at the top of the page. Um, and then Gleam assistant, as we've moved like more into the LLM world, it's important to be able to also. Mine these from how like assistant is using the search tool. So when assistant makes a query to the search tool, we take that and then we map that against whatever document it finally cites in like the response to the user. Next, we also, so an important part of glean search is not just retrieving like the most important documents for a question. We also tried to do context selection within those documents so that like when we return this context to the LLM, we show like specifically the snippets within the document that we think will be relevant to answering the question as opposed to like showing. the entire content or no content. and so for this, we also keep track of like what specific snippet within a document was cited by the assistant in a response. and then we use that to build this eval set between the query and the canonical snippet. and then finally, we build just like full end-to-end chat eval sets that are based on just like the user's original query. here we don't have a concept of a canonical. Um, because we don't really know like whether the historical chat response was actually correct. So instead, you know, this is basically just an input only eval set of like all of the things people have asked clean assistant. Yeah, so I'll go over an example of like given a chat session, how would we mine all of this data? So here we can see, you know, this was like a um, you query where they asked when did Monov and Canal launch GPT-6 for World of Two? Um, the assistant does like all these searches where we search. You know, search for the document and then it finds the document and it responds and cites both the document that it used to answer the question as well as the snippet within that document. So to get data from this, we would first for our search eval set, we would take this search query that it issued to glean search and map it to the canonical document that it cited in the response. For the context selection eval set, we do the same, except now we would be mapping to like the actual snippet within that document that it needed. And then finally for the chat eval set, we would just take whatever the input user query was. Yeah. And so now I'll hand it back to Manav to talk about. How we actually go about building these eval sets?

好的,那我接着讲讲我们实际是如何构建这些评测集的。 我们主要构建两类评测集。 一类基于历史使用数据构建,另一类基于我们生成的合成数据构建。 比如基于文档语料库生成的数据。 那我先讲基于历史使用数据构建的评测集。 这些数据来自 Glean 内部用户对 Glean Search 和 Glean Assistant 的真实使用。 对于信息查找类任务,我们构建了几种此类评测集。 我们构建用于评估文档检索的搜索评测集,以及用于评估在文档中选取特定相关片段的上下文选择评测集。 另外还有完整的端到端聊天评测集。 首先是搜索评测集。 它们将搜索查询与结果相对应。比如你搜索 Monup 的 Walter 发布文档,你希望那份发布文档排在搜索结果页的最前面。 嗯,我们可以从 Glean Search 中挖掘这些数据,也就是 Monup 在演示中首先展示的那种场景:用户在搜索框中输入查询,然后点击某个文档。 我们假设用户点击的文档就是标准答案,之后我们应当尽量把它检索到结果页顶部。 嗯,随着我们越来越多地转向大语言模型领域,同样重要的是能够从 Glean Assistant 中挖掘数据。 挖掘方式是观察 Assistant 如何使用搜索工具。 当 Assistant 向搜索工具发出查询时,我们记录该查询,并将其与它最终在回复用户时引用的文档进行对应。 其次,Glean 搜索的一个重要部分,不仅是为问题检索最重要的文档。 我们还尝试在这些文档内部进行上下文选择,这样当我们把上下文返回给大语言模型时,展示的是文档中我们认为与回答问题相关的具体片段,而不是展示整个内容或完全不展示内容。 这一点也很关键。 因此,对于这一部分,我们也会记录 Assistant 在回复中引用了文档中的哪一个具体片段。 然后我们用它来构建查询与标准片段之间的评估集。 最后,我们构建完整的端到端聊天评估集,这些评估集基于用户的原始查询。 这里我们没有标准答案的概念。 嗯,因为我们并不真正知道历史聊天回复是否确实正确。 所以相反,这基本上只是一个仅包含输入的评估集,收录了人们向Glean助手提出的所有问题。 好的,我举个例子说明,给定一个聊天会话,我们如何挖掘所有这些数据。 这里我们可以看到,这是一个查询,用户问的是Monov和Canal何时为World of Two推出了GPT-6。 嗯,助手执行了一系列搜索,我们在其中搜索文档。 你知道,搜索文档,然后找到文档并作出回应,同时引用了用于回答问题的文档以及该文档中的片段。 因此,要从中获取数据,首先对于我们的搜索评估集,我们会取出它向Glean搜索发出的搜索查询,并将其映射到它在回复中引用的标准文档。 对于上下文选择评估集,我们做同样的事情,只不过这次映射到它所需要的该文档中的实际片段。 最后,对于聊天评估集,我们只需取用户的原始输入查询。 好的。 接下来我把话交给Manav,让他谈谈。 我们究竟如何构建这些评估集?

说话人 1

So just a little bit about how we sort of have the infra for our eval sets. We log and sort of have all the gleaned traces. And then once we have sort of these production traces, we have pipelines that are essentially just map reduce jobs. And their job is trying to go through the traces, try to filter and tag the traces that we want to run evals on, making sure that, you know, we are deduplicating, we are making sure that removing any sort of experimental or debug traffic. and then once we sort of have a representative sample of the traffic, we then sort of get the actual entries which lauren had earlier mentioned, and then once we have those entries, we can then build upon our chat eval sets, our search eval sets, and our context eval sets, and these sort of pipelines run periodically, making sure that we have access to freshest sort of eval sets for our engineers to really evaluate their ranking changes or chat changes, and so one of the other things that we really want to make sure is we have the ability for our quality and researchers.

所以简单介绍一下我们评估集的基础设施。 我们会记录并保存所有Glean的追踪数据。 当我们拥有这些生产追踪数据后,就有一些流水线,本质上就是map reduce作业。 它们的任务是遍历这些追踪数据,过滤并标记我们想要用于评估的追踪数据,同时确保去重,并移除任何实验性或调试流量。 一旦我们获得了具有代表性的流量样本,就会提取Lauren之前提到的实际条目,然后基于这些条目构建我们的聊天评估集、搜索评估集和上下文评估集。这些流水线定期运行,确保工程师能够获取最新的评估集,以便真正评估他们的排序变更或聊天变更。另外,我们特别希望确保质量团队和研究人员能够访问这些数据。

to make their own info-seeking custom eval sets. because a lot of times we'll have a change which will be a very specific feature change. for example, in this, maybe an engineer is working on specifically adding like an operator filter. and this is basically like when you search, you can do app slack or app anything that you want to search over. or even chat has the ability to sort of trigger these operators. and so let's say you want to build a slice out of these main queries and see like currently how our ranking is doing on these sets. so you can essentially go through our data. you can filter out to operators. this is basically all logged in sql. and then once you have sort of all of those entries, you can essentially add it to our tool and then get those sessions out of it. and then once you have those sessions, you can then run evals on that specific eval set. and so this helps us allow to really build custom feature eval sets, which is very important when you're working on ranking changes, as a lot of times you might not be affecting the entire traffic and you want to scope down to a specific feature. and so i think the other type of eval sets that we build are the synthetic eval sets, which lauren had mentioned earlier. so these eval sets are based on a document corpus and these generally have a canonical answer. And so what we really do is we try to identify some of the important documents based on the glean signals that we have. We have a lot of signals such as when was the document in the corpus, how fresh it is, how many people are visiting the document. And then sort of once we have that document, we can use an array of LLMs to generate question answer pairs. And then based on that, we can again create the chat search and context selection eval sets. So this is sort of just like a general process of how we are building this eval set. Once we have the mind top docs, we sort of clean it, we filter it. and then we figure out what sort of passages are relevant. and then we chunk the passages, like we split each document into different passages. and then based on that, we ask an llm and also using some of our historical queries so that llm is writing queries that make sense and is well aligned to the user distribution. how can we create queries that reflect of like what someone would ask about a document or how an llm would ask about a document? and then once we have those question answer pairs, we do another sort of quality filtering to see if these are acceptable questions and answers. and then once that's done, we sort of create that eval set. so this is sort of just an example. so here we have a snippet of the document. and this is what we decide to be our canonical document. and let's say a query that the llm comes with is like, who launched waller 2? So like here we know that the canonical answer is authors Manav and Kunal and LLMs have become a lot better to just sort of create great query pairs and answer pairs from the document. And then this also becomes the canonical snippet for our snippet and context selection eval sets.

以便构建他们自己的信息检索自定义评估集。 因为很多时候我们会有一个变更,它是一个非常具体的功能变更。 例如,在这个例子中,可能有工程师正在专门添加类似运算符过滤器的功能。 基本上就是在你搜索时,可以搜索应用、Slack,或者任何你想搜索的内容。 或者甚至聊天功能也能够触发这些运算符。 所以假设你想从这些主要查询中切出一个子集,看看目前我们的排序在这些集合上表现如何。 所以你基本上可以浏览我们的数据。 你可以筛选出运算符。 这些基本上都记录在SQL中。 然后,一旦你拥有所有这些条目,你基本上可以把它们添加到我们的工具中,并从中提取出这些会话。 然后,一旦你拥有这些会话,就可以在该特定评估集上运行评估。 因此,这让我们能够真正构建自定义功能评估集,这在处理排序变更时非常重要,因为很多时候你的变更可能并不影响全部流量,而你需要缩小到特定功能范围。 所以我认为我们构建的另一类评估集是合成评估集,Lauren之前提到过。 这些评估集基于文档语料库,通常具有标准答案。 因此,我们真正要做的是,基于我们拥有的Glean信号,尝试识别一些重要文档。 我们有很多信号,例如文档在语料库中的时间、它的新鲜度,以及有多少人访问该文档。 然后,一旦有了这些文档,我们就可以使用一组LLM生成问答对。 基于此,我们可以再次创建聊天、搜索和上下文选择评估集。 这大致就是我们构建这个评估集的通用流程。 一旦获得了最重要的顶级文档,我们会对其进行清洗和过滤。 然后我们弄清楚哪些类型的段落是相关的。 然后我们对段落进行分块,也就是把每个文档切分成不同的段落。 然后基于此,我们询问一个大语言模型,同时使用一些历史查询,使该大语言模型编写的查询既合理,又与用户的分布高度一致。 我们如何创建能够反映人们会如何询问文档,或者大语言模型会如何询问文档的查询? 然后,一旦我们有了这些问答对,我们会进行另一种质量过滤,以检查这些问题和答案是否可接受。 然后完成这些之后,我们就创建了评估集。 所以这只是一个示例。 所以这里我们有一段文档片段。 这就是我们决定作为标准文档的内容。 假设大语言模型提出的一个查询是:谁发布了Waller 2? 所以在这里我们知道标准答案是作者Manav和Kunal,而且大语言模型已经变得更好,能够很好地从文档中创建高质量的查询-答案对。 然后这也成为我们片段和上下文选择评估集的标准片段。

说话人 2

So next I can go ahead and talk about how we actually run evals once we've built.

接下来,我可以谈谈我们在构建完成后实际如何运行评估。

So generally like our eval running process, we have an eval orchestrator that. You know, we'll run an eval set in a batch. So it will load an eval set from storage that we've produced with the pipeline that Monup just talked about. Then it will run all of the queries in the eval set through basically just our production search and chat runners. And then take those responses and compute metrics from those results. So first I'll talk about a few things we need to do within like our search and chat runners to be able to run these eval queries. So we have some like guardrails when we're doing this. so first off, if we're running like a large batch of eval queries, like, you know, like a thousand searches or something through, you know, our internal production system, we want to avoid that from like overloading our system. so we have, you know, we put all of our eval entries in a queue and then rate limit them as we run them through. we also have various forks within execution, basically to keep eval queries from like contaminating like our regular production data. you know, we have logging sinks where we try to. Um, keep public, uh, regular production queries and we don't want eval queries to contaminate those sinks. Uh, we also have some like specific logging and metrics that we might run specifically for eval queries. So logging like information about, uh, why documents were ranked the way they were, um, or like debug information. Uh, and then we also have some specific things that we try to do for reproducibility. In particular, like, you know, if your eval set was built like a week or two weeks ago, it's like a search eval set and maybe the documents have changed in that time, we want to be able to like reproduce the historical behavior as closely as possible. Um, so we'll pass like the original timestamp that the query was executed and then we have some like backend search logic to basically try to mimic the state that the index was in at that time just to keep things like reproducible. So then I can talk about like what metrics we actually use for each of our eval sets. So for our search eval sets, this is just document retrieval. So obviously like the important goal here is that our canonical document or in some cases multiple canonical documents for one query should all be concentrated at the top of the search results. So in this case, you know, in our base arm, we see that the canonical document is ranking at the second position and in the test arm, it's ranking at the top, which is an improvement. And we have a few different metrics that we compute for this. So we have uh recall at K. Um, so generally like for instance, our search tool typically retrieves like eight to 16 results. And so what we really care about is recall at either eight or 16, um, to make sure it's actually in that top batch of results. And then we also want it to be as close to the top of those results as possible. Um, Because A, that's just like a more continuous signal to optimize on. And B, typically like we will allocate more like snippets for context selection to things that rank. So we want to make sure that our canonicals are concentrated as close to the top as possible. And then finally, we measure what we call CR at K. So basically, this just measures like how much the overall ranking changes within the top K positions. Yeah, and then for context selection metrics, uh, so our goal with context selection is, uh, given a document, we want to retrieve. information from that document that is useful to answer the question without like totally overwhelming token budgets. So the two metrics that matter here are snippet recall. So like what percentage of the canonical snippets. So like I talked before about how we get canonical snippets based on what like snippet in the document was originally cited. And we want to make sure that all of those snippets are retrieved while minimizing the size of the result. Like on the left, we're retrieving the whole document, which means we get the canonical snippet, but the tool output is like really large. And so that becomes very costly token-wise. And then in the second case, we're retrieving fewer snippets but missing the canonical snippets. So that's clearly not a very good context selection algorithm. And we're aiming for this case on the right where we've narrowed down to just the relevant snippets as much as possible.

所以总体来说,我们的评估运行流程中有一个评估编排器,它…… 你知道,我们会以批次方式运行一个评估集。 因此,它会从存储中加载评估集,该评估集是由Monup刚刚介绍的流程生成的。 然后,它会将评估集中的所有查询基本上通过我们的生产搜索和聊天运行器运行。 接着获取这些响应,并根据结果计算指标。 所以首先我会谈谈在搜索和聊天运行器中,为了能够运行这些评估查询,我们需要做的几件事。 因为在执行此操作时,我们有一些防护机制。 首先,如果我们要运行大批量的评估查询,比如一千次左右的搜索,通过我们内部的生产系统,我们希望避免它让系统过载。 所以我们把所有评估条目放入一个队列,然后在运行时进行速率限制。 我们还在执行过程中设置了各种分流,基本上是为了防止评估查询污染我们的常规生产数据。 我们有日志汇聚点,我们试图…… 保存公共的、常规的生产查询,我们不希望评估查询污染这些汇聚点。 此外,我们还有一些专门针对评估查询可能运行的特定日志记录和指标。 比如记录文档为什么会以那种方式排序的信息,或者调试信息。 我们还有一些专门用于可复现性的措施。 具体来说,如果你的评估集是一两周前构建的,这是一个搜索评估集,而那段时间文档可能已经发生了变化,我们希望尽可能接近地复现历史行为。 因此,我们会传入查询最初执行的时间戳,然后通过一些后端搜索逻辑,尽量模拟当时索引的状态,以保持结果可复现。 接下来我可以谈谈每个评估集实际使用的指标。 对于我们的搜索评估集,这只是文档检索。 很显然,这里的重要目标是,我们的标准文档(或在某些情况下,一个查询对应的多个标准文档)都应该集中在搜索结果的顶部。 所以在这个例子中,在我们的基线组里,标准文档排在第二位,而在测试组里,它排在了首位,这是一个改进。 我们为此计算了几个不同的指标。 其中包括 recall at K(前K召回率)。 嗯,比如我们的搜索工具通常会检索8到16个结果。 所以我们真正关心的是在8或16个结果中的召回率,以确保它确实位于前面那一批结果中。 而且我们还希望它尽可能排在这些结果的靠前位置。 因为,A,这是一个更连续的信号,便于优化。 还有B,通常我们会为排名靠前的内容分配更多的片段用于上下文选择。 所以我们要确保规范片段尽可能集中在靠前的位置。 最后,我们衡量所谓的CR at K。 简单来说,这衡量的是前K个位置内整体排名变化的程度。 好的,至于上下文选择的指标,呃,我们在上下文选择上的目标是:给定一个文档,我们希望检索出该文档中对回答问题有用的信息。 同时又不会让令牌预算被完全撑爆。 这里最重要的两个指标是片段召回率。 也就是说,规范片段中有多大比例…… 就像我之前提到的,我们是根据文档中最初被引用的片段来获取规范片段的。 我们要确保所有这些片段都被检索到,同时尽量减小结果的大小。 比如在左边,我们检索的是整个文档,这样确实能拿到规范片段,但工具输出非常大。 因此从令牌角度来看,这样成本非常高。 而在第二种情况下,我们检索的片段较少,但遗漏了规范片段。 所以这显然不是一个很好的上下文选择算法。 我们的目标是右边这种情况,即尽可能精准地只保留相关片段。

说话人 0

Good question. You mentioned CR at K earlier. What is that? Can you talk about that a little bit?

好问题。 你之前提到了CR at K。 那是什么? 你能稍微讲讲吗?

说话人 2

Yeah, so it's basically just like an overall measure of like how much the results have like moved from. from one to the other. We have the exact formula we use, but the idea there is that if you have a change that's shuffling search results a really large amount, but only offering small wins, that might be kind of risky because in general, we assume that our existing ranking algorithm has been perfected over time. And so we want to make changes that make small changes to the overall SERP with minimal amounts of shuffling, but still get wins.

好的,它基本上是一个整体指标,用来衡量结果相对于原始排序发生了多大的变化。 从一个到另一个。 我们有所使用的确切公式,但其背后的思路是:如果某项改动会大幅打乱搜索结果,却只带来微小的提升,那可能有一定风险,因为一般来说,我们假定现有的排序算法已经经过长期打磨、相当完善。 因此,我们希望做出的改动只会对整体SERP产生小幅变化,尽量少打乱顺序,同时仍能取得收益。

说话人 0

What does CR stand for? Do you happen to know in this case?

CR代表什么? 你在这种情况下知道吗?

说话人 1

So it's it's called it's comparison ranking and it's essentially just like an internal formulation of like a monotonic function that quantifies change for us. Um and so it gives us as what Lauren said, a idea of like how many search results really shuffled and changed.

它叫做比较排序(comparison ranking),本质上就是我们内部使用的一种单调函数,用来量化变化程度。 嗯,正如Lauren所说,它让我们了解有多少搜索结果发生了较大的移动和变化。

说话人 2

Yeah, normally we would use like CR to decide like what degree of eval we want to do on something. So like um small changes with like a low CR value, like we have different thresholds for like um. at what CR value you would want to like run a live experiment on something before launching. Um so I'll talk a little bit more later on like what live experiments are and when we choose to use them.

是的,通常我们会用CR来决定对某项改动进行多大程度的评估。 所以,CR值较低的小幅改动,我们针对不同情况设有不同的阈值,嗯…… 也就是说,CR值达到多少时,你会希望在上线前对某项改动运行一次实时实验。 嗯,我稍后会更详细地谈谈什么是实时实验,以及我们何时选择使用它们。

说话人 1

And also now since we have an assistant product and a lot more people are now using the assistant product, so search is sort of uh a tool that the LLM can use. So we also need to figure out how can we evaluate the chat and the chat sessions that the users do. So we have like as we previously mentioned the usage with and synthetic eval sets and for each of them we have sort of different types of LLM judges. or different judges that we sort of look at. so for usage-based eval sets, we generally, whenever we have a change, we sort of run like a pairwise completeness judge. and so what essentially this does is it helps us know if the new change, like how complete was it compared to the old change? is it like introducing new information or is it fully complete or is it missing something? and this is based on like the rubrics that we have sort of well aligned with. golden sets and raw queries. and then for the known canonical answers, we can run the llm judge for correctness. and here the judge is looking for whether the information really matches what the response had. so really optimizing for whatever the information llm cites and making sure it matches to what the canonical answer has. so we can break down the response quality here. so on the left here, we have an example. Question. So let's say if a user, let's say, just asks, "How do citations judge work? " And so I think so there are sort of three things that we look for. One is like citation quality. What is the LLM really citing? So in our product, we give the source and also the snippet. And so based on that, we can really calculate like the precision and recall here. I guess it's easier to calculate precision here because you can just look at the snippet, you can look at the source and see what line the LLM is referring to and see if it really matches to what the exact source says. And then the way we do recall is essentially, you know, we take what other documents came in the search tool and what was not really cited and what could have been relevant using an LLM judge, what could have been relevant to calculate some of the recall metrics and seeing, you know, if it generally tries to cite all the relevant sources for the specific question that we are trying to ask for. Um, the other paradigm I think that we have started is sort of these agentic judges. So since we have built Glean search tool, we have the Glean document reader. and we have a lot of the other tools that gives access to the clean corpus. we can now just have like a loop of these tools with the llm and can really help verify responses. and so a lot of our judges have become a lot more agentic judges and it has become a lot cleaner to sort of evaluate responses. and i think it's right now the most high signal in terms of chat eval sets because now they can really just validate the answer. and then some of the other, one of the other things that we look is tool triggering. so if you see on the left, we sort of show like intermediate steps and sort of what tools the assistant did. and so we can also try to build eval sets, making sure that the right tools get triggered. when are glean search tools being triggered, sort of filter those sessions out. if there is, so essentially like the llm has the ability to sort of use the glean tool with different sort of parameters. but there could be some times where your change introduced some confusion for the llm so that it's failing every time it's trying to call Glean search tool. and so we can look at the failure rates or the tool trigger rates and tool success rates and see how your change sort of affects the error rate for the llm. and so we also have that metric to see how can we sort of improve our change. some other things beyond quality, at least in chat that we look for. number one is tokens, specifically because like as lauren mentioned, glean search tool returns 8 to 16 results. and let's say if you're working on some change that tries to increase the context selection or try to improve context selection, you want to make sure that the number of input tokens are not increasing by a lot. since the more input tokens. You increase, you'll have a hit on latency, the cost will also increase, and generally you would want to keep your LLM context as clean as possible. So it's very important to sort of measure the token profiles, looking at the input, making sure that we are not introducing too many reasoning tokens for the LLM. And then also looking at latency, how our time to first token and end-to-end latency changes. Another thing that we look at and we try to optimize for is loop count, because we believe that we have the best. enterprise search. and so we want to make sure that every tool that the llm is doing is intentional and is not failing or getting bad results out of it. and so trying to make sure that these agentic loops and because nowadays like the agents would be running tens, 20s, even hundreds of loops, trying to make sure that how could have llm avoided this loop and optimizing, making sure that your change is. geared towards that. and then also looking at some of the other rates such as like what are the different tool invocation rates and the citation rates. so now just to sort of talk about the different trade-offs and especially like search specific eval sets and chat eval sets.

另外,既然我们现在有了助手产品,而且使用助手产品的人越来越多,搜索在某种程度上就成了LLM可以调用的一个工具。 因此,我们还需要弄清楚,如何评估用户进行的聊天及聊天会话。 如我们之前提到的,我们有基于使用情况的评估集和合成评估集,针对每一类,我们都有不同类型的LLM评审员。 或者说,我们会查看不同的评审员。 因此,对于基于使用情况的评估集,每当有改动时,我们通常会运行一个成对完整性评审器。 它的作用是帮助我们判断:与旧版本相比,新改动的完整性如何? 它是否引入了新信息,是完全完整,还是缺少了某些内容? 这一判断基于我们制定、并与之充分对齐的评分标准。 黄金标准集和原始查询。 然后对于已知的标准答案,我们可以运行LLM评判器来检查正确性。 这里,评判器关注的是信息是否与回复中的内容真正一致。 因此,实际上是在优化LLM所引用的信息,并确保它与标准答案中的内容相符。 所以我们可以在这里拆解回复质量。 那么在左边,我们有一个示例。 问题。 假设用户只是问:"引用评判是如何工作的? "我认为我们主要关注三个方面。 第一是引用质量。 LLM究竟引用了什么? 在我们的产品中,我们会提供来源以及片段。 基于这些信息,我们就可以计算精确率和召回率。 我想精确率更容易计算,因为你可以直接查看片段和来源,看看LLM引用的是哪一行,并检查它是否与原始来源的内容真正匹配。 至于召回率,我们的做法基本上是:利用LLM评判器,找出搜索工具返回的其他文档中哪些未被引用、哪些本可以相关,从而计算部分召回率指标,并观察它是否总体上会尽量引用针对特定问题的所有相关来源。 嗯,我们开始采用的另一种范式是所谓的智能体式评判器。 由于我们构建了Glean搜索工具,因此也拥有Glean文档阅读器。 此外,我们还有许多其他工具,可以访问Glean语料库。 我们现在可以让这些工具与LLM形成一个循环,从而真正帮助验证回复。 因此,我们的许多评判器已经变成了更具智能体性质的评判器,评估回复也变得更加简洁明了。 我认为,就目前而言,这是聊天评估集中信号价值最高的方法,因为它们现在可以真正地验证答案。 还有其他一些我们会关注的内容,其中之一是工具触发情况。 如果你看左边,我们会展示中间步骤,以及助手调用了哪些工具。 因此我们也可以尝试构建评估集,确保正确的工具被触发。 当Glean搜索工具被触发时,将这些会话筛选出来。 如果有的话。本质上,LLM能够使用带有不同参数的Glean工具。 但有时你的改动可能会给LLM带来混淆,导致它每次尝试调用Glean搜索工具都失败。 因此我们可以查看失败率或工具触发率和工具成功率,看看你的改动如何影响LLM的错误率。 所以我们还有这个指标,用来看如何改进我们的改动。 除了质量之外,至少在聊天场景中,我们还关注其他一些方面。 第一是token,特别是因为正如Lauren提到的,Glean搜索工具会返回8到16条结果。 假设你正在做某项旨在增加上下文选择或改进上下文选择的改动,你需要确保输入token数量不会大幅增加。 因为输入token越多, 延迟就会受到影响,成本也会增加,而且通常你会希望尽可能保持LLM的上下文简洁。 因此,很重要的一点是衡量token分布情况,观察输入,确保我们不会给LLM引入过多的推理token。 然后还要看延迟,即首token时间和端到端延迟如何变化。 我们关注并努力优化的另一个指标是循环次数,因为我们相信我们拥有最好的 企业搜索。 因此我们要确保LLM执行的每一次工具调用都是有意图的,而不是失败或得到糟糕的结果。 因此要努力确保这些智能体循环——如今智能体会运行数十次、二三十次,甚至数百次循环——考虑LLM如何能够避免这些循环,并进行优化,确保你的改动 朝着这一目标努力。 然后还要看看其他一些指标,比如不同的工具调用率是多少,以及引用率。 那么现在来谈谈其中的各种权衡,特别是搜索专用评测集和聊天评测集之间的区别。

i think our search eval sets or generally the search eval sets are more deterministic since there's no element of llms and. you can easily figure out what the answer is to based on clicks, citations. and i think we have also come at a reasonable state where we can really expose thousands of results to the llm and run a very high reasoning based llm model to really go through the entire sort of thousand of results and mine good pairs out of it. and but yeah, of course, like search is now. a tool that the larger assistant in llm uses. so it doesn't cover the full stack when we do the search evals, which is why it's important to also see how it interacts with the harness, how the llm sort of uses the tool. but yeah, we have the problems of like the noisy llm responses, higher token costs. and it's still, even with these agentic judges, it's very hard to compare like what a four out of five looks like compared to what a 4.1 out of five looks like.

我认为我们的搜索评测集,或者说搜索评测集整体上,更具确定性,因为其中不涉及大语言模型的任何因素。 你可以根据点击和引用,很容易地判断出正确答案是什么。 而且我认为我们已经达到了一个比较合理的状态,可以向大语言模型展示成千上万的结果,并运行一个推理能力很强的大模型,真正遍历这数千条结果,从中挖掘出优质的数据对。 不过,当然,搜索现在已经成为 大型助手和大语言模型所使用的一种工具。 所以,做搜索评测时,它并不能覆盖完整的技术栈,这就是为什么还需要观察它如何与外部框架交互,以及大语言模型如何使用这个工具。 不过,我们也面临一些问题,比如大语言模型的回复噪声较大,以及token成本较高。 而且,即使使用这些智能体式评判器,仍然很难比较四分制中五分之四的得分与四点一分之五的得分究竟意味着什么。

说话人 0

how do you like to think about balancing between precision and recall for your search? how do you go about making the trade-off? is it different for every customer using it? do they make the trade-off? do you make it for them? what do you do?

你是如何看待搜索中精确率与召回率之间平衡的? 你们是如何进行这种权衡的? 每个使用搜索的客户情况是否不同? 是由他们自己做权衡,还是由你们替他们决定? 你们替他们做决定吗? 你们具体怎么做?

说话人 1

so at least for search, i think what our goal has been right now is since now search is more of a, we're becoming more of a tool for assistant, we really want to optimize recall at. whatever the search, whatever the llm wants, like if it wants 16 results, we want to make sure that our recall at 16 is really good. because what we have seen is that the llm is a lot better in sort of figuring, like citing even the 10th source. whereas in the click and search world, the humans would really just click on the top three documents, like literally the first document most of the times. but the llm sort of actually reads through like the 16 documents that we pass through it. So I think like what we really try to uh optimize for is recall at 16. So if you can just get it into the 16, that's a good job.

至少就搜索而言,我们目前的目标是:既然搜索正越来越多地成为助手的工具,我们就really希望在 无论搜索返回多少结果、无论大语言模型需要多少结果的情况下优化召回率。比如如果它需要16条结果,我们就要确保前16条的召回率足够好。 因为我们观察到,大语言模型在引用内容方面表现得更好,甚至能引用到第10个来源。 而在点击式搜索的场景中,人类通常只会点击排名前三的文档,大多数情况下几乎就是第一条文档。 但LLM实际上会通读我们传给它的16份文档。 所以我认为我们真正努力优化的是前16个结果的召回率(recall at 16)。 所以如果你能把它放进前16名,那就是很好的结果。

说话人 0

I love that. Like uh so like okay, 'cause the customer of the search is agents. So you just thought about it differently because now people are, you know, using chat to get at the search, not doing the search most of the time. That's what you're saying.

我很喜欢这一点。 就是说,好的,因为搜索的客户是智能体(agents)。 所以你的思路不同了,因为现在大多数时候人们是通过聊天来使用搜索,而不是自己去搜。 你的意思是这样。

说话人 2

Yeah, I guess to build off of that, um we do also use mean average precision um specifically like when training our search models um because like you know if you have. a document ranked in like the 12th position versus the 10th position, like that's going to get the same recall at 16 score. Um, but we do like want it to move up within that 16 as much as possible. Um, so we use like MAP typically, like at training time and as like kind of a more continuous metric to optimize on. Um, but then like recall at like 16 or 8 or whatever our current like num results is, is like the top line that we would then track.

是的,我想在此基础上补充一点,我们确实也会使用平均精度均值(mean average precision,MAP),尤其是在训练搜索模型的时候,因为如果一份文档排在第12位和第10位,它们在前16的召回率得分是一样的。 一份文档排在第12位和第10位,它们的recall at 16得分是一样的。 但我们确实希望它在这16个结果中尽可能往前移。 所以我们通常在训练时使用MAP,把它作为一个更连续的优化指标。 但最终我们会跟踪的核心指标,是前16、前8或者当前设定的结果数量下的召回率。

说话人 1

Makes sense. Yeah. And also I think like maybe Lauren can talk more, but also like with regards to context selection, I think we are in a world where the agent can also like have a sandbox and can you know dump the entire search results or documents into it. So it becomes a lot more important in like sort of what snippets we want to write or what snippets we want to give to the LLM in the context. So I think there I think we are starting to right now we were a lot more recall optimized, but now there we are starting to be a lot more precise and I know Lauren has been working a lot in making. and making sure that the snippets that we choose are a lot more precise. and because we are also moving in a world where you don't really want to overload the llm context and try to reduce the token cost, especially when you're dealing with a lot more frontier models. so in the snippet selection, i think we are starting to move more towards precise and clean snippets and ability for the agent to go back to the sandbox and read the entire document if needed.

说得通。 是的。 另外我觉得,Lauren可能可以多谈谈上下文选择的问题,但我觉得我们现在所处的环境是,智能体也可以拥有一个沙盒环境,它可以把整个搜索结果或文档都导入其中。 所以,我们提供给LLM上下文的具体片段(snippets)变得重要得多。 所以我觉得我们现在开始转变了:之前我们更注重召回率,但现在我们开始更加注重精确度。我知道Lauren一直在致力于让我们选择的片段更加精确。 并确保我们选择的片段更加精确。 而且我们正在进入一个不希望过度占用LLM上下文、并要降低token成本的时代,尤其是在使用越来越多的前沿模型时。 所以在片段选择方面,我认为我们开始转向精确、简洁的片段,同时让智能体在需要时能够回到沙盒中阅读整份文档。

说话人 0

And you mentioned that you do have some LM judges and that you have human labels and or you have ground truth that you're sort of using to calibrate them. How much effort do you go through to acquire these labels? I understand like some of them are easier than others. Like you have the synthetic data set, which is, you know, it's a nice way. Yeah, like what is involved in like getting some like these labels?

你提到你们确实有一些LM评判器,并且有人工标注或者真实标签,用来校准它们。 为了获得这些标签,你们投入了多少精力? 我理解其中一些比其他的更容易获得。 比如你们有合成数据集,这是个不错的办法。 是的,获取这些标签具体需要做哪些工作?

说话人 1

We do have like two types of ground truth. The one is like the synthetic LLM one, but I think like sort of like with the newer models and. every time like a new model releases, it's very easy to just saturate on synthetic eval sets, it seems like. so now with regards to like how do we get the like golden ground truth, a lot of it is just either like just like company source, crowdsourced, making sure like we go through the data ourselves and make sure like the judges label work well. and now we are also like sort of building this like continuous loop optimization systems where we sort of. as we are looking through these eval entries, if we see like a bad eval entry, we sort of notify the llm that, you know, this is like a bad eval entry and then it optimizes the rubric again. and then it has a regression set also so that it doesn't regress completely. i think like, i think just to give more context right now, like at least search and assistant engineers, they're sort of expected to also like. always analyze at least like five to 10 entries. make sure that like it's still like whatever the labels are there, like it's still aligned to what one would expect. and there would be like some times where, you know, as a company or even like we would have people sort of analyze just different evals and just give us some of the ground truth data. because i think one of the other thing is like it's harder for us to just hire. Like some external labelers because a lot of like enterprise specific domain things that they would need to know and which is why right now we have just sort of worked on just like company sourcing.

我们确实有两种类型的真实标签。 一种是合成的LLM标签,但我觉得随着新模型的推出,合成评估集似乎很容易就被模型刷到饱和。 每当新模型发布,合成评估集似乎很容易就被刷满。 至于我们如何获得黄金真实标签,很大一部分要么来自公司内部资源,要么来自众包,同时我们自己也要检查数据,确保评判器的标注工作良好。 现在我们还在构建一个持续循环的优化系统, 在查看这些评估条目时,如果发现有糟糕的评估条目,我们就会告诉LLM这是一条糟糕的评估条目,然后它会重新优化评分标准。 然后它还有一个回归测试集,以确保不会整体退化。 我想补充一些背景信息,至少搜索和助手工程师都被期望去做这件事。 始终至少分析五到十条条目。 确保标签仍然符合人们的预期。 有时候,作为公司,或者我们自己,会让人员分析不同的评估,并为我们提供一些真实标签数据。 因为我觉得另一个问题是,我们很难直接雇用外部标注员, 因为很多企业特定领域的知识是他们需要掌握的,这也是为什么我们目前主要通过公司内部资源来获取标签。

说话人 0

and I love that you make your engineers look at five to ten traces. That's super powerful. Like how do you convince them to do that? Because a lot of places people try to say that but then no one does it. You know, I think yeah.

我很喜欢你们让工程师查看五到十条轨迹的做法。 这非常有效。 比如你们是怎么说服他们这样做的? 因为很多地方人们嘴上这么说,但实际上没人去做。 你知道,我觉得是的。

说话人 1

So essentially every time you sort of work on a feature or you work on an improvement, we sort of. have to make this sort of launch document to make sure that the team is aware about it. but essentially what it is, is like making sure that all the metrics are correct for people to really understand, to make sure the change you're making makes sense. and also like, that's where you sort of add your analysis of like five to 10 queries. so it's not really just any queries. generally like we recommend to, you know, analyze like wins and losses. and i think at least we have good ways of measuring like, this is where the diffs have happened. so if you know like where the most diffs have happened, you can just go there and at least try to see. so in search, it's easy. like you can, since we have like, let's say cr metric, we can like just see like, okay, this is where the search ranking has changed the most. so just, you know, seeing like why the search ranking has changed the most, just reasoning about it. for chat, at least with agentic, we can cleanly tell like when an answer is completely different or at least. how different the answer is. and now it's just like trying to make sure that whatever positives, negatives, the judge says aligning with that label. and so like using that to measure. i think the next thing we'll talk about is just like launching a change end to end and sort of how are we making sure that you can validate the impact with the end users?

所以基本上每次你在做一个功能或改进时,我们都得写一份发布文档,确保团队了解这件事。 需要制作这样一份发布文档,以确保团队知晓相关情况。 但本质上,就是确保所有指标都是正确的,让大家真正理解,确认你所做的改动是合理的。 同时,这也是你添加分析的地方,比如分析五到十条查询。 所以并不是随便什么查询都可以。 一般来说,我们建议分析胜负案例。 至少我们有很好的方法来衡量差异发生在哪里。 所以如果你知道差异最多的地方在哪里,就可以直接去那里,至少尝试看看情况。 所以在搜索中,这很容易。 比如既然我们有像 cr 这样的指标,我们就可以看看,好,这是搜索排名变化最大的地方。 所以只需要想想搜索排名为什么变化最大,进行推理即可。 对于聊天,至少在使用 agentic 的情况下,我们可以清楚地判断一个答案何时完全不同,或者至少判断答案有多大不同。 答案差异有多大。 现在要做的就是确保评判者给出的正面、负面结论与该标签保持一致。 并以此进行衡量。 我想下一步我们会讨论如何端到端地上线一项改动,以及我们如何确保能与终端用户一起验证其影响。

and how are we sort of testing our changes and what sort of signals we are looking for? yeah, so we train, we have a lot of custom ranking models in our, let's say, embedding models or our re-ranking models. and so we sort of train those ranking models on the collected data. so we have like per document signals, and then we sort of log those document signals at query time. and then we have like these clicks and citations data. and then once we have sort of that data, we can sort of train new architectures, or we can also add new signal backfill and see how that would have looked like with the new model. like what would the new score be from the model? and sort of like iterate like that for our like re-ranking models. yeah, so i think as we have already covered, i think the first step for us as engineers always trying to run offline evals first and making sure that the change is geared towards what you expect. so like pure ranking changes, we can just run search for context selections changes, we can just run context selection evals. but for anything that has a lot more interaction with the harness itself, it makes. like we have to run like end-to-end chat evals to really get an idea of the full impact. once we have like offline evals ran and all of the things have been approved, we sort of go for the a-b testing where we sort of split users across different experiment arms and we look at the user interactions between each arm and compare our satisfaction signals. and so by satisfaction signals, What do we typically look for? So in the click world, in the search world, you know, we used to look for things like where the user has clicked, has the user clicked at all. So that would be sort of our way of measuring satisfaction in search. In chat, it's metrics such as like upvote, downvote, has the user clicked on maybe let's say copy response or has the user shared the response. So a lot of the user interactions, but a lot of these user interactions also like sparse. So this might be like very high signal for a few sessions. but sometimes, like a lot of times, these won't be statistically significant to lean too much into it. so we might also have to look into actually like what the user did after the first response, like what were the follow-ups? was the sentiment positive or negative? did the user continue the session or not? so generally, of course, like if the user is still saying the same thing and rephrased it completely differently, that's a bad session that we should be catching. but if the user just starts talking something completely different, that could be like a sign of good satisfaction. but we would also want to make sure that we look at how the first response was answered and make sure that it makes sense to classify that as positive. so a lot of work right now is just, you know, how can we make sure we can mine clean and good signals from the user follow-ups and what the user did in the session. and then we also have like some of the other top line metrics such as. usage metrics, is the user logging in? how have we changed? glean active users, daily active users, weekly active users. if it's like a longer early session, how have we like impacted cost on the user side of things? so those are some like metrics we look in like these a-b experiments.

我们如何测试改动,又在关注哪些信号? 是的,所以我们训练很多自定义的排序模型,比如说,在我们的嵌入模型或重排序模型中。 因此,我们会基于收集到的数据来训练这些排序模型。 我们有每个文档的信号,然后在查询时记录这些文档信号。 然后我们还有点击和引用数据。 当我们拥有这些数据后,就可以训练新的架构,也可以添加新的信号回填,看看使用新模型时结果会是什么样子。 模型给出的新分数会是多少? 我们就像这样不断迭代,优化重排序模型。 是的,正如我们已经讨论过的,我认为作为工程师,我们的第一步总是先运行离线评估,并确保改动符合预期方向。 所以,对于纯粹的排序改动,我们可以直接运行搜索评估;对于上下文选择的改动,我们可以直接运行上下文选择评估。 但对于那些与框架本身有更多交互的改动,它会…… 比如我们必须运行端到端的聊天评估,才能真正了解全面的影响。 离线评估完成并且所有内容都获得批准后,我们就进行A/B测试,将用户分配到不同的实验组,然后观察每组用户的交互行为,并比较我们的满意度信号。 那么,所谓满意度信号,我们通常关注什么? 在点击场景、搜索场景中,你知道,我们过去会关注用户点击了哪里、用户到底有没有点击。 这就是我们在搜索中衡量满意度的方式。 在聊天中,指标包括点赞、踩、用户是否点击了复制回复,或者用户是否分享了回复。 用户交互很多,但其中很多交互也比较稀疏。 因此,它对少数几个会话可能是非常强的信号。 但很多时候,这些信号在统计上并不显著,不宜过度依赖。 所以,我们可能还需要具体查看用户在第一次回复之后做了什么,比如有哪些后续追问。 情感是正面还是负面? 用户是否继续了这个会话? 所以一般来说,当然,如果用户还在说同样的内容,只是换了一种完全不同的方式重新表述,那就是一个我们应该捕捉到的糟糕会话。 但如果用户开始谈论完全不同的内容,那可能说明用户很满意。 但我们也希望确保看一下第一条回复是如何作答的,并确认将其归类为正面是合理的。 所以目前很多工作,你知道的,就是如何确保我们能从用户的后续跟进以及用户在会话中的行为中挖掘出干净、可靠的信号。 然后我们还有一些其他的顶层指标,比如。 使用指标:用户是否在登录? 我们的情况发生了怎样的变化? Glean 活跃用户、日活跃用户、周活跃用户。 如果是较长的早期会话,我们对用户端的成本产生了怎样的影响? 所以这些是我们在类似的 A/B 实验中会关注的一些指标。

说话人 0

it's really obvious to me that y'all are really good. this is probably the best example of a real company doing evals the right way. Or that scene, and that means a lot. So I've seen like many different companies.

我很明显能看出,你们都非常优秀。 这可能是一家真正的公司以正确方式进行评估(evals)的最佳范例。 或者那个场景,这意义重大。 所以我见过很多不同的公司。

So a lot of people always want to know, like, how do you structure your team with regards to evals? Do you have a separate team doing evals? Is everybody doing evals? Is there like an eval expert? How do you go about it? How do you get everybody? Or how does this work at Clean?

所以很多人总是想知道,比如,你们如何围绕评估(evals)来组织团队? 你们是否有一个专门负责评估的团队? 是每个人都在做评估吗? 是否有一位评估专家? 你们是怎么做的? 你们是怎么让所有人都参与进来的? 或者说,这在 Clean 是怎么运作的?

说话人 1

So I think right now we are at a stage where everyone is doing evals. So we do have an eval team, and the eval team is sort of responsible for making sure. that the infra works correctly, the running of the queries are correct, you know, all the production and the infra stuff. we have a specific dedicated team that works on that. and we also have another team that sort of works on how can we make eval tool better for engineers? how can we like work with like search team, assistant team? how can we take feedback from judges and improve judges? how can we maybe like. go from pairwise judges to list-wise judges. so we have another team sort of working on that specific set of problems. but within, let's say, the search assistant, whenever you're working on speech or any improvement also, i think everyone is sort of expected to look through the data and see what sort of things they are impacting. and then once you have sort of launched the feature, how can you create a good eval set for anyone to use in future? how can you create a golden eval set so that it can be used as a regression eval set for future chat changes? and then to some extent, i guess trying to build upon the eval set for that specific feature itself. so for example, just to give an example, i think we had built. a lot of like embedding retrieval synthetic eval sets. and then one sort of like we saw like gains on those eval sets and we launched a feature out. how can we like then like have those eval sets to go to production and then make sure that like it's maintained well. so that's what i mean like, you know, sort of like everyone who works on a feature and improvement is sort of also expected to make sure that their feature is well represented and has like a golden set for future changes or future regression sets to catch up on. But yeah, Lauren can add more.

所以我觉得目前我们正处于一个阶段,每个人都在做评估(evals)。 我们确实有一个评估团队,这个团队大致负责确保 基础设施正常运行、查询的执行正确,你知道,所有生产和基础设施方面的工作。 我们有一个专门的团队负责这些工作。 我们还有另一个团队,主要研究如何让评估工具对工程师更好用。 比如,怎样和搜索团队、助手团队合作? 怎样从评判器(judges)中获取反馈,并改进评判器? 比如,我们能不能 从成对比较的评判器转向列表式评判器? 所以我们有另一个团队专门处理这一类问题。 但在搜索助手团队内部,无论你在做语音还是其他改进,我想每个人都被期望去查看数据,了解自己的改动会影响哪些方面。 而且一旦功能上线,你要如何为以后的任何人创建一个好的评估集? 你要如何创建一个黄金评估集,以便将其用作未来聊天改动的回归评估集? 在某种程度上,我想还要在该特定功能已有的评估集基础上继续构建。 举个例子,我们之前构建了 大量基于嵌入检索的合成评估集。 然后我们在这些评估集上看到了提升,于是就把功能上线了。 那么我们要怎样才能把这些评估集投入生产,并确保它们得到良好的维护? 我的意思是,每个负责某项功能或改进的人,大致也都被期望确保自己的功能得到充分体现,并为未来的变更准备一个黄金数据集,或者为之后的回归测试集做好准备。 不过,Lauren 可以再补充一些。

说话人 2

Yeah, yeah, I think that covers most of it. Yeah, I would say, you know, we have like our our eval team that handles infra and just like make sure everything runs smoothly, but like the onus is generally on the engineer who's launching a change to make sure that they are like building the like whatever eval set or runner is needed to like get metrics for their change. And I think also that like we just generally have a pretty metrics driven culture, I would say. And so. You know, if you're trying to get something launched, you need to be able to prove that it improves metrics. And so there's sort of an incentive to like figure out the best way to actually measure the affected slice so that you can get that to work well.

是的,是的,我觉得这基本涵盖了大部分内容。 是的,我想说的是,我们有专门的评估团队负责基础设施,确保一切运行顺畅,但通常由推出变更的工程师来承担主要责任,他需要构建所需的评估集或运行器,以获取其变更的指标。 我还认为,我们总体上有着非常注重指标的文化。 所以…… 如果你想推出某项功能,就需要能够证明它确实提升了指标。 因此,人们有动力去想办法找到最佳方式来衡量受影响的细分群体,从而让它真正发挥好作用。

说话人 0

That's great. Yeah. I mean, it seems like you're doing both. You have like a centralized eval team that's like do like infrastructure and you're making everybody think about evals at the same time. Yeah, it's curious. I wonder if this level of focus on evals and this level of rigor is. is like something to do with the fact that you all started with search. You know, search tends to be very metrics driven. So maybe that culture just continued.

很好。 是的。 我的意思是,看起来你们两方面都在做。 你们有一个负责基础设施的集中式评估团队,同时也让每个人都在思考评估的问题。 是的,这很有意思。 我在想,你们如此重视评估、如此严谨,是否与你们最初从搜索业务起家有关。 是的,这种文化可能就是这样延续下来的。 搜索业务往往非常注重指标驱动。 所以这种文化可能就这样延续下来了。

说话人 2

For sure.

当然。

I was going to go through like an example of how we would launch a change. So something we did like several months ago was a pretty like large revamp restructuring of like our backend search architecture. So we were training like an entirely new model to replace what we had before. So this was a pretty big change over like several months that required like multiple steps of like training, eval, and iteration. So the first step obviously is training the new architecture. So for like our training data for search, we generally use pretty much the same data that we then use in evals, of course with like a split so that we don't mix data in between the two. But it's the same like click and citation data mapping like queries to canonical documents. And so using that we can get like a very large data set to experiment on. So then like completely offline, like fully detached from like. the main like production search pathways, we can do like experimentation with, you know, any architectural decisions, input features, etc. and so that's just like, you know, classic ml work. and then we arrive at some kind of eval candidate. and so once we have this candidate, we'll move into using our like production evaluation system. so this is once like the new architectural change has been kind of like merged into. production behind a flag gate so that we're able to like make sure that the QoderWorks fully in production. so run like large search evals and look at the same metrics we've been talking about. so top line search metrics, things like latency. i want to make sure there's not like regressions for specific data sources or anything weird there. and then once we have like a finalized launch candidate in search evals, we start with search evals because they're. cheaper and deterministic, then we can move on to chat evals to fully understand end-to-end impact once it's in chat. So the hope there is that things like loops, latency, and token count will go down because if you're able to retrieve the relevant results more quickly, hopefully the chat will be able to produce a response more quickly. And then also hope that quality metrics either improve or stay consistent. Yeah, and then I guess as um Manav was talking about, we then have live experiments typically after eval. And so the main advantage of a live experiment is just that like the sample size is much larger um because this is just real user sessions. And there's also more like quality feedback than in an offline eval where we might not have like either it's user-generated data where you know we don't have a clear canonical answer or it's synthetic data which might not be fully representative. So in live experiment we can measure like real-time satisfaction signals from our users to things like upvotes and response copies and so on. Um, as well as, you know, the general like cost and latency metrics.

我本来打算讲一个例子,说明我们会如何推出一项变更。 大约几个月前,我们做了一项相当大的改动,对后端搜索架构进行了较大规模的重构。 因此,我们训练了一个全新的模型来取代之前的模型。 这次改动历时几个月,相当大,需要经过多个步骤,包括训练、评估和迭代。 所以第一步显然是训练新架构。 至于搜索的训练数据,我们通常使用与评估相同的数据,当然会进行划分,以确保两者之间的数据不混用。 不过,这些数据是相同的点击和引用数据,它们将查询映射到规范文档。 利用这些数据,我们可以获得一个非常大的数据集用于实验。 所以,这一步完全是离线进行的,与主要的线上生产搜索流程完全分离。 在这种环境下,我们可以针对任何架构决策、输入特征等进行实验。 这基本上就是典型的机器学习工作。 然后,我们会得到某个评估候选模型。 一旦有了这个候选模型,我们就会转入使用生产评估系统。 这一步是在新的架构改动已经合并到生产环境、并通过功能开关控制之后进行的。 这样我们就能确保QoderWorks在生产环境中完全正常运行。 因此,运行大规模的搜索评估,并查看我们之前讨论过的相同指标。 也就是整体的搜索指标,比如延迟等。 我想确保特定数据源不会出现性能回退,或者其他异常情况。 然后,一旦我们在搜索评估中得到最终的上线候选版本,我们会先从搜索评估开始,因为它们成本更低且结果具有确定性。 之后,我们再转向聊天评估,以便在模型接入聊天功能后,全面了解其端到端的影响。 因此,我们希望循环次数、延迟和token数量都能下降,因为如果能更快地检索到相关结果,聊天就有望更快地生成回复。 同时也希望质量指标要么提升,要么保持稳定。 是的,然后我想,正如Manav之前提到的,我们通常会在评估之后进行线上实验。 线上实验的主要优势在于样本量大得多,因为这些都是真实用户的会话。 而且,与离线评估相比,它还能提供更多质量反馈。离线评估中,我们可能没有明确标准答案的用户生成数据,或者可能无法完全代表实际情况的合成数据。 所以在线上实验中,我们可以衡量用户的实时满意度信号,比如点赞、复制回复等等。 嗯,还有一般的成本和延迟指标。

说话人 1

Yeah, I think it's also important to talk some of the other like real-time metrics that we sort of track and this is to like inform a lot of our changes and in some way sort of helps how we sort of evaluate new features or new development. So what are some regressions outside of launches, right? Uh, let's say we launch something, are we making sure the user is satisfied? Let's say if the user is satisfied, did the cost increase or decrease? Um, so like I think as we already mentioned, we really track all of these metrics to make sure. it makes sense and have alerts if they don't. and then that helps us also inform whether, you know, a particular offline eval set really helped us or not. and so that's how we sort of build intuitions out of it. and i think like that's sort of important to figure out, you know, when would a particular offline set correlate to like the end user metric. so for example, like just to give an idea of an intuition. like our click search eval set, we know that's a lot biased towards clicks that it already has received because that's what the user was seeing. we wouldn't expect huge changes or huge improvements in click eval set unless like it's a very major change. generally, like click eval sets have been more like sometimes an indication for us, like if we are significantly regressing or something. and then we would rely more on like. some of the other synthetic sets, some of the citation sets on llm to see like if the change is improving there or not. and then once we know that, okay, like satisfaction has improved by that much because we saw that much gain in the citation eval set, we have a better intuition on seeing like, okay, what percent of like satisfaction can we expect when citation moves by that much? so that's that sort of stuff really like helps us like like the end sort of. regressions or like looking at the satisfaction at the end and how can does it correlate to the offline eval sets and then how can we build intuitions out of it. So we can go to like an example regression which was basically due to dropped logging. So we really rely on signals, uh, log signals for our re-ranking and retrieval. And so if like a logging is missed for a given data source, that it could completely be that we just don't see that data source in search or the assistant just doesn't cite it or doesn't see it at all. and so one small example we had is we had a regression where we were not logging slack documents correctly, like the slack children threads correctly. and so we were not logged citations based on that. and so that affected like our sort of that affected our the citations that we had on slack data source itself. and this is something that. wasn't as cleanly caught in offline, but when we were looking at tracking metrics per data source, we saw that, okay, wait, why slack not being cited enough? that's then, that's when we sort of then looked back and sort of figured out, okay, we have a missing signal logging. and then how can we make sure that, you know, our offline eval sets then get improved and making sure that we are also making, as we talked about, you know, looking at tool trigger rates, looking at like different app also, like how making sure that like app rates. citations within different apps doesn't fall to a certain degree. yeah, we also have like making sure that, you know, we catch latency regression, where the smallest of changes can cause huge of latency regression in our experiences. so making sure that we actively monitor search latency, chat latency, looking at different percentiles and have a good grasp of what your change would do to the distribution. And I think we are also in a world where, you know, we can't just route everything to the best model possible. So it's really important to route and figure out how to correctly calculate cost. You know, some models are very good with image generation slides, but that still requires info seeking and stuff. And so that will also involve the use of green search tools. So therefore, it's very important to see like how a particular like feature trigger has changed over time, whether image generation slides have changed over time, and how does the cost profile look there. and then within search also, like, you know, looking at like index reliability and how the costs change there. cool. yeah. so what's next?

是的,我觉得还需要谈谈我们追踪的其他一些实时指标。这些指标用于指导我们的许多改动,在某种程度上也有助于我们评估新功能或新开发内容。 那么,除了上线之外,还有哪些回归问题呢? 比如说,我们上线了某个功能,要确保用户是满意的吗? 假设用户满意了,那成本是增加了还是减少了? 嗯,正如我们已经提到的,我们确实会追踪所有这些指标,以确保它们合理,如果不合理就设置告警。 这也有助于我们判断某个特定的离线评估集是否真的对我们有帮助。 而这也有助于我们判断某个特定的离线评估集是否真正帮到了我们。 我们正是通过这样的方式逐步建立起直觉判断的。 我认为,弄清楚某个特定离线评估集在什么情况下会与最终用户指标相关联,这一点很重要。 举个例子,为了让大家有个直观的概念。 比如我们的click search评估集,我们知道它很大程度上偏向于已经获得点击的内容,因为那是用户当时看到的结果。 除非是非常重大的改动,否则我们不会期望点击评估集出现巨大的变化或提升。 总的来说,点击评估集有时对我们来说是一个指示信号,比如如果我们出现了明显的回归。 然后我们会更多地依赖于…… 一些其他的合成数据集,以及 LLM 上的一些引用数据集,用来看看这项改动在这些数据集上是否有所改善。 然后,一旦我们知道,好,因为我们在引用评估集上看到了那么大的提升,满意度也相应提升了这么多,我们就能更好地直觉判断:当引用指标变动这么多时,满意度大概能提升多少百分比? 所以这类工作真的很有帮助,它能帮助我们把握最终的情况。 也就是回归问题,或者看最终的满意度,以及它与离线评估集的相关性如何,然后我们如何从中建立直觉。 所以我们可以看一个示例性的回归问题,它基本上是由日志丢失导致的。 因此,我们在重排序和检索上非常依赖信号,也就是日志信号。 如果某个数据源的日志缺失,很可能我们在搜索中根本看不到该数据源,或者助手就是不引用它,甚至完全看不到它。 我们遇到的一个小例子是:一次回归中,我们没有正确记录 Slack 文档,比如 Slack 的子线程没有被正确记录。 因此,我们也没有基于这些内容记录引用。 这样一来,就影响了 Slack 数据源本身的引用情况。 这一点。 在离线评估中没有被干净地捕捉到,但当我们按数据源跟踪指标时,我们发现:等等,为什么 Slack 被引用的次数不够? 这时我们才回头去查,最终弄清楚了:我们存在信号日志缺失的问题。 然后,我们如何确保离线评估集得到改进,并如我们之前所讨论的那样,关注工具触发率,关注不同应用的情况,确保各个应用的引用率不会下降到某个程度。 不同应用内的引用不会下降到一定程度。 是的,我们还需要确保捕捉延迟回归,因为最微小的改动也可能在我们的体验中造成巨大的延迟回归。 所以我们要主动监控搜索延迟和聊天延迟,关注不同的百分位数,并清楚地了解你的改动会对分布产生什么影响。 而且我认为,我们现在所处的环境是,不能把所有请求都交给可能的最佳模型来处理。 因此,关键在于如何进行路由,并正确计算成本。 你知道,有些模型非常擅长图像生成、幻灯片制作,但这些任务仍然需要信息检索等操作。 因此,这也会涉及使用绿色搜索工具。 所以,很重要的一点是要看看某个特定功能的触发情况是如何随时间变化的,图像生成的时机是否随时间有所改变,以及那里的成本结构是什么样的。 然后在搜索方面,比如,你知道的,要看索引的可靠性以及成本在那里是如何变化的。 好的。 嗯。 那接下来是什么?

and like, what are we doing? what are we building for eval sets as well as how are we sort of improving our flow? so yeah, evals has always been like a cat and mouse game. you build a particular eval, you start doing well at it. a new model drops or maybe a saturated eval. and now, you know, you have to keep on iterating through the evals. so at least that's definitely a pattern with synthetic. with sort of the usage-based evals, it's more like a feedback loop. but you also want to avoid the case where, you know, like as we already mentioned, we try to avoid, we split the training data and the eval data. but you don't want to be really mixing the two or like avoiding like loops that are detrimental for development. so i think like one thing we are doing is, of course, building larger and cleaner golden sets, building more representative data, feature specific data, working with different teams and making sure we have the right data, whether it's usage, whether it's synthetic, but scaling up for each and every feature and query slice. and then now we have like decision based modeling. so we can at least cleanly go and really create good subsets out of these data. and once you have good subsets out of the data, an engineer or researcher can quickly run a lot of different subsets that they think they have affected on and then run evals on. i think we are also working more towards reproducibility because glean has a lot of like write actions, a lot of creating docs, creating slides. and so when you're running these chat evals, how can we make sure that we simulate those actions as correctly as possible based on that time, that users, that level of documents that they had? we're also working on how can we cleanly iterate on online signals because we want to make sure that we get a clear engagement data out of it. and then another thing that we are really focusing on is multi-turn evals. and i think mainly it's working on this simulation loop. and if you do a change, how can we make sure that the entire 10 turn. eval is correctly simulated, at what point, you know, we'll have deviances and we want to sort of figure out, okay, like why did it deviate? and we are working, the eval team is working really on how can we simulate multi-turn evals correctly and as accurately as possible. so i think this is what we have for the slides. i think the best way to sort of learn about evals is trying to construct an eval set. on your own and because that really gives you perspective on like what you're trying to eval, how the infra looks like, what metrics you want to track. and then once you sort of build changes, how does it look on the eval set? i think like at glean generally in search team, we have all built eval sets for our features or improvements of either custom or actually make changes to the infra side ourselves sometimes. but that's been the best way sort of. helping us really ground ourselves with the data or the query or the feature that we're working on.

我们要做什么? 我们要为评估集构建什么,以及我们如何改进我们的流程? 所以,是的,评估一直像是一场猫鼠游戏。 你构建了一个特定的评估,你开始在上面表现良好。 新模型发布,或者评估已经饱和。 现在,你知道的,你必须不断迭代评估。 所以至少这绝对是合成数据中的一种模式。 对于基于使用情况的评估,更像是一个反馈循环。 但你也希望避免这样一种情况,就像我们之前提到的,我们会尝试避免,将训练数据和评估数据分开。 但你不希望真正将两者混在一起,或者出现那些对开发有害的循环。 所以我认为我们正在做的一件事,当然是构建更大、更干净的黄金数据集,构建更具代表性的数据,针对特定功能的数据,与不同团队合作并确保我们拥有正确的数据,无论是使用数据还是合成数据,但要为每个功能和查询切片进行扩展。 然后现在我们有了基于决策的建模。 因此我们至少可以清晰地从这些数据中创建出好的子集。 而一旦你从数据中得到了好的子集,工程师或研究人员就可以快速运行许多他们认为受影响的不同子集,然后在这些子集上运行评估。 我们也在更多地朝着可复现性努力,因为 Glean 有很多写入类操作,比如大量创建文档、创建幻灯片。 那么在运行这些聊天评估时,我们如何确保能够尽可能准确地模拟这些操作,包括当时的时间、用户以及他们拥有的文档层级? 我们还在研究如何干净地迭代在线信号,因为我们希望确保能从中获得清晰的用户参与度数据。 另外,我们真正重点关注的还有多轮评估。 我认为主要工作集中在这个模拟循环上。 如果做了一项改动,我们如何确保整个10轮的评估都被正确模拟? 在什么节点会出现偏差,我们想弄清楚:好,它为什么会偏离? 评估团队正在努力研究如何正确、尽可能准确地模拟多轮评估。 所以我认为这就是我们为幻灯片准备的内容。 我认为了解评估的最佳方式是尝试自己构建一个评估集。 因为这确实能让你理解你要评估什么、基础设施是什么样的、想要追踪哪些指标。 然后一旦你做出改动,它在评估集上的表现如何? 我认为在 Glean 的搜索团队中,我们通常都为自己的功能或改进构建过评估集,有时也会自己对基础设施进行改动。 但这一直是最好的方式。 它帮助我们真正立足于所处理的数据、查询或功能。

说话人 0

Now, this is an excellent presentation. Like I said, you know, I've been teaching evals for the last three years and we've had many guest talks over the years. People always ask me, what is the best example of someone doing evals? This talk is going to become the best public example now of someone doing evals. I mean, it's very good. I'm really glad that you shared this. i think a lot of people are going to learn from this. you know, it covers a lot of ground, everything from like, you know, synthetic data, offline evals, the search component, how that goes downstream. you also talked about product metrics. i mean, it really covers like the whole gamut and it's very comprehensive. how do you go about hiring people? because, you know, it's evident to me like, okay, you're really, your team is really good at this eval and they have a lot of rigor. a certain skill sets that you look for? do you try to hire people with a certain background that would be, you know, that you find that are better at this? do you think about this in a certain way? or is it just, yeah, can you talk about that?

现在,这是一场出色的演讲。 正如我所说,我已经教授评估课程三年了,这些年我们有过许多嘉宾讲座。 人们总是问我,谁是做评估的最佳范例? 这场演讲现在将成为公开的最佳评估实践范例。 我的意思是,它非常好。 我很高兴你分享了这些内容。 我想很多人都会从中受益。 你知道,它涵盖了很多方面,从合成数据、离线评估、搜索组件,到这些内容在下游是如何运作的。 你还谈到了产品指标。 我的意思是,它真的涵盖了方方面面,非常全面。 你们是如何招聘人才的? 因为在我看来很明显,你们的团队在这种评估方面非常出色,而且非常严谨。 你们会寻找某些特定的技能组合吗? 你们是否会倾向于招聘具有某种背景的人,你们觉得这样的人在这方面更擅长? 你们是否以某种特定的方式考虑这个问题? 还是说,就是,嗯,你能谈谈这方面的情况吗?

说话人 1

yeah, so it's a great question for my manager. but i think like at least when search, what i've seen is people who are good in like thinking quantitatively really helps definitely. and so at least like some of our interview rounds is like just, you know, talking about like probability statistics or just going a little deeper on how you think about these things. and i think it's just like basically skills to sort of understand and quickly realize, okay, like how could you understand the metrics much quicker? it sort of helps with that. so that's definitely one sort of skill i think that our team looks for, just like quantitative analysis. so at least like i think. some of my interview questions have been just like, you know, something like as simple as like talking more about like binomial distribution or chain rules or something like that. so just strengthening the basics of probability statistics and basic calculus for sure. i think one other thing is just like with search, one skill, which is a little harder to see during interviews, but will do you wonders in search is. having the ability to build intuitions. and it's important to really like have a hunch, try things out, eval, and then like either succeed, fail, and quickly work on your intuition. and i know like the best of engineers at glean within search are ones that have intuitions about a particular stack and how they can quickly iterate through and either try their intuitions out. so i know like, for example, like just like a very basic example is it could be like, you know, you're working with search queries and you are starting to realize that, oh, wait, like we have like, like, let's say it's like someone is typing the launch doc and like, why are we really attaching synonyms to the and then be like, okay, like this is like a useless word or like how like why are we attaching bigrams synonyms to this? and so like, how can i quickly like drop these synonyms quickly like run a ranking change? So like always sort of questioning, like you know, like testing the query out, why is the ranking certain way? Like having those sort of curiosity moments and those moments where you are like having some intuition about the stack. I think that will sort of help you a lot in making like good changes within search. I think you're three just being passionate about the new. I think like since like LLMs are there, I think you can definitely like scale a lot of a lot of the synthetic stuff quickly. You can like really get it to go through like trace and spans quickly. Like it can read a lot more at the end of the day. But you should be the one driving that analysis and having that intuition to get the change out.

嗯,这是个很好的问题,不过更适合问我的经理。 但我觉得,至少在搜索方面,我看到的情况是,善于定量思考的人确实很有帮助。 所以至少在我们的一些面试环节中,就是聊聊概率统计,或者更深入地探讨一下你是如何思考这些问题的。 我认为这基本上是一种能力,能够理解并迅速意识到,嗯,怎样才能更快地理解这些指标。 这在某种程度上有助于做到这一点。 所以这绝对是我认为我们团队看重的一种技能,也就是定量分析能力。 所以至少我觉得…… 我的一些面试问题就是,比如谈谈二项分布或链式法则之类的内容,看起来很简单。 所以加强概率统计和基础微积分的基础知识,那是肯定的。 我觉得还有一件事和搜索很像,就是一项技能,在面试中比较难看出来,但它对搜索工作大有帮助,那就是能够建立直觉。 具备建立直觉的能力。 重要的是要有一个预感,动手尝试,进行评估,然后要么成功,要么失败,并迅速根据你的直觉进行调整。 我知道在Glean的搜索团队中,最优秀的工程师都对某个特定技术栈有直觉,并且能快速迭代,要么验证自己的直觉。 举个非常基础的例子,比如你在处理搜索查询时,开始意识到,等等,我们为什么要给“the”这样的词附加同义词?比如有人输入“launch doc”,这个词明显没用,那为什么还要给它附加双词组(bigram)同义词呢? 那么,我怎样才能快速去掉这些同义词,比如快速做一次排序调整呢? 所以要始终保持质疑的态度,测试查询,弄清楚为什么排序会是这样。 要有那些好奇的时刻,那些你对技术栈产生某种直觉的时刻。 我认为这会在很大程度上帮助你在搜索中做出良好的改动。 我认为你们这三个人只是对新事物充满热情。 我觉得既然有了大语言模型,就完全可以快速扩展很多合成数据相关的工作。 你可以让它快速地通过trace和span进行分析。 归根结底,它能阅读的内容多得多。 但你应该是推动这一分析并形成直觉、从而推出改动的人。

说话人 0

Sounds great. Okay, we'll end it on that note. Thank you so much. Manav and Lauren, this is an excellent presentation. I really mean it. It's like one of my favorite, maybe my favorite presentation on evals as a guest in this course. So thank you so much. Real quick, if you're building an AI product and you're stuck on how to improve, we put together this free resource on evals to help you. It draws from more than a thousand hours of working with companies on building AI products. When you open the guide, it'll look like this. And what you do is you select the stage that you're at. Maybe you're new to evals, you don't even know what evals are. Maybe you do have evals, but you don't really know what to test. Or maybe you don't trust your eval scores. Or maybe you think your product is just too hard to eval, or it's too time-consuming or expensive. Whatever the case may be, we have a detailed guide customized for what stage you're at. Go to bit. ly/evals-guide and we'll send it to you.

听起来很棒。 好的,我们就以此作结。 非常感谢大家。 Manav和Lauren,这是一场非常出色的演讲。 我是认真的。 作为本课程的嘉宾,这大概是我最喜欢的关于evals的演讲之一,甚至可能是我最喜欢的一个。 非常感谢你们。 简单说一下,如果你正在开发AI产品,并且在如何改进上遇到了困难,我们整理了这份关于评估(evals)的免费资源,可以帮到你。 它汲取了我们与各公司合作开发AI产品超过一千小时的经验。 当你打开指南时,它看起来会是这样。 你需要做的是选择你目前所处的阶段。 也许你刚接触评估,甚至不知道什么是评估。 也许你已经有了评估,但不太清楚该测试什么。 或者,你不太信任你的评估分数。 又或者,你觉得你的产品太难评估,或者评估太耗时、太昂贵。 无论是哪种情况,我们都有一份针对你所处阶段量身定制的详细指南。 请访问 bit. ly/evals-guide,我们会把它发送给你。

摘要

本期内容由 Glean 搜索质量团队的 Manav Agrawal 与 Lauren Shrack 分享企业搜索与 AI 助手的检索评测方法。由于企业数据规模大、权限复杂且信号丰富,公开检索基准难以适用,团队转而基于真实使用日志和合成数据构建自有评测集,覆盖文档检索、上下文片段选择与端到端对话三个层面。讲者介绍了离线批量评测的护栏与可复现设计、检索指标(Recall@K、MAP、CR)、基于 LLM 裁判的回答质量与引用评估,以及 token、延迟和循环次数等成本指标。排序变更从离线评测、端到端对话评测,逐步走向 A/B 实验,并通过用户满意度信号验证。讲者还强调全员参与评测、工程师亲自查看 trace 的文化,以及因日志丢失引发的回归案例。整体对构建企业级 AI 评测体系具有很强的实践参考价值。

章节

00:00 开场与 Glean 产品背景

主持人介绍 Glean 在企业检索领域的地位,两位讲者说明各自在搜索质量团队的工作背景。Glean 最初做企业搜索,跨数百个数据源(约 275 个以上应用连接器)检索文档,并已扩展到助手、协作与文档生成等功能。助手会检索语料、查找文档并在回答中给出引用。本次分享的议程包括:如何构建评测集、如何运行评测、如何端到端上线变更,以及上线后监控哪些指标。

演示搜索流程,展示跨数据源的文档检索过程
展示 Glean 聊天界面
展示回答及其引用来源的位置

01:59 为何不直接使用公开检索基准

公开检索基准难以直接用于 Glean,主要有三个原因:一是索引规模大,部分客户有数十亿文档,且来源多样;二是数据私有,公开基准缺乏足够多样且与企业相关的数据;三是搜索结果需严格遵守权限,公开基准通常假设所有文档对所有人可见,无法体现权限逻辑。此外,公开基准还会丢失 Glean 基于文档构建的大量信号,如访问量、作者、文档新鲜度等。因此团队需要自行构建能准确反映其产品的评测集。

自建评测集与基准的核心结论画面

03:14 基于历史使用数据构建评测集

团队主要构建两类评测集:一类来自真实使用日志,一类来自基于文档语料合成的数据。历史数据来自内部用户对 Glean 搜索和助手的真实使用,分为三种:搜索评测集用于评估文档检索,把查询映射到用户点击的规范文档;上下文选择评测集用于评估文档内片段选择,记录助手在回答中实际引用的片段;端到端对话评测集仅保留用户原始提问,因无法确定历史回答是否正确,所以没有规范答案。对于助手,还会从其调用搜索工具的查询,映射到最终被引用的文档或片段。整套数据通过 map-reduce 形式的流水线从生产 trace 中定期生成,并进行去重、过滤实验流量与调试流量。研究人员还可以按功能(如 operator 过滤)切片构建自定义评测集。

演示中用户在搜索框输入查询并点击文档的操作过程

07:31 基于文档语料的合成评测集

合成评测集基于文档语料生成,并带有规范答案。团队利用新鲜度、访问量等 Glean 信号筛选重要文档,再用多个 LLM 生成问答对,并结合历史查询分布,使生成的问题更贴近真实用户提问。流程包括清洗与过滤文档、识别相关段落、切分段落、生成问答,并通过质量过滤保留合格的问答对。生成的规范段落同时作为上下文选择评测的规范片段。例如,对于“谁发布了 Waller 2”这类问题,规范答案可直接来自文档中的作者信息。

文档片段展示
示例问题与文档对应内容

10:37 离线评测的运行方式与生产隔离

评测由编排器批量运行,从存储加载评测集,并通过与生产一致的搜索和对话执行器跑完所有查询,再计算指标。为避免压垮生产系统,评测请求进入队列并限流。评测查询走独立的日志汇聚通道,不污染正常生产数据,并可额外记录排序原因等调试信息。为保证可复现,系统会传入查询原始时间戳,尽量还原当时索引状态。搜索评测关注文档检索:Recall@K(通常为 8 或 16 条结果)衡量规范文档是否进入前 K 名,同时关注其位置是否靠前,并以 CR(comparison ranking)衡量排序整体被打乱的程度。CR 用于判断变更是否需要做线上实验:对结果打乱过大的改动风险更高,因为现有排序已被长期优化。

基线组与测试组的规范文档排序对比
左侧整篇检索与右侧精准片段检索的对比

15:55 对话评测、LLM 裁判与成本指标

助手加入后,搜索成为 LLM 的工具,因此需要评测完整对话。对基于使用数据的评测集,团队在每次变更时运行成对完整性裁判,比较新旧回答的信息完整程度;对有规范答案的评测集,则用裁判判断回答信息是否与规范答案一致。回答质量分为引用质量与回答本身:引用精确率可通过对照引用片段与原文计算,引用召回则由 LLM 裁判判断哪些未被引用的检索结果本应相关。团队还在推进基于智能体的裁判,它可调用 Glean 的文档阅读等工具验证回答,目前是对话评测中信号最强的方式。此外还监控工具触发率与成功率,以发现变更是否让 LLM 频繁调用失败。成本方面,关注输入 token、首 token 延迟、端到端延迟与循环次数,因为检索结果越多,延迟与成本越高,而智能体可能进行数十甚至上百轮循环,需确保每一步调用都有意义。

助手产品与搜索工具的关系
聊天会话评测对象
使用数据与合成评测集
不同类型的LLM裁判
成对完整性裁判流程

21:22 精确率与召回率的权衡

当 LLM 成为搜索结果的主要读者时,团队的优化目标从人类点击场景转向召回。人类通常只点击前三个结果,而 LLM 会阅读检索返回的 16 条甚至更多结果,并能引用到第十位的来源。因此当前的核心指标是 Recall@16,即只要目标文档进入 16 条结果即为成功。排序模型训练时则使用 MAP,因为仅 Recall@16 无法区分第 10 位与第 12 位。在上下文选择上,团队也从偏召回逐步转向更精准的片段选择,以控制 token 成本,同时允许智能体在沙盒中读取完整文档。

本段核心结论:优化目标是 recall at 16,无明确可见画面,以该原文锚点作为代表性关键帧

25:14 规范标签来源与工程师查看数据

评测的真值标签有两类:一类是合成数据的 LLM 生成标签,但随着新模型发布,合成评测容易饱和;另一类是人工标注,主要依靠公司内部人员或众包完成,因为企业领域知识较强,外部标注者难以胜任。团队正在建立持续优化闭环:当研究人员发现坏样本时,会通知 LLM 更新评分标准,并设置回归集以防止整体退化。搜索与助手工程师通常需要至少查看 5 到 10 条评测样本,确认标签是否符合预期。对于变更,团队要求分析赢与输的样本,并优先查看 CR 变化最大的位置,在搜索中判断排序为何改变;在对话中则查看答案差异最大的地方,检查裁判判断是否与标签一致。

搜索排序变化最大处的对比结果

28:47 上线流程与 A/B 实验信号

排序模型基于收集的点击与引用数据训练,并可通过回填信号模拟新模型在历史查询上的得分。上线流程通常先做离线评测,确认变更方向符合预期;纯排序改动可只跑搜索评测,涉及与对话框架交互的改动则需跑端到端对话评测。离线评测通过后,团队进行 A/B 实验,把用户分配到不同组,比较满意度信号。搜索中的满意度主要看是否点击;对话中则看点赞、点踩、复制或分享回答,以及后续追问的情绪和会话是否继续。由于这些信号较稀疏,团队还会分析用户在首次回答之后的行为,判断用户是重复提问(不满意)还是转向新话题(可能满意)。此外还监控日活、周活、成本等顶层指标。

聊天场景满意度指标(点赞、点踩等交互信号)

32:17 评测团队分工与工程师责任

Glean 目前由全员参与评测。专门的评测团队负责基础设施,保证查询运行、生产链路与数据处理正确;另有团队负责改进评测工具,并收集裁判反馈,例如从成对裁判尝试转向列表式裁判。各功能的工程师则负责为自己的变更构建评测集或运行器,获取指标。团队文化高度重视指标,如果要让改动上线,需证明指标确实提升,因此工程师有动力找到最能衡量受影响切片的方法。讲者认为,这种既有中心化基础设施、又要求每个人关注评测的组织方式,可能与团队从搜索起步、搜索本身强调指标驱动有关。

评测团队职责说明(无明确可见画面,以代表性锚点截取)

35:36 大规模检索架构变更的上线案例与指标回归

一个典型案例是数月前对后端搜索架构进行的大规模重构,团队训练了全新模型替换原有模型。流程为:先用点击与引用数据在离线环境中实验架构与特征;候选模型通过特性开关合并进生产后,运行大规模搜索评测,检查延迟、各数据源的回归;通过后再做对话端到端评测,期望循环次数、延迟和 token 下降,同时质量保持稳定;最后进行线上实验。线上实验的优势在于样本量大、反馈真实。一个回归案例是 Slack 子线程日志丢失,导致 Slack 文档的引用记录缺失。离线评测没有发现问题,但按数据源跟踪指标时发现 Slack 引用异常偏低,团队随后追溯到日志缺失,并据此完善离线评测集与监控,例如监控工具触发率和各应用引用率。

顶层搜索指标看板,用于对比上线前后的核心指标变化
按数据源拆分的指标视图,显示 Slack 引用率明显偏低
搜索与对话延迟的分位数分布图,用于观察延迟回归

42:39 未来方向与工程师招聘标准

评测一直像猫鼠游戏:模型更新或评测饱和后,就需要不断迭代评测集。合成评测容易饱和,而基于使用的评测更像反馈循环。团队的下一步包括:构建更大、更干净的黄金集,覆盖更多功能和查询切片;用决策式建模快速��成子集;提升回放的可复现性,以模拟带写操作(如创建文档、幻灯片)的对话状态;优化在线信号的采集;并重点研发多轮对话评测,通过模拟十轮左右的对话,定位模拟与真实偏离之处。在招聘方面,团队看重定量思维,如概率统计基础,同时重视直觉与快速试错能力,例如发现查询同义词或二元组设置不合理时,能迅速验证并调整排序。讲者认为,LLM 可以加速合成数据与 trace 分析,但最终需要人来主导分析并形成判断。

讲者提到幻灯片内容结束,此处可能切换或展示评测相关幻灯片

结论

01:59 企业搜索因索引规模大、数据私有、权限严格且信号丰富,公开检索基准难以直接适用,需要自建评测集。

03:14 评测集主要来自真实使用日志与基于文档语料的合成数据,两者结合并通过流水线定期更新,以覆盖搜索、上下文选择和端到端对话三个层面。

10:37 离线评测需要与生产隔离并支持复现,通过限流、独立日志通道以及按历史时间戳还原索引状态来保证可靠性。

21:22 当 LLM 成为主要读者时,检索优化目标从人类点击转向 Recall@16 这类召回指标,并同时以 MAP 指导排序模型训练。

15:55 对话评测依赖 LLM 裁判与智能体裁判,并需同时监控 token、延迟与循环次数,避免质量提升以成本和延迟为代价。

25:14 LLM 生成的合成标签容易随模型进步而饱和,人工标注需依靠熟悉企业领域的内部人员,因此团队要求工程师亲自查看样本。

28:47 上线流程遵循离线评测、端到端对话评测、再到 A/B 实验的递进方式,并结合用户满意度信号判断变更效果。

32:17 评测采用中心化基础设施团队与全员负责相结合的组织方式,每个功能工程师需为自己的变更构建评测集和指标。

40:21 按数据源拆分指标能发现整体指标掩盖的问题,例如 Slack 日志丢失导致的引用异常,离线评测未能及时捕获。

39:04 线上实验与离线评测需要相互校准,团队会观察离线指标变化与用户满意度的相关性,以判断离线评测集是否可靠。

42:39 未来重点包括更大更干净的黄金集、可复现的带写操作回放以及多轮对话评测的模拟准确性。

46:24 招聘时重视定量分析能力与基于直觉的快速试错能力,LLM 可加速分析,但判断仍需由工程师主导。