4bit-Quantization in Vector-Embedding for RAG
Author:
- 18 December 2024
- conference paper
- Published by Institute of Electrical and Electronics Engineers (IEEE)
- p. 1037-1042
Abstract
Retrieval-augmented generation (RAG) is a promising technique that has shown great potential in addressing some of the limitations of large language models (LLMs). One of the major limitations of LLMs is that they can suffer from outdated information, as their training data may not always reflect the latest information. Additionally, LLMs can also be prone to hallucinations, where they generate responses that are not grounded in fact. 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.Keywords
All Related Versions
This publication has 8 references indexed in Scilit:
- GraphGPT: Graph Instruction Tuning for Large Language Models2024
- Text Embeddings Reveal (Almost) As Much As Text2023
- MTEB: Massive Text Embedding Benchmark2023
- What Makes Sentences Semantically Related? A Textual Relatedness Dataset and Empirical Study2023
- Efficient and Robust Approximate Nearest Neighbor Search Using Hierarchical Navigable Small World GraphsIEEE Transactions on Pattern Analysis and Machine Intelligence, 2018
- Product Quantization for Nearest Neighbor SearchIEEE Transactions on Pattern Analysis and Machine Intelligence, 2010
- The Probabilistic Relevance Framework: BM25 and BeyondFoundations and Trends® in Information Retrieval, 2009
- Fast K-dimensional tree algorithms for nearest neighbor search with application to vector quantization encodingIEEE Transactions on Signal Processing, 1992