用统一模型压缩检索与生成的上下文,让手机本地运行RAG更省空间。
A Unified Model and Document Representation for On-Device Retrieval-Augmented Generation
- 共享同一套表示,同时完成检索和上下文压缩
- 上下文减少到1/10仍保持传统RAG性能
- 适合隐私敏感场景的手机端智能问答
传统检索增强生成(RAG)依赖远程服务器,存在隐私泄露、延迟高、需联网等缺点。本工作提出一种统一模型,将检索与生成的上下文进行联合压缩,并共享相同表示。该方法在不增加存储开销的前提下,将生成所需的上下文长度缩减至原来的1/10,性能媲美传统RAG阅读器,首次实现检索与上下文压缩的模型统一。适用于金融、医疗等敏感信息的本地化智能查询,为设备端AI优化提供新范式。
原文摘要 · Abstract (English)
Traditional Retrieval-Augmented Generation (RAG) approaches generally assume that retrieval and generation occur on powerful servers removed from the end user. While this reduces local hardware constraints, it introduces significant drawbacks: privacy concerns regarding data access, recurring maintenance and storage costs, increased latency, and the necessity of an internet connection. On-device RAG addresses these challenges by executing the entire pipeline locally, making it ideal for querying sensitive personal information such as financial documents, contact details, and medical history. However, on-device deployment necessitates a delicate balance between limited memory and disk space. Specifically, the context size provided to the generative model must be restricted to manage KV cache and attention memory usage, while the size of stored embeddings must be minimized to preserve disk space. In this work, we propose a unified model that compresses the RAG context and utilizes the same representations for retrieval. This approach minimizes disk utilization compared to using separate representations, while significantly reducing the context size required for generation. With an average of 1/10 of the context, our model matches the performance of a traditional RAG reader without increasing storage requirements compared to a multi-vector retrieval model. This approach represents the first model to unify retrieval and context compression using a shared model and representation. We believe this work will inspire further consolidation of distinct models to optimize on-device performance.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。