PentaRAG通过五层路由实现企业级LLM问答的高速低耗。
PentaRAG: Large-Scale Intelligent Knowledge Retrieval for Enterprise LLM Applications
- 五层架构分流查询:双缓存+记忆回溯+自适应会话内存+传统检索
- 平均延迟低于1秒,GPU耗时仅基线一半,每秒可处理近10万次请求
- 适合对响应速度与成本敏感的企业级知识问答系统
企业级大语言模型应用需应对持续更新的文档集合,要求亚秒级延迟和可预测的GPU成本,而传统检索增强生成(RAG)系统难以完全满足。本文提出PentaRAG,一种五层模块化架构:将每个查询经由两个即时缓存(固定键值与语义缓存)、利用LLM自身权重的记忆回溯模式、自适应会话内存以及常规检索增强层进行路由。基于Mistral-8B、Milvus与vLLM实现,系统能通过低延迟缓存响应大部分重复或语义相似问题,同时保留完整检索支持新查询。在TriviaQA数据集上,结合LoRA微调与记忆回溯层,答案相似度提升约8%,事实正确率提高约16%。九会话运行模拟显示,缓存预热使平均延迟从数秒降至不足1秒,并引导流量进入快速路径。资源效率测试表明,PentaRAG将平均GPU时间降至0.248秒/查询,约为原始基线的一半,且在当前配置下维持约10万次/秒的聚合吞吐量。结果表明,分层路由策略可在生产级RAG系统中同时实现内容新鲜度、速度与效率。
原文摘要 · Abstract (English)
Enterprise deployments of large-language model (LLM) demand continuously changing document collections with sub-second latency and predictable GPU cost requirements that classical Retrieval-Augmented Generation (RAG) pipelines only partially satisfy. We present PentaRAG, a five-layer module that routes each query through two instant caches (fixed key-value and semantic), a memory-recall mode that exploits the LLM's own weights, an adaptive session memory, and a conventional retrieval-augmentation layer. Implemented with Mistral-8B, Milvus and vLLM, the system can answer most repeated or semantically similar questions from low-latency caches while retaining full retrieval for novel queries. On the TriviaQA domain, LoRA fine-tuning combined with the memory-recall layer raises answer similarity by approximately 8% and factual correctness by approximately 16% over the base model. Under a nine-session runtime simulation, cache warming reduces mean latency from several seconds to well below one second and shifts traffic toward the fast paths. Resource-efficiency tests show that PentaRAG cuts average GPU time to 0.248 seconds per query, roughly half that of a naive RAG baseline, and sustains an aggregate throughput of approximately 100,000 queries per second on our setup. These results demonstrate that a layered routing strategy can deliver freshness, speed, and efficiency simultaneously in production-grade RAG systems.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。