Reddit用户分享:检索前使用JEV澄清查询的工程实践与成本分析
We started using JEV to clarify queries before retrieval, and the results have been pretty interesting
提供了一套可复现的RAG优化工作流,通过前置轻量级评估降低小模型幻觉并控制成本,数据详实,对做Agent或RAG落地的同学极具参考价值。
I've spent the better part of the last year developing an enterprise AI knowledge management application, and one of the biggest challenges has been getting smaller, less expensive LLMs to consistently produce accurate answers from retrieved documents.
在过去的一年多里,我一直在开发一款企业级 AI 知识管理应用,其中最大的挑战之一是如何让更小、更便宜的 LLM(大型语言模型)从检索到的文档中持续生成准确的答案。
We've experimented with embeddings, hybrid search, chunk ranking, reranking, different models, and more prompt engineering than I'd care to admit.
我们尝试了嵌入向量(embeddings)、混合搜索、分块排序、重排序、不同的模型,以及大量难以启齿的提示词工程(prompt engineering)。
One thing we kept running into was that we were asking the LLM to do too much at once.
我们反复遇到的一个问题是,我们要求 LLM 一次性完成太多任务。
Interpret the user's intent, figure out whether they're asking multiple questions, evaluate retrieved evidence, identify relevant conditions and exceptions, and then formulate a complete, accurate answer.
解读用户意图,判断他们是否在问多个问题,评估检索到的证据,识别相关条件和例外情况,然后 formulate 一个完整且准确的答案。
That's a lot of responsibility to put on one relatively inexpensive model.
将如此多的责任压在一个相对廉价的模型身上,负担太重了。
So we decided to try something different.
于是,我们决定尝试一些不同的方法。
We're experimenting with putting JEV at the very beginning of the retrieval process.
我们正在尝试在检索过程的最开始引入 JEV(Justification Evaluation Verification,合理性评估验证)。
Rather than immediately embedding the user's question and searching our knowledge base, we first evaluate the question itself.
与其立即对用户的问题进行嵌入并向知识库发起搜索,我们先对问题本身进行评估。
The initial checks are surprisingly simple:
初步检查 surprisingly 简单:
- Is the user's intent clear?
- Is the user asking a single question or multiple questions?
- 用户的意图是否清晰?
- 用户是在问一个问题还是多个问题?
If the intent isn't clear, the system can generate a multiple-choice clarification rather than guessing what the user meant.
如果意图不清晰,系统可以生成多项选择题式的澄清请求,而不是猜测用户的本意。
If the user is asking multiple questions, we break them into individual questions and let the user select which one to tackle first.
如果用户在问多个问题,我们将它们拆分为独立的问题,并让用户选择先处理哪一个。
Once we have a clear, focused question, we proceed with retrieval and answer generation.
一旦有了清晰、聚焦的问题,我们就继续进行检索和答案生成。
We're currently averaging five JEV clarification/context checks per query.
目前,每个查询平均需要进行五次 JEV 澄清/上下文检查。
Here's where the economics get interesting:
经济账开始变得有趣起来:
| Step | Average API cost |
|---|---|
| Five JEV checks | $0.000282 |
| Search embedding | $0.000001 |
| LLM answer generation | $0.001612 |
| Total | $0.001895 |
| 步骤 | 平均 API 成本 |
|---|---|
| 五次 JEV 检查 | $0.000282 |
| 搜索嵌入 | $0.000001 |
| LLM 答案生成 | $0.001612 |
| 总计 | $0.001895 |
Our average end-to-end generation time is around 8 seconds.
我们的平均端到端生成时间约为 8 秒。
That's less than two-tenths of a cent per question.
这意味着每个问题的成本不到两美分。
But we're not declaring victory yet.
但我们还没有宣布胜利。
We've made encouraging progress by separating query interpretation from retrieval and generation, but we're still working through one particularly frustrating problem.
通过将查询解读与检索和生成分离,我们取得了令人鼓舞的进展,但我们仍在解决一个特别令人沮丧的问题。
Even when the correct information is present in the retrieved chunks, the generation model will occasionally leave out an important condition, exception, or qualification.
即使检索到的分块中包含正确的信息,生成模型偶尔也会遗漏重要的条件、例外或限定说明。
The answer sounds correct. The citations can even point to the correct source. But the answer isn't necessarily complete.
答案听起来是正确的。引用甚至可能指向正确的来源。但答案不一定完整。
For enterprise knowledge management, particularly where policies and procedures are involved, that's a serious problem.
对于企业知识管理而言,特别是涉及政策和程序时,这是一个严重的问题。
Our next experiment is to separate evidence extraction from answer composition, then verify the completed answer against the relevant facts and conditions found in the source documents.
我们的下一个实验是将证据提取与答案生成分离,然后根据源文档中发现的相关事实和条件来验证生成的完整答案。
The broader lesson I'm starting to take away from all this is that better AI answers may have less to do with using a bigger model and more to do with giving smaller models narrower, clearly defined responsibilities.
我从这一切中开始得出的更广泛的启示是,更好的 AI 答案可能更少依赖于使用更大的模型,而更多依赖于为较小的模型赋予更狭窄、定义明确的职责。
We're still testing and measuring, but the economics are encouraging.
我们仍在进行测试和测量,但经济可行性令人鼓舞。
I'm curious whether anyone else is experimenting with JEV or similar lightweight evaluators ahead of retrieval, rather than using them exclusively for reranking or post-generation evaluation.
我很好奇是否还有其他人在检索之前对 JEV 或类似的轻量级评估器进行实验,而不是仅将它们用于重排序或生成后评估。
And has anyone found a reliable way to prevent smaller models from silently omitting important conditions when summarizing retrieved evidence?
还有没有人找到了可靠的方法来防止较小的模型在总结检索到的证据时静默地省略重要条件?
更进一步:量化金融体系
看懂新闻只是起点——沿量化金融路径,把它变成能交付的工程能力