Mastering Embedding Stores & Vector Databases in LLM Apps with Anton Troynikov: Chapter 15
Key Takeaways
Mastering embedding stores and vector databases in LLM applications with Anton Troynikov
Full Transcript
[Music] hi folks it's Anton here from chroma um here to talk to you a little bit about embedding stores and Vector databases and how they work in the context of llm in the loop applications like the One You're Building in this course so by now you've learned a little bit about embeddings and nearest neighbor and you know how to use them for similarity search um I want to talk to you a little bit about some of the software packages and tools available for you that make that a bit easier especially if you're working with large amounts of data or you're ready to build a production grade application so let's get right into it what is an embedding store an embedding store is basically a software package that abstracts away a lot of the operations that you've already learned about so first you take a set of documents that represent your knowledge base and you can use the embedding store to embed them using its embedding function and then when a query comes in the same embedding function gets called it generates an embedding uh as the query embedding and then the embedding store itself performs the nearest neighbor search for you and Returns the relevant documents to the llm context window thus basically simplifying a lot of the operations that you would have to implement yourself um so the next question is when should you be using one well the first answer is when your data gets sufficiently large Computing distances to each embedding for each query is is pretty slow and expensive especially u under certain distance functions A good rule of thumb is that when you're are over about 10,000 embeddings using some of the commercial or open source embedding models it's probably a good time to switch to a vector database or embedding store and we'll get to a little bit about why that is in a minute the other important thing is not to underestimate the convenience that actually using an off-the-shelf package gives you here llm powerered applications need to support many users across many indices um you need to handle data and scaling automatically and basically you want it to just work so rather than getting into all the nitty-gritty implementation as long long as you understand what's going on often times it's easier to just use an off-the-shelf solution like chroma so how exactly do embedding stars in Vector databases deal with large amounts of data without incurring the costs of computing distances between the query and every single embedding that it stores well as we've seen exact's neighbor basically requires us to scan over the entire list of embeddings and compute the distances to each one um that takes o n operations commonly called linear time where n is the number of embeddings you already have embedding stores typically use an approximate nearest neighbor algorithm and basically what they do is they exploit the underlying structure of the data um that you have stored and they take Only log n operations in other words they're sublinear they um it's a lot less expensive to do an OLN lookup than it is to scan the entire list and the way that they do that is because they trade recoil in other words sometimes they might miss um the truly nth nearest neighbor and and grab something else in exchange for Speed and computational complexity now that might sound a little worrying but the reality is that the trade off between speed and recall can be tuned depending on the algorithm used and there's a lot of flexibility in how these things are implemented so going into a little bit more depth about approximate nearest neighbors a&n algorithms are an active area of research and there's a lot of different ones um commonly used ones include things called inverted file indexes locality sensitive hashing and hierarchical navigable small world graphs and if you want to learn more details about each of these there's plenty of detail available online different algorithms work best in different settings um a lot of the approximate nearest neighbor algorithms used in many solutions today are set up for the case where the index doesn't change very much and gets updated only infrequently however if we're building an llm in the loop application it's very likely that our data will mutate online quite frequently and so a graph-based algorithm like hnsw works well in these types ofli because we can iteratively construct and iterate on the graph so what's next I mean this all sounds great but the issue is that there is quite a few fundamental limitations even when you have a software package that's supporting you in finding nearest Neighbors in this way because it doesn't answer certain questions it doesn't answer for you which embedding model is best for my task or your data um it doesn't tell you how you should be chunking up your data to ensure good results and just because you've gotten the n nearest neighbors doesn't actually tell you whether those neighbors are relevant or how relevant they actually are so what should you do um with the information that they're not sometimes and finally I think it's really important and one of the core principles of AI is that we can easily incorporate human feedback into the data that we're returning to the model so providing opportunities for and affordances to actually do that for developers is something that's really important these are all features that we're looking into building into chroma and as I said this is a still growing uh this is still a field with a lot of product experimentation going on and we're hoping to support uh users like you in doing all of these things in the near future thank you
Original Description
🤖Dive into chapter 15 where we learn embedding stores and vector databases with Anton Troynikov, co-founder of Chroma. Master LLM applications today!
🧑🏾🎓 Full course with certification and class materials available free at http://wandb.me/building-llm-powered-apps
🏆 Daily swag draw and grand prize Airpods draw from Dec 1 and 31, 2023. Details at http://wandb.me/llm-apps-contest
🗣️ Join the course conversation on our Discord channel at http://wandb.me/course-discord
*Episode Description*
Welcome to the next chapter of "Building LLM-Powered Apps" the free course from Weights & Biases. In this chapter, Anton Troynikov, co-founder of Chroma, shares his expertise on embedding stores and vector databases, which are crucial components in developing sophisticated LLM applications.
🌟 Chapter Highlights
Introduction to Embedding Stores: Dive into the concept of embedding stores and how they simplify operations like nearest neighbour search in LLM applications.
When to Use Embedding Stores: Learn about the scenarios where embedding stores become essential, especially when dealing with large data volumes.
Understanding Vector Databases: Explore the role of vector databases in handling large datasets efficiently through approximate nearest neighbour algorithms.
Optimizing Search with Algorithms: Discover various algorithms used in embedding stores, including inverted file indexes, locality sensitive hashing, and hierarchical navigable Small World graphs.
Real-World Application Insights: Gain practical knowledge on how to effectively implement these technologies in your LLM projects, with insights from the co-founder of Chroma.
🎓 Enroll for Free: Join us on this educational journey to master the art of building LLM-powered applications. Enroll at http://wandb.me/building-llm-powered-apps.
👉 Next Chapter Sneak Peek: Don't miss our next chapter, where we explore the intricacies of evaluating LLM applications.
Watch on YouTube ↗
(saves to browser)
Sign in to unlock AI tutor explanation · ⚡30
Playlist
Uploads from Weights & Biases · Weights & Biases · 0 of 60
← Previous
Next →
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
0. What is machine learning?
Weights & Biases
1. Build Your First Machine Learning Model
Weights & Biases
Intro to ML: Course Overview
Weights & Biases
2. Multi-Layer Perceptrons
Weights & Biases
3. Convolutional Neural Networks
Weights & Biases
Weights & Biases at OpenAI
Weights & Biases
Why Experiment Tracking is Crucial to OpenAI
Weights & Biases
4. Autoencoders
Weights & Biases
5. Sentiment Analysis
Weights & Biases
6. Recurrent Neural Networks [RNNs]
Weights & Biases
7. Text Generation using LSTMs and GRUs
Weights & Biases
8. Text Classification Using Convolutional Neural Networks
Weights & Biases
9. Hybrid LSTMs [Long Short-Term Memory]
Weights & Biases
Toyota Research Institute on Experiment Tracking with Weights & Biases
Weights & Biases
Weights and Biases - Developer Tools for Deep Learning
Weights & Biases
Introducing Weights & Biases
Weights & Biases
10. Seq2Seq Models
Weights & Biases
11. Transfer Learning for Domain-Specific Image Classification with Small Datasets
Weights & Biases
12. One-shot learning for teaching neural networks to classify objects never seen before
Weights & Biases
13. Speech Recognition with Convolutional Neural Networks in Keras/TensorFlow
Weights & Biases
14. Data Augmentation | Keras
Weights & Biases
15. Batch Size and Learning Rate in CNNs
Weights & Biases
Applied Deep Learning Fellowship Overview and Project Selection with Josh Tobin (2019)
Weights & Biases
Grading Rubric for AI Applications with Sergey Karayev (2019)
Weights & Biases
16. Video Frame Prediction using CNNs and LSTMs (2019)
Weights & Biases
Image to LaTeX - Applied Deep Learning Fellowship (2019)
Weights & Biases
17. Build and Deploy an Emotion Classifier (2019)
Weights & Biases
Applied Deep Learning - Data Management with Josh Tobin (2019)
Weights & Biases
Snorkel: Programming Training Data with Paroma Varma of Stanford University (2019)
Weights & Biases
Applied Deep Learning - Troubleshooting and Debugging with Josh Tobin (2019)
Weights & Biases
Troubleshooting and Iterating ML Models with Lee Redden (2019)
Weights & Biases
Designing a Machine Learning Project with Neal Khosla (2019)
Weights & Biases
Lukas Beiwald on ML Tools and Experiment Management (2019)
Weights & Biases
Building Machine Learning Teams with Josh Tobin (2019)
Weights & Biases
Pieter Abeel on Potential Deep Learning Research Directions (2019)
Weights & Biases
Testing and Deployment of Deep Learning Models with Josh Tobin (2019)
Weights & Biases
Five Lessons for Team-Oriented Research with Peter Welder (2019)
Weights & Biases
Applied Deep Learning - Rosanne Liu on AI Research (2019)
Weights & Biases
Making the Mid-career Leap from Urban Design to Deep Learning/Data Science
Weights & Biases
Organizing ML projects — W&B walkthrough (2020)
Weights & Biases
Brandon Rohrer — Machine Learning in Production for Robots
Weights & Biases
Nicolas Koumchatzky — Machine Learning in Production for Self-Driving Cars
Weights & Biases
My experiments with Reinforcement Learning with Jariullah Safi
Weights & Biases
Applications of Machine Learning to COVID-19 Research with Isaac Godfried
Weights & Biases
Testing Machine Learning Models with Eric Schles
Weights & Biases
How Linear Algebra is not like Algebra with Charles Frye
Weights & Biases
Predicting Protein Structures using Deep Learning with Jonathan King
Weights & Biases
Rachael Tatman — Conversational AI and Linguistics
Weights & Biases
Reformer by Han Lee
Weights & Biases
Sequence Models with Pujaa Rajan
Weights & Biases
GitHub Actions & Machine Learning Workflows with Hamel Husain
Weights & Biases
Look Mom, No Indices! Vector Calculus with the Fréchet Derivative by Charles Frye
Weights & Biases
Jack Clark — Building Trustworthy AI Systems
Weights & Biases
Surprising Utility of Surprise: Why ML Uses Negative Log Probabilities - Charles Frye
Weights & Biases
Track your machine learning experiments locally, with W&B Local - Chris Van Pelt
Weights & Biases
Antipatterns in open source research code with Jariullah Safi
Weights & Biases
Attention for time series forecasting & COVID predictions - Isaac Godfried
Weights & Biases
Made with ML - Goku Mohandas
Weights & Biases
Angela & Danielle — Designing ML Models for Millions of Consumer Robots
Weights & Biases
Deep Learning Salon by Weights & Biases
Weights & Biases
More on: LLM Engineering
View skill →Related Reads
📰
📰
📰
📰
5 RAG Optimization Techniques Every AI Engineer Should Know In 2026
Medium · AI
5 RAG Optimization Techniques Every AI Engineer Should Know In 2026
Medium · Machine Learning
Let’s talk about RAG: Why it exists, how it works and lot more about it.
Medium · RAG
RAG - Semantic Caching
Dev.to AI
🎓
Tutor Explanation
DeepCamp AI