A Fun & Absurd Introduction to Vector Databases - Alexander Chatzizacharias - GOTO 2024 (Category ML)
Interesting. report about vector databases for embeddings storage, which are actively used in the modern world in AI applications:) The cool thing is that there are few complicated words and many clear and funny examples to explain this non-trivial topic. The main points in the report are such
It all begins with the definition of a vector, which is a mathematical construct in which the length and direction are determined.
- It goes on to say that vectors are used everywhere, but for ML important milestones were -- Word2vec - 2013 year - models designed to obtain vector representations of words in natural language (context is not taken into account when vectoring) -- GloVe (Global Vectors) - 2014 Model for distributed word representation (context is not taken into account when vectoring) -- BERT (Bidirectional Encoder Representations from Transformers) - 2018 Model the learned by self-supervised learning to represent text as a sequence of vectors (Context is taken into account when vectoring) -- CLIP (Contrastive Language-Image Pre-Training) is a neural network trained on a variety of (image, text) pairs (Context is taken into account when vectoring) Next, the author goes on to discuss what a vector database is, what it is for and how it works. This is not a general database - you should not stick everything in it. It stores and indexes vectors with large dimensions. Data is taken from the database with use n Nearest Neighbor Search (NNS) Vector database out of the box allows you to do semantic search on data, often such databases are used as a storage system for AI systems Indexing in vector databases is very interesting. There are exact ways to find neighbors: linear search, k-nearest neighbors, space partitioning, etc. Inverted file with flat compression (IVFFlat), locality-sensitive hashing (LSH), approximate nearest neighbors oh yeah (ANNOY), hierarchical navigable small world (HNSW), ... All these methods use certain distance/proximity metrics: euclidean distance/similarity, cosine distance/similarity, hamming distance, manhatten distance, dot product, etc. Distance calculation and indexing occur in the same vector space Now the topic of creating separate vector bases, as well as creating extensions within existing ones is very popular. (pg, redis, elastic) Some databases have built-in functionality that allows you to automatically vector data Most databases have a Python client, javascrip client, or REST API.
The speaker has excellent demos showing how vector databases can be used. To do this, they use game visualizations on Unity, code on Kotlin and vector base. Weaviate, which is open-source, modular, can itself vector data, and also has java client and documentation. The demo uses cosine distance and HNSW. (hierarchical navigable small world).
Dems show the following scenarios Vectorization of weapons names and their semantic search, as Neo once looked for in the Matrix Vectorization of spells from Dungeon & Dragons and their semantic search Vectoring Pokémon images and searching them Vectorization of music and further search for it
In the end, this is a very cool example of a report that tells the base about one of the hot topics, shows a demo and invites listeners to play with this technology themselves.
#Software #Architecture #DistributedSystems #SystemDesign #Database