arXivDaily arXiv每日学术速递 周一至周五更新
感恩节,周五至周末无更新,大家顺遂。周一再来吧
arXiv 2501.10534cs.LGcs.AI
收藏

向量嵌入中的4位量化用于检索增强生成

4bit-Quantization in Vector-Embedding for RAG

San Jose State University(圣何塞州立大学)

Taehee Jeong

AI总结:

针对RAG中高维嵌入向量存储和搜索开销大的问题,提出4位量化方法,将向量从32位浮点降至4位整数,显著降低内存需求并加速搜索,代码已开源。

摘要:

检索增强生成(RAG)是一种有前景的技术,在解决大型语言模型(LLM)的一些局限性方面显示出巨大潜力。LLM有两个主要局限:由于训练数据的原因,它们可能包含过时信息;并且它们可能生成事实不准确的响应,这种现象被称为幻觉。RAG旨在通过利用相关文档数据库来缓解这些问题,这些文档以嵌入向量的形式存储在高维空间中。然而,使用高维嵌入的挑战之一是它们需要大量内存来存储。这在处理大型文档数据库时尤其可能成为主要问题。为了缓解这一问题,我们提出使用4位量化来存储嵌入向量。这涉及将向量的精度从32位浮点数降低到4位整数,这可以显著减少内存需求。我们的方法有几个好处。首先,它显著减少了高维向量数据库的内存存储需求,使得在资源受限的环境中部署RAG系统更加可行。其次,它加速了搜索过程,因为向量精度的降低允许更快的计算。我们的代码可在https://github.com/taeheej/4bit-Quantization-in-Vector-Embedding-for-RAG获取。

英文摘要:

Retrieval-augmented generation (RAG) is a promising technique that has shown great potential in addressing some of the limitations of large language models (LLMs). LLMs have two major limitations: they can contain outdated information due to their training data, and they can generate factually inaccurate responses, a phenomenon known as hallucinations. RAG aims to mitigate these issues by leveraging a database of relevant documents, which are stored as embedding vectors in a high-dimensional space. However, one of the challenges of using high-dimensional embeddings is that they require a significant amount of memory to store. This can be a major issue, especially when dealing with large databases of documents. To alleviate this problem, we propose the use of 4-bit quantization to store the embedding vectors. This involves reducing the precision of the vectors from 32-bit floating-point numbers to 4-bit integers, which can significantly reduce the memory requirements. Our approach has several benefits. Firstly, it significantly reduces the memory storage requirements of the high-dimensional vector database, making it more feasible to deploy RAG systems in resource-constrained environments. Secondly, it speeds up the searching process, as the reduced precision of the vectors allows for faster computation. Our code is available at https://github.com/taeheej/4bit-Quantization-in-Vector-Embedding-for-RAG

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑