PulseAugur
实时 21:29:47
English(EN) How many tokens does your RAG stack actually send to the LLM?

RAG token 成本取决于上下文组装,而非向量数据库

一项技术分析显示,检索增强生成(RAG)系统中的 token 消耗主要由上下文组装策略决定,而非向量数据库本身。文章比较了常见的做法,并指出具有典型设置的朴素 RAG 会发送大约 5,000 个 token,通常包括冗余的文档版本。LangChain 的 'refine' 模式等框架会显著增加 LLM 调用次数和 token 量,而 LlamaIndex 的默认设置虽然更精简,但仍有发送重复内容的风险。分析认为,SWIRL 5 通过去重文档版本并将响应合并为一次 LLM 调用,提供了一种更有效的方法,输入 token 量约为 3,000 个。 AI

影响 优化 RAG 上下文组装可以显著降低 LLM API 成本并提高效率。

排序理由 对 RAG 系统 token 使用情况的分析和上下文组装策略的比较。

在 dev.to — LLM tag 阅读 →

AI 生成摘要 · Google Gemini · 来自 1 个来源。 我们如何撰写摘要 →

RAG token 成本取决于上下文组装,而非向量数据库

报道来源 [1]

  1. dev.to — LLM tag TIER_1 English(EN) · Sid Probstein ·

    How many tokens does your RAG stack actually send to the LLM?

    <p>The token bill for a RAG system is not set by your vector database. It's set one step later, by how you assemble the context you hand the LLM. Retrieval finds candidates; <strong>assembly</strong> decides how many of them, how much of each, and across how many LLM calls. That'…