Retrieval Augmented Generation (RAG) Explained: Embedding, Sentence BERT, Vector Database (HNSW)

  Рет қаралды 63,184

Umar Jamil

Umar Jamil

Күн бұрын

Пікірлер: 126
@nawarajbhujel8266
@nawarajbhujel8266 9 ай бұрын
This is what a teacher with a deep knowledge on what is teaching can do. Thank you very much.
@tryit-wv8ui
@tryit-wv8ui Жыл бұрын
Wow! I finally understood everything. I am a student in ML. I have watched already half of your videos. Thank you so much for sharing. Greetings from Jerusalem
@wilsvenleong96
@wilsvenleong96 Жыл бұрын
Man, your content is awesome. Please do not stop making these videos as well as code walkthroughs.
@DeepakTopwal-sl6bw
@DeepakTopwal-sl6bw 8 ай бұрын
and learning becomes more interesting and fun when you have an Teacher like Umar who explains each and everything related to the topic so good that everyone feels like they know complete algorithms. A big fan of your teaching methods Umar.. Thanks for making all the informative videos..
@abisheksatnur1770
@abisheksatnur1770 4 ай бұрын
The 🐐. I wish I had you as my teacher in real life, not just through a screen
@AqgvP07r-hq3vu
@AqgvP07r-hq3vu 2 ай бұрын
Among all videos about hnsw, the best. Others dont understand. They just pretend. This one, on the other hand, is honest and thorough.
@Rockermiriam
@Rockermiriam 8 ай бұрын
Amazing teacher! 50 minutes flew by :)
@faiyazahmad2869
@faiyazahmad2869 5 ай бұрын
This is one of the best explanation i ever seen in youtube.... Thank you.
@sarimhashmi9753
@sarimhashmi9753 7 ай бұрын
Wow, thanks a lot. This Is the best explanation on RAG I found on KZbin
@nithinma8697
@nithinma8697 2 ай бұрын
This is the type of content we really want
@Ask0ldd
@Ask0ldd 12 күн бұрын
Thank you very much for all your hard work. Your channel is a goldmine. 👑
@ramsivarmakrishnan1399
@ramsivarmakrishnan1399 7 ай бұрын
You are the best teacher of ML that I have experienced. Thanks for sharing the knowledge.
@yuliantonaserudin7630
@yuliantonaserudin7630 10 ай бұрын
The best explanation of RAG
@mohittewari6796
@mohittewari6796 5 ай бұрын
The way you've explained all these concepts has blown my mind. I won't be surprised to see your number of subscribers skyrocket. Channel Subscribed !!
@bevandenizclgn9282
@bevandenizclgn9282 6 ай бұрын
Best explanation I found on KZbin, thank you!
@redfield126
@redfield126 Жыл бұрын
Waited for such content for a while. You made my day. I think I got almost everything. So educational. Thank you Umar
@suman14san
@suman14san 10 ай бұрын
What an exceptional explanation of HNSW algo ❤
@venkateshdesai3150
@venkateshdesai3150 6 ай бұрын
Amazing !! I finally understood everything. Good Job, all your videos have in-depth understanding
@alexsguha
@alexsguha 10 ай бұрын
Impressively intuitive, something most explanations are not. Great video!
@mturja
@mturja 9 ай бұрын
The explanation of HNSW is excellent!
@JRB463
@JRB463 10 ай бұрын
This was fantastic (as usual). Thanks for putting it together. It has helped my understanding no end.
@NikhilSharma-o2g
@NikhilSharma-o2g Жыл бұрын
One of the best channels to learn and grow
@alirahmanian5127
@alirahmanian5127 Ай бұрын
Cannot thank enough! Awesome content!!
@alexandredamiao1365
@alexandredamiao1365 10 ай бұрын
This was fantastic and I have learned a lot from this! Thanks a lot for putting this lesson together!
@kiranshenvi2626
@kiranshenvi2626 11 ай бұрын
Awesome context sir, it was the best explanation I found till now!
@myfolder4561
@myfolder4561 9 ай бұрын
Thank you so much - this is a great video. Great balance of details and explanation. I have learned a ton and have saved it down for future reference
@vasoyarutvik2897
@vasoyarutvik2897 11 ай бұрын
Hello sir i just want to say thanks for creating very good content for us. love from India :)
@SureshKumarMaddala
@SureshKumarMaddala Жыл бұрын
Excellent video! 👏👏👏
@1tahirrauf
@1tahirrauf Жыл бұрын
Thanks Umar. I look forward for your videos as you explain the topic in an easy to understand way. I would request you to make "BERT implementation from scratch" video.
@emptygirl296
@emptygirl296 Жыл бұрын
Hola, coming back with a great content as usual
@umarjamilai
@umarjamilai Жыл бұрын
Thanks 🤓😺
@tysun2739
@tysun2739 2 ай бұрын
Very nice explanation. Many thanks!
@amblessedcoding
@amblessedcoding Жыл бұрын
Wooo you are the best I have ever seen
@maitreyimandal8910
@maitreyimandal8910 12 күн бұрын
Such great content!
@amazing-graceolutomilayo5041
@amazing-graceolutomilayo5041 10 ай бұрын
This was a wonderful explanation! I understood everything and I didn't have to watch the Transformers or BERT video (I actually know nothing about them but I have dabbled with Vector DBs). I have subbed and I will definitely watch the transformer and BERT video. Thank you!❤❤ Made a little donation too. This is my first ever saying $Thanks$ on KZbin haha
@goelnikhils
@goelnikhils Жыл бұрын
Amazing content and what clear explanation. Please make more videos. Keep making this channel will grow like anything.
@melikanobakhtian6018
@melikanobakhtian6018 Жыл бұрын
Wow! You explained everything great! Please make more videos like this
@MihailLivitski
@MihailLivitski Жыл бұрын
Thanks!
@sethcoast
@sethcoast 8 ай бұрын
This was such a great explanation. Thank you!
@trungquang1581
@trungquang1581 9 ай бұрын
Thank you so much for sharing. Looking for more content about NLP and LLMs
@jeremyregamey495
@jeremyregamey495 Жыл бұрын
Just love ur videos. Soo much Details but extremly well put together
@akramsalim9706
@akramsalim9706 Жыл бұрын
Awesome paper. Please keep posting more videos like this.
@mdmusaddique_cse7458
@mdmusaddique_cse7458 10 ай бұрын
Amazing explanation!
@maximbobrin7074
@maximbobrin7074 Жыл бұрын
Man, keep it up! Love your content
@andybhat5988
@andybhat5988 5 ай бұрын
Super explanation. Thank you
@dantedt3931
@dantedt3931 11 ай бұрын
One of the best videos
@meetvardoriya2550
@meetvardoriya2550 Жыл бұрын
Really amazing content!!, looking forward for more such content Umar :)
@NeoMekhar
@NeoMekhar Жыл бұрын
This video is really good, subscribed! You explained the topic super well. Thanks!
@nancyyou7548
@nancyyou7548 11 ай бұрын
Thank you for the excellent content!
@fernandofariajunior
@fernandofariajunior 10 ай бұрын
Thanks for making this video!
@IndianGamingMaharaja
@IndianGamingMaharaja 5 ай бұрын
total 48 minutes worthy vedio
@_seeker423
@_seeker423 10 ай бұрын
Excellent content!
@hientq3824
@hientq3824 Жыл бұрын
awesome as usual! ty
@mustafacaml8833
@mustafacaml8833 10 ай бұрын
Great explanation! Thank you so much
@ashishgoyal4958
@ashishgoyal4958 Жыл бұрын
Thanks for making these videos🎉
@LorenzoMontù
@LorenzoMontù 10 ай бұрын
amazing work very clear explanation ty!
@DatabaseAdministration
@DatabaseAdministration Жыл бұрын
Glad I've subscribed to your channel. Please do these more.
@oliva8282
@oliva8282 7 ай бұрын
Best video ever!
@LiuCarl
@LiuCarl 10 ай бұрын
simply impressive
@ShreyasSreedhar2
@ShreyasSreedhar2 10 ай бұрын
This was super insightful, thank you very much!
@rajyadav2330
@rajyadav2330 Жыл бұрын
Great content , keep doing it .
@ChashiMahiulIslam-qh6ks
@ChashiMahiulIslam-qh6ks 10 ай бұрын
You are the BEST!
@RomanLi-y9c
@RomanLi-y9c Жыл бұрын
Thank you, awesome video!
@sounishnath513
@sounishnath513 Жыл бұрын
I am so glad I am subscribed to you!
@bhanujinaidu
@bhanujinaidu 8 ай бұрын
Good explanation, thanks
@DanielJimenez-yy8xk
@DanielJimenez-yy8xk 8 ай бұрын
awesome content
@Zayed.R
@Zayed.R 9 ай бұрын
Very informative, thanks
@SanthoshKumar-dk8vs
@SanthoshKumar-dk8vs 11 ай бұрын
Thanks for sharing, really a great content 👏
@manyams5207
@manyams5207 10 ай бұрын
wow wonderful explanation thanks
@oliz1148
@oliz1148 10 ай бұрын
so helpful! thx for sharing
@ahmedoumar3741
@ahmedoumar3741 11 ай бұрын
Nice lecture, Thank you!
@Jc-jv3wj
@Jc-jv3wj 7 ай бұрын
Thank you very much for a detailed explanation on RAG with Vector Database. I have one question: Can you please explain how do we design the skip list with embeddings? Basically how to design which embedding is going to which level?
@soyedafaria4672
@soyedafaria4672 10 ай бұрын
Thank you so much. Such a nice explanation. 😀
@RudraPratapDhara
@RudraPratapDhara Жыл бұрын
You are legend
@koiRitwikHai
@koiRitwikHai 11 ай бұрын
at 44:00 , the order of linked list is incorrect... isn't it? because it should be 1 3 5 9
@TheGreatMind55
@TheGreatMind55 11 ай бұрын
Even I have the same doubt. It should have been sorted as per the definition
@HichamElKaissi-g4s
@HichamElKaissi-g4s Жыл бұрын
Thank you so much man..
@satviknaren9681
@satviknaren9681 7 ай бұрын
Please bring some more content !
@jrgenolsen3290
@jrgenolsen3290 10 ай бұрын
💪👍 good introduktion
@hassanjaved4730
@hassanjaved4730 9 ай бұрын
Awesome I completely understand the RAG just because of you, Now I am here with some questions let's I am using the Llama2 model to where my main concern is I am giving him the pdf for context then user can ask question question on this, but this approach took time, during inferencing. so after watching your video what i undersatnd using the RAG pipeline is it possible to store the uploaded pdf into vector db then we will used it like that. I am thinking right or not or is it possible or not? Thanks,
@RomuloBrito-b2z
@RomuloBrito-b2z 6 ай бұрын
When the algorithm runs to store the k best scores, it uses a pop operation on the list to remove the nodes that have already been visited?
@李洋-i4j
@李洋-i4j Жыл бұрын
Wow, I saw the Chinese knotting on your wall ~
@12.851
@12.851 11 ай бұрын
Great video!! Shouldn't 5 come after 3 in skip list?
@Vignesh-ho2dn
@Vignesh-ho2dn 8 ай бұрын
How would you find number 3 at 44:01 ? The algorithm you said will go to 5 and then since 5 is greater than 3, it won't go further. Am I right?
@jeromeeusebius
@jeromeeusebius 6 ай бұрын
I think he is mostly explaining how the skip-list data structure works. In general, with HNSW, you are not looking for a particular value (those values are cosine similarity scores) but rather you are traversing the graph to find neighbors with smaller similar scores until you get to a local minima, then that is the node that is returned. You then repeat it again from another entry point.
@mohamed_akram1
@mohamed_akram1 10 ай бұрын
Thanks
@tomargentin5198
@tomargentin5198 8 ай бұрын
Hey, big thanks for this awesome and super informative video! I'm really intrigued by the Siamese architecture and its connection to RAG. Could someone explain that a bit more? Am I right in saying it's used for top-K retrievals ? Meaning, we create the database with the output embeddings, and then use a trained Siamese architecture to find the top-K most relevant chunks computing similarities ? Is it necessary to use this approach in every framework, or can sometimes just computing similarity through the embeddings work effectively?
@jeromeeusebius
@jeromeeusebius 6 ай бұрын
The siamese network he talked about just provides details of the sentence-bert that is used for encoding. The connection to RAG is that the sentence-bert model is used to do the encoding for both the query and the rest of the document chunks fed into the DB. In the case, Umar is providing some additional information regarding how the sentence-bert model was developed and why it is better than the natural BERT. I think it's important to understand the distinction. The top-K retrievals is done by the vector search. Using the HNSW, example, the query is compared with a random entry and then you proceed to the neighbors of each of the vectors until you get to a local minimum. You save this point. You do this a few times (> k) and retrieve the top-K ones sorted by their similarities. So the embeddings from S-BERT are used but not directly. The retrieval of the top-K embeddings is done at the vector DB search level. And doing this multiple times (via a different entry into the HNSW graph) you will get different results. And then you retrieve the top-K from there. I hope this is clear.
@rkbshiva
@rkbshiva Жыл бұрын
Umar, great content! Around 25:00, when you say that we have a target cosine similarity. How is that target's cosine similarity calculated? Because there is no mathematical way to calculate the cosine similarity between two sentences. All we can do is only take a subjective guess. Can you please exlain in detail to me how this works?
@umarjamilai
@umarjamilai Жыл бұрын
When you train the model, you have a dataset that maps two sentences to a score (chosen by a human being based on a scale from 1 to 10 for example). This score can be used as a score for the cosine similarity. If you look papers in this field, you'll see there are many sofisticated methods, but the training data is always labeled by a human being.
@rkbshiva
@rkbshiva Жыл бұрын
@@umarjamilai Understood! Thanks very much for the prompt response. It would be great if we can identify a bias free way to do this as the numbering between 1 - 10, especially when done by multiple people and at scale, could get biased.
@jeromeeusebius
@jeromeeusebius 6 ай бұрын
@@rkbshiva The numbering is not done by random people. Usually, some specialists, e.g., language specialists are employed to get this dataset, and this reduces the noise in the label (but you'd still get some bias but should be small). Google does this for the search quality. They have a standard search quality evaluation document that is provided to the evaluators and they use the document as a guide and how to score the different documents returned for a give query.
@qicao7769
@qicao7769 10 ай бұрын
Cool video about RAG! You could also upload into Bilibili, as you live in China, you should know that. :D
@rvons2
@rvons2 Жыл бұрын
Are we storing the sentence embeddings together with the original sentence they were created? If not how do we map them back (from the top-k most similar stored vectors) into the text they were originated for, given that the sentence embedding lost some information when pooling was done.
@umarjamilai
@umarjamilai Жыл бұрын
Yes, the vector database stores the embedding and the original text. Sometimes, they do not store the original text but a reference to it (for example instead of storing the text of a tweet, you may store the ID of the tweet) and then retrieve the original content using the reference.
@parapadirapa
@parapadirapa 11 ай бұрын
Amazing presentation! I have a couple of questions though... What size of chunks should be used when using Ada-002? Is that dependent on the Embedding model? Or is it to optimize the granularity of 'queriable' embedded vectors? And another thing: am I correct to assume that, in order to capture the most contexts possible, I should embed a 'tree structure' object (like a complex object in C#, with multiple nested object properties of other types) sectioned from more granular all the way up to the full object (as in, first the children, then the parents, then the grand-parents)?
@prashantharipirala7652
@prashantharipirala7652 2 ай бұрын
Can you tell how that hierarchial structure supporting HNSW is created?
@chhabiacharya307
@chhabiacharya307 11 ай бұрын
Thank YOU :)
@Tiger-Tippu
@Tiger-Tippu Жыл бұрын
Hi Umar,does RAG also has context window limitation as prompt engineering technique
@adatalearner8683
@adatalearner8683 8 ай бұрын
why is the context window size limited? Is it because these models are based on transformers and for a given transformer architecture, long distance semantic relationship detection will be bounded by the number of words/context length ?
@christopherhornle4513
@christopherhornle4513 Жыл бұрын
Great video, keep up the good work! :) Around 19:25 you're saying that the embedding for "capital" is updated during backprop. Isn't that wrong for the shown example / training run where "capital" is masked? I always thought only the embedding associated with non-masked tokens can be updated.
@umarjamilai
@umarjamilai Жыл бұрын
You're right! First of all, ALL embedding vectors of the 14 tokens are updated (including the embedding associated with the MASK token). What happens actually is that the model updates the embedding of all the surrounding words in such a way that it can rebuild the missing word next time. Plus, the model is forced to use (mostly) the embedding of the context words to predict the masked token, since any word may be masked, so there's not so much useful information in the embedding of the MASK token itself. It's easy to get confused when you make long videos like mine 😬😬 Thanks for pointing out!
@christopherhornle4513
@christopherhornle4513 Жыл бұрын
I see, didn't know that the mask token is also updated! Thank you for the quick response. You really are a remarkable person. Keep going!
@YouHaveToLoveMe
@YouHaveToLoveMe 3 ай бұрын
Master peice :)
@ltbd78
@ltbd78 11 ай бұрын
Legend
@parichehresmailian
@parichehresmailian 9 күн бұрын
How can i start to deep dive into the RAG? I have studied software engineering in the university as bsc and these days i’m studying E-Commerce as msc, which is mixed up completely with Ai.. and i exactly want to continue to RAG🥺
@汪茶水
@汪茶水 Жыл бұрын
keep it up!
@peabrane8067
@peabrane8067 18 күн бұрын
奥利奥 is so cute !
@UncleDavid
@UncleDavid Жыл бұрын
Salam Mr Jamil, i was wondering if it was possible to use the BERT model provided by apple in coreml for sentimental analysis when talking to siri then having a small gpt2 model fine tuned in conversational intelligence give a response that siri then reads out
@ravindarmadishetty736
@ravindarmadishetty736 4 ай бұрын
This is really awesome session. Off course it is a lengthy but nice. Seems problem with git. Unable to access python and pdf files.
Building Production-Ready RAG Applications: Jerry Liu
18:35
AI Engineer
Рет қаралды 338 М.
Хаги Ваги говорит разными голосами
0:22
Фани Хани
Рет қаралды 2,2 МЛН
Counter-Strike 2 - Новый кс. Cтарый я
13:10
Marmok
Рет қаралды 2,8 МЛН
OpenAI Embeddings and Vector Databases Crash Course
18:41
Adrian Twarog
Рет қаралды 516 М.
Why LLMs Are Going to a Dead End Explained | AGI Lambda
14:46
AGI Lambda
Рет қаралды 5 М.
Stanford CS25: V3 I Retrieval Augmented Language Models
1:19:27
Stanford Online
Рет қаралды 175 М.
GraphRAG: LLM-Derived Knowledge Graphs for RAG
15:40
Alex Chao
Рет қаралды 132 М.
Supercharge Your RAG with Contextualized Late Interactions
17:45
Prompt Engineering
Рет қаралды 14 М.
RAG, semantic search, embedding, vector... Find out what the terms used with Generative AI mean!
29:04
How to set up RAG - Retrieval Augmented Generation (demo)
19:52
Don Woodlock
Рет қаралды 42 М.