利用预计算查询存储加速大语言模型推理
Accelerating LLM Inference with Precomputed Query Storage
AI总结:
针对LLM推理高延迟问题,提出存储辅助推理系统StorInfer,通过离线预计算存储可预测查询-响应对,结合自适应查询生成与向量检索技术,在不损失响应质量的前提下显著降低延迟,为低延迟LLM部署提供新方向。
摘要:
大语言模型(LLM)推理通常存在高延迟问题,在资源受限环境(如端侧或边缘部署场景)中尤为突出。为解决这一挑战,我们提出了StorInfer——一种新型存储辅助LLM推理系统,通过离线预计算并存储可预测的查询-响应对来缩短响应时间。当用户查询与预计算查询在语义上匹配时,StorInfer会绕过成本高昂的GPU推理,即时返回存储的响应,显著降低延迟和计算成本。为最大化覆盖范围与有效性,StorInfer采用由LLM驱动的生成器,可基于给定知识库自适应生成多样化且去重的查询。这一效果通过两项技术实现:自适应查询掩码(避免生成相似查询)和自适应采样(动态调整生成参数以提升语义多样性)。生成的查询-响应对通过磁盘支撑的向量数据库进行嵌入和索引,以支持运行时快速的基于相似度的检索。采用该方法,我们生成了15万条唯一预计算对(占用最多830MB存储空间),在不损失响应质量的前提下实现了最高17.3%的延迟降低。我们在多个QA数据集上的评估验证了存储辅助推理的实用性与可扩展性,尤其适用于查询分布可预测的场景。StorInfer为利用存储作为高效、低延迟LLM部署的核心支撑手段指明了一个颇具前景的方向。
英文摘要:
Large language model (LLM) inference often suffers from high latency, particularly in resource-constrained environments such as on-device or edge deployments. To address this challenge, we present StorInfer, a novel storage-assisted LLM inference system that accelerates response time by precomputing and storing predictable query-response pairs offline. When a user query semantically matches a precomputed query, StorInfer bypasses expensive GPU inference and instantly returns the stored response, significantly reducing latency and compute costs. To maximize coverage and effectiveness, StorInfer employs an LLM-driven generator that adaptively produces diverse and deduplicated queries based on a given knowledge base. This is achieved via two techniques: adaptive query masking, which prevents regeneration of similar queries, and adaptive sampling, which dynamically tunes generation parameters to promote semantic diversity. The resulting query-response pairs are embedded and indexed using a disk-backed vector database to enable fast, similarity-based retrieval at runtime. Using this approach, we generated 150K unique precomputed pairs (taking up to 830 MB of storage space), achieving up to 17.3% latency reduction with no loss in response quality. Our evaluation across multiple QA datasets demonstrates the practicality and scalability of storage-assisted inference, especially in scenarios with predictable query distributions. StorInfer highlights a promising direction in leveraging storage as a primary enabler for efficient, low-latency LLM deployment.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。