Dwarves
Memo
Type ESC to close search bar

Select Vector Database for LLM

During our research on applying LLM to real-world applications, we have observed the widespread usage and increasing popularity of Vector databases in various fields. Therefore, we have delved into understanding and summarizing what we have learned in this article.

History of vector database

Vector databases have emerged as a crucial component in natural language processing and machine learning. They are built upon the idea of representing data as vectors in high-dimensional spaces. Vector databases efficiently store and retrieve vector representations, allowing for fast similarity-based searches. They have evolved from word embeddings to support various linguistic units and complex data structures. By leveraging vector databases, models like GPT can access and utilize pre-computed vector representations, enhancing their semantic understanding and information retrieval capabilities. The development of vector database technologies is expected to continue advancing, providing more sophisticated solutions for managing and utilizing vector representations in diverse applications.

What is vector database

A vector database is a specialized database designed to store, manage, and query vector data. Unlike traditional databases that focus on structured data, vector databases are optimized for the storage and manipulation of high-dimensional vector representations. They enable efficient handling of vector data, allowing for complex operations such as vector similarity search, clustering, and recommendation.

Use case of vector database

Core concept of Vector database

Using Vector Database with LLM

Choosing the Right Vector Encoding

LLMs typically use models like Word2Vec, BERT, and transformer-based variants.

Configuring proper vector search parameter

To achieve optimal efficiency, configure the search parameters appropriately. Pay attention to parameters such as:

Selecting the suitable Metric for content

PineconeQdrantSupabaseWeaviateMilvusChroma
Build for vector databaseyynyyy
Open sourcenyyy
Roll-based Access Control (RBAC)yNo. Authentication onlyyComing soony
Disk Index supportyyyyy
Hybrid Search (ie Scalar filtering)Yes with Scalar filteringYes (combine vector and traditional indices)yYes (combine Sparse and Dense Vectors)Yes with Scalar filtering
Partitions/namespaces/logical groupsynyny
Index type supportedy1 (HNSW)B-Tree, Hash1 (HNSW)9 (FLAT, IVS_FLAT, IVF_SQ8, IVF_PQ, HNSW, ANNOY, BIN_FLAT, and BIN_IVF_FLAT)
Database rollbackyyyyy
Tunable consistencyyyyyy
Support for both stream and batch of vector dataynyyy
Binary Vector supportynyyy
Multi-language SDKPython, Node.jsPython, Go, RustyPython, Java, GoPython, Java, Go, C++, Node.js

These vector databases offer various features and optimizations to handle large-scale vector data efficiently. The choice of the most suitable vector database depends on factors such as the specific requirements of your language model, the size of the dataset, the expected query throughput, and the available hardware resources. It is recommended to evaluate and benchmark different vector databases to determine which one best fits your specific use case.

References