00:35 有限选项决策与 Jev 的定位
AI 产品中的许多步骤并非生成文本,而是在有限范围内做判断,例如识别用户查询意图、从多个建议中排序、验证引用或选择合适的模型与专家。过去这些任务也常交给通用 LLM,因而承担较高的成本和延迟。Jev 被定位在通用 LLM 与微调分类器之间:它不生成文本;当决策类别变化时,可以调整提示,而不必反复收集数据和重新微调模型。通用模型、开源模型、微调模型和 Jev 各有利弊,应按任务需求选择。
AI Engineer · 16:04
Hi everyone.
大家好。
My name is Chinmay and I'm a software engineer at Glean.
我叫 Chinmay,是 Glean 的一名软件工程师。
I work on the product engineering side of Glean Assistant.
我在 Glean Assistant 的产品工程团队工作。
Today I'm going to give a talk on how Glean uses Jev.
今天我要分享 Glean 如何使用 Jev。
The title of the talk is Beyond Generation: Fast and Structured AI Decisions with Jev at Glean.
演讲的标题是《超越生成:Jev 如何助力 Glean 实现快速、结构化的 AI 决策》。
if you look at it, most ai product steps are bounded decisions and not generation problems.
仔细看来,大多数 AI 产品中的步骤都属于有界决策,而不是生成问题。
so to give a couple of examples, user query intent classification, a ranker picking a suggestion out of n options, checking whether a citation is valid or not, routing to the correct model or expert, so on and so forth.
举几个例子:用户查询意图分类、排序器从 n 个选项中挑选一条建议、检查引文是否有效、将请求路由到正确的模型或专家,等等。
Till now, we have been paying the full LLM cost and latency to get an answer to all these bounded problems.
到目前为止,要解决所有这些有界问题,我们一直都要付出完整的 LLM 成本和延迟。
Jev at Glean fills the gap between general llms and fine-tuned classifiers.
Glean 的 Jev 填补了通用 LLM 与微调分类器之间的空白。
classification itself isn't a new problem.
分类本身并不是一个新问题。
people have been trying to solve it since forever.
人们一直以来都在尝试解决这个问题。
we can have multiple ways to solve it.
我们可以通过多种方式来解决它。
some of the things that we have tried out include using a general purpose llm.
我们尝试过的一些方法包括使用通用 LLM。
using an open model, something like LLaMA, fine tuning that open model, or using Jev.
使用开放模型,例如 LLaMA;对开放模型进行微调;或者使用 Jev。
now all these approaches and all these different ways have their pros and cons.
现在,所有这些方法都有各自的优缺点。
with a general purpose llm, we incur a lot of cost and latency, while with something like jev, we get no generated text output.
使用通用 LLM 会带来很高的成本和延迟;而使用 Jev 这类方案,则不会得到生成的文本输出。
another advantage that we have been seeing with jev is that as the taxonomy of the decision space changes, we don't have to fine-tune these models again and again.
我们发现 Jev 的另一个优势是,随着决策空间的分类体系发生变化,我们不必一次又一次地微调这些模型。
we can just change our prompt a bit and boom, it works out of the box.
我们只需稍微调整一下提示词,立刻就能开箱即用。
Now I'll walk you through how we have integrated gen or these classification, how we have used Javet Glean to solve these classification problem statements.
接下来,我会介绍我们如何集成 gen 或这些分类功能,以及如何使用 Glean 的 Javet 来解决这些分类问题。
I'll go into some of these problems in great detail.
我会详细讲解其中的一些问题。
before we go into these individual problems, i wanted to touch upon how we evaluate these changes.
在讨论这些具体问题之前,我想先谈谈我们如何评估这些变化。
we have a huge customer base having millions of users, so we don't want any of the change that we make to regress our product.
我们的客户群规模庞大,拥有数百万用户,因此我们不希望所做的任何改动导致产品退步。
we have a multi-phase approach, a rollout approach to any change that we are making.
对于我们进行的任何改动,我们都会采用多阶段的推进方式。
this includes having a golden eval set for almost every possible thing.
这包括为几乎所有可能的场景准备一套黄金评测集。
like any place where we have generative ai, any place where we have any form of intelligence involved, we have a golden eval set for that space.
凡是涉及生成式 AI 或任何形式智能的地方,我们都会为相应领域准备一套黄金评测集。
we soak all of these changes for a significant amount of time for our internal use case.
对于所有这些改动,我们都会先在内部使用场景中进行相当长时间的试运行。
like we have around 1,500 people at glean right now.
比如,Glean 目前大约有 1,500 名员工。
we soak all of these changes within our glean.
我们会在自己的 Glean 实例中对所有这些改动进行试运行。
instance for like a couple of weeks, we get active feedback.
大约持续几周,并收集积极反馈。
we have a very active feedback loop from our internal users.
我们有一个非常活跃的内部用户反馈循环。
we work upon that.
我们会根据这些反馈进行改进。
and then we go for an a-b testing with our customers.
然后,我们会对客户进行 A/B 测试。
The first problem that we tried out with a decision model was query classification.
我们首先尝试用决策模型解决的问题是查询分类。
query classification is when we want to know the nature of user queries.
查询分类就是了解用户查询的性质。
this helps us realize what kind of jobs are people using clean for.
这有助于我们了解人们使用 Glean 来完成哪些类型的工作。
what kind of, say for example, if people are using more for sales like queries, we focus more on that.
例如,如果人们更多地用它处理销售类查询,我们就会在这方面投入更多精力。
if people are using more for engineering type use cases, we focus more on that.
如果人们更多地将它用于工程类场景,我们就会在这方面投入更多精力。
We tried out three different approaches over here, and this is data from our test bed.
我们在这里尝试了三种不同的方法,这些数据来自我们的测试环境。
we used an open source layer model, then we tried out jev, and then we fine tuned the layer model on our own compute resources.
我们使用了一个开源语言模型,接着试用了 JEV,然后在自己的计算资源上对该语言模型进行了微调。
jev is the best no training option in our opinion.
在我们看来,JEV 是无需训练的最佳选择。
it nearly doubles the output quality of a base layer model and is able to perform at a 90% quality in comparison to a fine-tuned model, a fine-tuned layer.
它几乎能将基础层模型的输出质量提升一倍,表现可达到微调模型(微调层)的 90%。
with jev, we don't have to go through the very tedious process of data collection, data cleaning.
有了 Jev,我们就不必经历数据收集和数据清洗这一非常繁琐的过程。
incurring the cost for compute, like training the model, fine-tuning the model again and again as the taxonomy changes.
也不必承担计算成本,比如训练模型,或随着分类体系的变化一遍又一遍地微调模型。
and at the same time, we don't have to worry about hosting the model or incurring the inference cost.
与此同时,我们也不必担心托管模型或承担推理成本。
the next problem we went to is expert routing.
接下来我们要解决的问题是专家路由。
this is a pretty common problem statement in the industry right now.
这可以说是当前业界相当常见的问题。
like, hey, when the user query comes in, what expert do we route it to?
比如,用户查询进来时,我们该把它路由给哪位专家?
like, how do we ensure that the user, the response to the user is of the best possible quality?
我们要如何确保给用户的回复质量尽可能好?
glean receives, the way we have been solving this is, glean receives the user query and then decides what's the best expert to answer the query.
Glean 收到用户查询后,会判断哪位专家最适合回答。我们一直以来都是这样解决这个问题的。
till now, we have been using a general purpose llm to route to the correct expert.
到目前为止,我们一直使用通用大语言模型,将查询路由给正确的专家。
we set up a test bed for Jev, which set up a test bed with n experts, and our experiments found a significantly high precision when using Jev, and that to add an almost 8x reduction in latency.
我们为 Jev 搭建了一个测试平台,其中设置了 n 位专家。实验发现,使用 Jev 时精确率显著提高,同时延迟几乎降低了 8 倍。
we had to change our implementation or our infrastructure significantly to integrate jave into this specific stage of our product.
为了将 Jave 集成到产品的这个特定环节,我们不得不大幅调整实现方式或基础设施。
but the reduction in latency justifies that inherent complexity in the system.
不过,延迟的降低足以证明系统中这部分固有复杂性是值得的。
we at glean have been trying to build systems in the simplest possible manners.
Glean 一直在努力以尽可能简单的方式构建系统。
this is one of the rare pieces where we believe complexity is worth it.
这是少数几个我们认为复杂性值得付出的地方之一。
Next, I'll walk you through the ranker problem statement that I talked about.
接下来,我会介绍刚才提到的排序器问题。
when we receive a user query, we also want to generate the best follow-up suggestions for the user.
收到用户查询后,我们还希望为用户生成最佳的后续建议。
this helps us in getting discoverability for our product.
这有助于提升用户对我们产品的发现度。
this helps us in ensuring that the user has the best possible experience.
这有助于确保用户获得尽可能好的体验。
we also want to recommend or say preempt what the next user query might be.
我们还希望推荐或预判用户接下来可能会提出什么查询。
again, a pretty common problem statement that the entire industry has been trying to solve for.
这又是一个相当常见的问题陈述,整个行业一直都在努力解决。
Internally we call this system Q, like Q as in the literal Q.
我们内部把这个系统叫作 Q,就是字母 Q。
the way this works, we have like 10 or 15 different sources or 10 or 15 different ways, 10 or 15 different sources that are generating suggestions independently of each other.
它的工作方式是,我们有大约 10 到 15 个不同的来源,或者说 10 到 15 种不同的方式;有 10 到 15 个不同的来源彼此独立地生成建议。
Once those suggestions, these suggestions are generated by natural language LLMs, and it's like a proper natural language query.
这些建议由自然语言 LLM 生成,而且是规范的自然语言查询。
once these suggestions are in, we have a ranking step.
这些建议生成后,我们会进行一个排序步骤。
so the ranker takes in all these suggestions, takes in the first user query, takes in the output that glean gave, and then all these suggestions in that context.
因此,排序器会接收所有这些建议、用户最初的查询、Glean 给出的输出,以及这些建议所处的上下文。
the ranker is then asked to decide, like, hey, you have these suggestions, what do you think is the best one?
然后,排序器要做出判断:嘿,这些建议里,你觉得哪个最好?
a pretty interesting bottleneck that we had over here is we want the response to be snappy.
我们这里遇到的一个相当有意思的瓶颈是,我们希望响应足够迅速。
we cannot have a state where we give the textual response to the user and then wait five seconds for generating the follow-up suggestion.
我们不能先把文本回复给用户,然后再等五秒钟才生成后续建议。
we have to be snappy.
我们必须反应迅速。
that's why we have time limits on these suggestions.
这就是我们给这些建议设定时间限制的原因。
so right now, this step had a time limit of 1.5 to 2 seconds.
所以现在,这一步的时间限制是 1.5 到 2 秒。
jeff no doubt gave us a better quality than better quality and far better latency than what we had with a general purpose llm.
毫无疑问,Jeff 给出的质量比我们之前用通用 LLM 时更好,延迟也低得多。
but two things stood out over there.
但有两点特别突出。
first, we were able to give a suggestion within our time bounds in 99.2% cases.
首先,在 99.2% 的情况下,我们都能在规定时间内给出建议。
with the general purpose llm, this was almost 90%.
使用通用 LLM 时,这个比例接近 90%。
so this ensures that we.
所以,这确保了我们……
have user engagement and far more user queries now.
如今有了用户参与,而且用户查询也多得多。
the second thing is, at a glean, whenever we use these llms, we have guardrails.
第二点是,在 Glean,我们每次使用这些 LLM 时都会设置防护措施。
guardrails in the sense that, hey, llm might not be good at generating a response, or llm might be making some specific kind of mistakes.
所谓防护措施,就是说,嘿,LLM 可能不擅长生成回复,或者可能会犯某些特定类型的错误。
so we have checks and balances for all those possible mistakes that we see.
因此,我们针对所看到的所有这些潜在错误都设置了检查和平衡机制。
we keep a log of all these.
我们会把这些都记录下来。
Checks that are incurred at any point of time.
在任何时候触发的检查。
With a general purpose llm, we were able to generate a valid suggestion in almost 90% of the use 90% of the cases.
使用通用大语言模型,我们几乎能在90%的案例中生成有效建议。
We still had some places where llm was either generating a generating a response in a different language, the output.
不过,仍有一些情况是大语言模型生成的回复使用了另一种语言,输出……
did not meet certain other criterias that we had written programmatically.
没有达到我们通过程序设定的其他一些标准。
with jeb, we found zero cases to be there when the output was invalid.
使用 Jeb 时,我们发现没有任何输出无效的情况。
now, a natural question is like, hey, but you would have used a different prompt.
现在,一个很自然的问题是:嘿,你们是不是用了不同的提示词?
yes, the prompt was somewhat different, but we tried to mimic the prompt in the two cases to the largest extent possible so that we don't have a divergence.
是的,提示词有所不同,但我们尽可能让两种情况下的提示词相似,以免产生偏差。
like again, we at glean want to keep the system as simple as possible.
再说一次,我们在 Glean 希望尽可能让系统保持简单。
another benefit we see with using a decision model is how we can control the thresholds.
使用决策模型的另一个好处,是我们可以控制阈值。
because in this ranker problem statement, we are getting specific probabilities of each output.
因为在这个排序问题中,我们会得到每种输出对应的具体概率。
we are not restricted to a binary yes or no response.
我们不局限于只能回答“是”或“否”。
we get like, hey, these were the five options, and these are the probabilities of these five options.
我们会得到这样的信息:嘿,这里有五个选项,它们各自对应的概率分别是多少。
with this, we are able to fine-tune the thresholds based on the deployment.
这样一来,我们就能根据部署情况微调阈值。
we have put in self-learning systems, which based on the user, based on the customer deployment and the nature of usage that the specific customer has, fine-tunes the thresholds by itself.
我们引入了自学习系统,它会根据用户、客户的部署情况以及该客户的使用特点,自行微调阈值。
this ensures that the experience in each and every customer out there is the best possible based on how they use gleam.
这样可以确保每位客户都能获得尽可能好的体验,具体取决于他们使用 Glean 的方式。
Not a general purpose solution that fits all.
这不是一种适用于所有人的通用解决方案。
Okay, this is an interesting one.
好,这个例子很有意思。
Now moving on from how we have been making the lives or the experience of our end users better, we also tried using Jev in some of the some some other parts of our development pipeline.
接下来,我们不再讨论如何改善终端用户的生活或体验,而是来看看我们如何尝试在开发流程的其他一些环节中使用 Jev。
One of them was.
其中一项是。
how we use llms judges.
我们如何使用 LLM 作为评审。
like, all of us have been using llms judges for quite some time now.
比如,我们所有人都已经使用 LLM 作为评审相当长一段时间了。
there's an input, there's an output, and we use an llm to judge how the quality of the output is.
有输入,有输出,然后我们用一个 LLM 来评估输出的质量。
now, naturally, whenever we use llm as a judge, we repeat the experiment multiple times because to account for the variability in the response.
当然,每当我们用 LLM 作为评审时,都会重复实验多次,以应对回复中的可变性。
at glean, we used jeff for a very specific part of our evaluation pipeline.
在 Glean,我们在评估流程中一个非常具体的环节使用了 Jeff。
glean responses or like any other ai product out there has like citations.
Glean 的回复,或者说市面上任何其他 AI 产品的回复,都有引用来源。
this is how people trust that glean's answer was correct and it is grounded in the correct document.
人们正是通过这种方式相信 Glean 的答案是正确的,并且有正确的文档作为依据。
now, we hold these citations to a very high bar and we have a specific part in our evaluation pipeline.
我们对这些引用来源的要求非常高,并且在评估流程中有一个专门的环节,
where we check whether the cited document really supports the claim made in the answer or not.
用来检查被引用的文档是否真的支持答案中的说法。
this again seems to be a pretty simple yes or no question, like, hey, whether the claim is supported or not.
这看起来又是一个相当简单的“是或否”问题,比如,嘿,这个说法是否有依据。
with jvm, no doubt we had a far better latency and cost, like visible in the slide over here.
毫无疑问,使用 JVM 后,我们的延迟和成本都大幅降低了,就像这张幻灯片上展示的那样。
the interesting thing we noticed over here is how consistent and reproducible jf results were in comparison to something like say luna.
我们注意到一个有趣的现象:与 Luna 之类的方案相比,JF 的结果更加一致、可复现。
in the 28 or 30 use cases that we had, like only one run had like a difference in response.
在我们涉及的 28 或 30 个用例中,只有一次运行的回复出现了差异。
apart from that, everything was consistent.
除此之外,结果都保持一致。
but this ensures two things for us as engineers or us as developers at clean.
但这对我们这些工程师,或者说 Glean 的开发者而言,意味着两件事。
we are not only improving the quality of our product or we are not only improving glean in a linear fashion anymore.
我们不再只是提升产品质量,也不再只是线性地改进 Glean。
any improvement of this extent in the development pipeline leads to an exponential increase in how we can improve the product.
开发流程中这种程度的改进,会让我们提升产品的能力呈指数级增长。
so if i as a developer, i'm able to ship things like 5x faster, like this is a significant reduction in.
所以,如果我作为开发者能够快 5 倍地交付功能,这就意味着……
latency.
延迟大幅降低。
like if i run this experiment across thousands and thousands of entries, this is a lot of time.
比如说,如果我在成千上万条记录上运行这个实验,就会花很多时间。
and again, i don't have to run the same input output pair multiple times because the result from java is quite consistent.
而且,我不必对同一组输入输出多次运行,因为 Java 的结果相当一致。
so if i'm able to increase my own productivity by like 5x or 6x, i can ship 6x times the features to our customers.
所以,如果我能让自己的效率提高 5 倍或 6 倍,就能为客户交付 6 倍的功能。
and this happens across like 500 engineers or 300 engineers at clean.
而这种情况会发生在 Glean 的大约 500 名或 300 名工程师身上。
So the.
所以,
Impact of a good decision model is no longer linear, it is exponential on how we can improve the product.
一个好的决策模型带来的影响不再是线性的,而是指数级的,能够帮助我们改进产品。
now moving on from product and llms judges, there's a pretty important, this is a pretty important part of how we use our customer data.
现在,接下来不谈产品和 LLM 评估器了,如何使用客户数据是一个相当重要的方面。
security is something that all our customers expect from us.
所有客户都要求我们保证安全性。
so for example, we have checks and balances on all the inputs and outputs coming from a tool, all the inputs and outputs from an llm.
例如,我们会对工具的所有输入和输出,以及 LLM 的所有输入和输出进行检查与制衡。
till now, we at glean have like a multi-phase approach.
到目前为止,Glean 采用的是一种多阶段方案。
there is like, there are two phases to this.
这大致分为两个阶段。
the first one is like recall heavy phase and the second one is the final heavy loaded llm.
第一阶段侧重召回,第二阶段则由最终的大型 LLM 负责处理。
all these calls are made in parallel to like the actual tool input output calls.
所有这些调用都会与实际的工具输入输出调用并行执行。
till now, we used to host a virtual classifier using t4 gpus across all our customers.
到目前为止,我们一直使用 T4 GPU,为所有客户托管虚拟分类器。
so glean is a single tenant solution.
Glean 是一个单租户解决方案。
like we don't use or share resources across customers.
也就是说,我们不会在不同客户之间共用或共享资源。
every customer gets its own deployment, gets its own instance, and gets all the resources.
每位客户都有自己的部署和实例,并获得所有相应资源。
so assuming we have 1,000 customers out there, we had to maintain like virtual classifiers across all these 1,000 customers, which becomes a pretty difficult problem statement in itself, which takes up a lot of time from glean engineers.
假设我们有 1,000 位客户,就得为这 1,000 位客户维护虚拟分类器;这本身就是个相当棘手的问题,也会占用 Glean 工程师大量时间。
so looking at the results over here, the overall recall of the first phase where we used to have a virtual classifier, we replaced that with Jev, went from 31.5% to 90.2%.
从这里的结果来看,在第一阶段,也就是之前使用虚拟分类器的阶段,我们用 Jev 替换了它,整体召回率从 31.5% 提高到了 90.2%。
at the same time, we are seeing a significant reduction in cost.
与此同时,我们看到成本显著下降。
now, this cost is only the resource cost mentioned over here, but we are also saving cost on the engineering resources over here.
现在,这里提到的仅仅是资源成本,但我们也节省了工程资源方面的成本。
we don't have to invest like two or three engineers who are full-time maintaining those virtual classifiers or those t4 gpus across customers.
我们不必投入两三名全职工程师,来为不同客户维护这些虚拟分类器或 T4 GPU。
The improvement or the savings that we have are far more than 50%.
我们获得的改进或节省远超 50%。
this slide concludes all the results i have talked about till now.
这张幻灯片总结了我目前为止谈到的所有结果。
jiv at glean has been able to influence the product experience of the users, has been able to impact how vs developers have been working at glean, and most importantly, it also has a very good positive impact on the security that we provide to our customers.
Glean 的 Jiv 能够影响用户的产品体验,也能影响 VS 开发者在 Glean 的工作方式;最重要的是,它还对我们为客户提供的安全性产生了非常积极的影响。
A simple rule that we have been using is, can the out, in conclusion, a simple rule that we have been using at clean is, can the output be listed in advance?
最后,我们在 Glean 一直使用的一条简单规则是:输出能否预先列出?
If no, then it's a free form generative text problem statement.
如果不能,那就是一个需要生成自由形式文本的问题。
Go back to something that can generate free form text.
回到能够生成自由形式文本的方案。
If yes, then use JEV.
如果可以,那就使用 JEV。
Are labels stable and volume high?
标签是否稳定,而且数据量是否很大?
if this is the case where the labels are stable, which is rarely the case anymore, you can also fine-tune a model.
如果标签稳定——不过如今这种情况已经很少见了——你也可以微调模型。
but if the labels change, which in my opinion is quite frequent these days, then again use something like jeff.
但如果标签会变化,而我认为如今这种情况相当常见,那就再次使用类似 Jeff 的方案。
obviously, if you need dynamic text, we can feel free to try out more hybrid approaches like jeff along with freeform text llms.
显然,如果你需要动态文本,可以随意尝试更多混合方案,比如将 Jeff 与自由形式文本 LLM 结合使用。
this ends my presentation.
我的演讲到此结束。
so thank you everyone for listening.
感谢大家聆听。
i have added a blog, like a link to the blog post where we have posted the exact same results in great detail.
我添加了一篇博客的链接,我们在其中详细发布了完全相同的结果。
feel free to catch me on the outside if you have more questions.
如果你有更多问题,欢迎会后找我聊。
thank you.
谢谢。
Glean 软件工程师 Chinmay Goyal 分享如何用 Jev 处理 AI 产品中的有限选项决策,例如查询分类、专家路由、建议排序、引用核验和安全检查。此类任务的输出范围明确,若交给通用大语言模型,可能承担不必要的延迟、成本与输出校验负担;Jev 则可在不反复微调模型的情况下适应变化的决策类别。演讲结合 Glean 的评估流程和实际案例,展示了分类质量、路由延迟、建议及时率与有效率、评估一致性及安全召回率方面的结果,并以“输出能否预先列出”作为选择决策模型或生成模型的简单规则。
AI 产品中的许多步骤并非生成文本,而是在有限范围内做判断,例如识别用户查询意图、从多个建议中排序、验证引用或选择合适的模型与专家。过去这些任务也常交给通用 LLM,因而承担较高的成本和延迟。Jev 被定位在通用 LLM 与微调分类器之间:它不生成文本;当决策类别变化时,可以调整提示,而不必反复收集数据和重新微调模型。通用模型、开源模型、微调模型和 Jev 各有利弊,应按任务需求选择。
为避免面向大量客户的产品变更造成质量回退,Glean 会为生成式 AI 和其他智能功能建立黄金评测集。变更先在内部环境中运行一段时间,约 1,500 名员工使用数周并提供反馈;团队根据反馈调整后,再对客户进行 A/B 测试。这套多阶段流程用于在扩大上线范围前发现问题。
查询分类用于识别用户请求的性质,帮助 Glean 了解用户如何使用产品,例如销售或工程类场景。测试比较了开源基础模型、Jev 和自行微调的开源模型。Goyal 将 Jev 评价为无需训练方案中的最佳选择:其输出质量接近基础模型的两倍,并达到微调模型约 90% 的质量。使用 Jev 也免去了数据收集、清洗、训练和随分类体系变化而反复微调的工作,并不需要自行托管模型或承担相应推理成本。
专家路由要根据用户查询,选择最适合回答问题的专家。Glean 原先使用通用 LLM 完成路由;在包含多个专家的测试环境中,Jev 展现出较高精度,并将延迟降低近 8 倍。接入这一环节需要显著调整实现方式或基础设施,但团队认为延迟收益足以抵偿这部分系统复杂度。
Glean 的 Q 系统从约 10 至 15 个来源独立生成自然语言后续建议,再由排序器结合原始查询和 Glean 的回答,从中选出最合适的一条。为了让建议跟上主回答,排序环节只有约 1.5 至 2 秒的时间限制。与通用 LLM 相比,Jev 的质量和延迟更好:它在 99.2% 的案例中能在时限内给出建议,而通用 LLM 约为 90%;通用 LLM 产生的建议约有 90% 符合有效性检查,仍会出现语言不符或不满足程序规则的输出,Jev 测试中则没有无效输出。两种方案的提示词并不完全相同,但团队尽量让其保持接近。
排序模型会为多个候选选项提供概率,而不只是给出二元是或否,因此可以根据部署场景调整阈值。Glean 还采用自学习机制,按照客户部署情况和使用方式自动微调阈值,使不同客户获得更适合自身需求的体验,而不是套用同一套固定规则。
Glean 使用 LLM-as-judge 评估回答质量时,通常需要重复实验,以应对模型输出波动。对于引用评估,系统要检查被引用的文档是否真正支持回答中的主张,这是一个范围明确的是非判断。演讲称,Jev 在这一评估环节具有更好的成本与延迟表现,且结果比通用 LLM 更一致、可复现:在 28 至 30 个用例中,只有一次运行出现结果差异。稳定结果减少重复评估的需要;若开发者因此能更快完成实验,就能提升产品迭代效率。
Glean 将安全检查用于工具和 LLM 的输入、输出,并采用多阶段流程:前一阶段侧重召回,后一阶段由 LLM 作进一步判断。原先的第一阶段使用部署在 T4 GPU 上的分类器;由于 Glean 为客户提供独立部署,团队需要为各客户维护分类器和相关资源。以 1,000 个客户为例,逐一维护会增加工程负担。将这一阶段的虚拟分类器替换为 Jev 后,整体召回率从 31.5% 升至 90.2%,资源成本显著下降;团队还称,工程资源成本也有节省,相关节省超过 50%。
选择模型时,首先判断输出能否预先列出:若不能,任务属于自由形式文本生成,应使用能生成自由文本的方案;若能,则可使用 Jev。若标签稳定且使用量大,也可以考虑微调模型;若标签经常变化,则更适合使用 Jev。需要动态文本时,还可以尝试把 Jev 与自由文本 LLM 组合的混合方案。
00:35 当任务输出范围有限且可以预先列出时,决策模型可避免为简单判断支付通用 LLM 的生成成本,并减少延迟与无效输出。
05:01 在 Glean 的专家路由测试中,Jev 在保持较高精度的同时将延迟降低近 8 倍。
07:27 在后续建议排序中,Jev 在 99.2% 的案例中满足时限,测试中没有无效输出。
11:10 更一致、可复现的引用核验结果可以减少重复评估,并有助于提高工程迭代效率。
13:46 用 Jev 替换安全流程第一阶段的虚拟分类器后,召回率从 31.5% 提升至 90.2%。
14:46 输出能否预先列出是选择决策模型的首要判断;标签稳定且使用量大时可考虑微调,标签变化频繁时则可考虑 Jev。