Thank you Talebi. No one explains the subject like you
@ShawhinTalebi8 ай бұрын
Thanks :) Glad it was clear!
@abhijitroy89313 ай бұрын
Agreed
@SathishkumarKarunamoorthy2 ай бұрын
That was a very clear and concise explanation. I am learning Data Science and find this very useful in understanding RAG. Thankyou so much
@aybmab2Ай бұрын
Wow. This was such an amazing explanation of the topic. I know very little of LLMs, but understood this very clearly. Thank you!
@yarinshaked6 күн бұрын
Hey! Thanks a lot for the great detailed content :) Why did you choose to use a fine-tuned model and not just the base model? Does applying RAG without fine-tuning also work? I guess it depends on the case, but just out of curiosity
@florisbokx6 күн бұрын
Very helpful, thanks! I found that getting an answer to a prompt takes quite a long time though (2-3 minutes), also using the T4 GPU from Colab. Is there a way to reduce this?
@inishkohli2733 ай бұрын
Finally completed, thank you so much for this content, waiting for the agents video
@ifycadeau8 ай бұрын
This is so helpful! Thanks Shaw, you never miss!
@ShawhinTalebi8 ай бұрын
Glad it was helpful!
@e-Course.3 ай бұрын
Thank you for the clear, visually appealing, and easy-to-understand information.
@juliamadeleineheinze2932Ай бұрын
This is a great video, super helpful, thank you so much! Also love the helpful links you provide in the description. Honestly, great content, I'm glad I found your videos, going to watch some more now :D
@ShawhinTalebiАй бұрын
Thanks for the great feedback :)
@nistelbergerkurt53098 ай бұрын
great video as always 👍 does a reranker improve the quality of the output for a RAG approach? like that we could take the output directly from the reranker, right? or what is your experience with reranker?
@ShawhinTalebi8 ай бұрын
Great questions! That's the idea. A reranker is typically applied to the top-k (say k=25) search results to further refine the chunks. The reason you wouldn't use a reranker directly on the entire knowledge base is because it is (much) more computationally expense than the text embedding-based search described here. I've haven't used a reranker in any use case, but it seems to be most beneficial when working with a large knowledge base. This video may be helpful: kzbin.info/www/bejne/i5mck4yfi9eKldU&ab_channel=JamesBriggs
@PayneMaximus2 ай бұрын
Is it possible to select a "dynamic" chunk size? I want to be able to separate documents in chunks that are of varying sizes; this is because I want to chunk specific sections in the documents that have varying sizes.
@ShawhinTalebi2 ай бұрын
Yes definitely! Chunking docs in this way can lead to better performance than blindly chunking across sections.
@firespark8047 ай бұрын
Awesome video, thanks! I'm wondering if instead of using top_k documents/batches one could define a threshold/distance for the used batches?
@Anonymous-or5hq23 күн бұрын
Good work Shaw, appreciate it
@AlusineBarrie4 ай бұрын
Thank you for the valuable content - clear, concise
@nataliatenoriomaia1635Ай бұрын
Great video! Thanks for sharing
@vamsitharunkumarsunku45838 ай бұрын
So we get top 3 similar chunks from RAG right, We are adding 3 chunks to prompt template?
@ShawhinTalebi8 ай бұрын
Yes exactly!
@beemdude2Ай бұрын
Super nice ! Great practical content
@interess953 ай бұрын
Awesome, thank you for the video!
@biomedicalit3 ай бұрын
Nice lecture, very informative! I didn't watch the video related to fat tails, but I noticed N.N. Taleb's influence, my favorite author. :-)
@ShawhinTalebi3 ай бұрын
Same here! I actually did his summer school recently: medium.com/the-data-entrepreneurs/i-spent-2-995-on-nassim-talebs-risk-taking-course-here-s-what-i-learned-c442a55a2c64
@michelleming64652 ай бұрын
Thank you for the useful content. Where could we find the exemplar code for soft prompt and prefix tuning as shown in your video? 😊
@ShawhinTalebi2 ай бұрын
Example code is available here: github.com/ShawhinT/KZbin-Blog/blob/main/LLMs/rag/rag_example.ipynb
@Allin1UniversalChannel2 ай бұрын
Great content! One question, please: in your example, is everything local and private, or does the data leave your execution environment?
@ShawhinTalebi2 ай бұрын
This example code doesn't make any external API calls so it can run entirely locally given. However, I ran it on Google Colab since the quantized model I used cannot run on Mac (I only have Apple machines)
@candidlyvivian5 ай бұрын
Hey Shaw, thanks so much for such a helpful video. I''d love to seek your advice on something :) Currently we are using OpenAI to build out a bunch of insights that will be refreshed using business data (i.e. X users land on your page, Y make a purchase) Right now we are doing a lot of data preparation and feeding in the specific numbers into the user/system prompt before passing to OpenAI but have had issues with consistency of output and incorrect numbers. Would you recommend a fine-tuning approach for this? Or RAG? Or would the context itself be small enough to fit into the "context window" given it's a very small dataset we are adding to the prompt. Thanks in advance 🙂
@ShawhinTalebi5 ай бұрын
Glad it was helpful! Based on the info provided here, it sounds like a RAG system would make the most sense. More specifically, you could connect your data preparation pipeline to a database which would dynamically inject the specific numbers into the user/system prompt. If you have more questions, feel free to email me here: www.shawhintalebi.com/contact
@examore-lite7 ай бұрын
Thank you very much!
@jagtapjaidip86 ай бұрын
very nice. thank you for explaining in details.
@drewgranieri36292 ай бұрын
Thanks for the content! Quick question: when setting up the knowledge base in your example code, you process the medium articles to not include specific chunks. how much of a difference does this actually make in your output? I only bring this question up because lets say you were going to use RAG to make an LLM application where the inputted documents do not follow same concrete structure of medium articles. it would then be pretty challenging to identify all the useless chunks you would not like to include right? do those embeddings make a significant difference in the quality of your output?
@ShawhinTalebiАй бұрын
Great question. How you chunk documents can make a big difference in the quality of your RAG system. Doing this right will require data exploration so you can define a pre-processing strategy for your specific use case. I often find that this isn't as challenging as it might seem at the outset.
@BookshelfJourneyАй бұрын
Well explained
@zahrahameed40986 ай бұрын
Thankyou so much. Becoming a fan of yours! Please do a video on Rag with llamaIndex + llama3 if it's free and not paid.
@ShawhinTalebi6 ай бұрын
Great suggestion. That's a good excuse to try out Llama3 :)
@edsleite6 ай бұрын
Hi Talebi. Thanks for all you show us. But one question : I did your code with mine database, without the fine tuning and it works, very quickly answers but poor contents. That is the point of fine tuning make better answers ?
@ShawhinTalebi6 ай бұрын
It sounds like you may need to do some additional optimizations to improve your system. I discuss some finer points here: towardsdatascience.com/how-to-improve-llms-with-rag-abdc132f76ac?sk=d8d8ecfb1f6223539a54604c8f93d573#bf88
@michaelpihosh59048 ай бұрын
Thanks Shaw!
@ariel-dev8 ай бұрын
Really great
@deadlyecho7 ай бұрын
Very good explanation 👏 👌
@lplp69617 ай бұрын
good work!
@parkerblake-l6e3 ай бұрын
Can we connect this with a Rasa chatbot? I'm building a Rasa chatbot to ask customized questions from users and provide output according to their responses. Can I integrate this model with my chatbot?
@ShawhinTalebi3 ай бұрын
While I haven't used rasa before, it seems they support RAG. rasa.com/docs/rasa-pro/building-assistants/chat-with-your-docs/
@TheLordSocke6 ай бұрын
Nice Video, any ideas for doing this on PowerPoints? Want to build a kind of knowledge base from previous projects but the grafics are a problem. Even GPT4V is not always interpreting them correctly. 😢
@ShawhinTalebi6 ай бұрын
If GPT4V is having issues you may need to either 1) wait for better models to come out or 2) parse the knowledge from the PPT slides in a more clever way. Feel free to book office hours if you want to dig into it a bit more: calendly.com/shawhintalebi/office-hours
@halle8458 ай бұрын
Any recommendations or experience on which embeddings database to use?
@ShawhinTalebi7 ай бұрын
Good question! Performance of embedding models will vary by domain, so some experimentation is always required. However, I've found the following 2 resources helpful as a starting place. HF Leaderboard: huggingface.co/spaces/mteb/leaderboard SentenceTransformers: www.sbert.net/docs/pretrained_models.html
@bangarrajumuppidu83547 ай бұрын
superb explanation Shaw !😍
@TheRcfrias6 ай бұрын
Rag is great for semi-static or static content as knowledge base, but which path do you use for dynamic, time-relevant data like current sales from a database?
@ShawhinTalebi6 ай бұрын
That's a great question. The short answer is RAG can handle this sort of data (at least in principle). The longer answer involves taking a step back and asking oneself "why do I want to use RAG/LLMs/AI for this use case?" This helps get to the root of the problem you are trying to solve and hopefully give more clarity about potential solutions.
@TheRcfrias6 ай бұрын
@@ShawhinTalebi Its a common use case at work to know how sales have been improving during the current day or week. It would be nice to know how to link the LLM with the corporate database for current information and reporting.
Happy Nowruz, kheyli khoob! Question: how would you propose to evaluate a document on the basis of certain guidelines? I mean, to see how far it complies with the guidelines or regulations for writing a certain document. Is RAG any good? shall we just embed the guidelines in the prompt right before the writing? or shall we store the guidelines as a separate document and do RAG? Or ...?
@ShawhinTalebi8 ай бұрын
Happy New Year! That's a good question. It sounds like you want the model to evaluate a given document based on some set of guidelines. If the guidelines are static, you can fix them into the prompt. However, if you want the guidelines to be dynamic, you can house them in a database which is dynamically integrated into the prompt based on the user's input.
@nirmalhasantha9865 ай бұрын
Thank you so much sir :)
@Blogservice-Fuerth8 ай бұрын
Great 🙏
@halle8458 ай бұрын
Thanks!
@ShawhinTalebi7 ай бұрын
Thank you! Glad it was helpful 😁
@ridg28066 ай бұрын
Solid video
@jjen95958 ай бұрын
hello, do you have a video showing how to make a datasett and upload it to huggind face?
@ShawhinTalebi8 ай бұрын
Not currently, but the code to do that is available on GitHub: github.com/ShawhinT/KZbin-Blog/blob/main/LLMs/qlora/create-dataset.ipynb
@peymannajiАй бұрын
I found good content here, are you Iranien ?
@ShawhinTalebiАй бұрын
Thank you! Yes I am :)
@CppExpedition5 ай бұрын
what do you mean with 'not to scale?' isn't the book at the size of the earth?
@ShawhinTalebi5 ай бұрын
LOL 😂
@raviyadav25524 ай бұрын
super helpfull
@scubasquadsteve2 ай бұрын
tailEDEDness! can't unhear it 18:44
@ShawhinTalebi2 ай бұрын
LOL made up words can be hard to pronounce 😂
@JavierTorres-st7gt5 ай бұрын
How to protect a company's information with this technology?
@ShawhinTalebi5 ай бұрын
Great question! One can approach data security with RAG in the same way as other contexts. In other words, you can set up a permissions layer so that the LLM can only access information consistent the user's permissions.
@susdoge37675 ай бұрын
great channel subbscribed!
@arshakcms3 ай бұрын
8:20 Large Language Models Only Understands Text? They Can Recognize images and all right?
@ShawhinTalebi3 ай бұрын
Great question. Language models only understand language (text). However, we see products like ChatGPT and Claude handle them just fine. There are two ways to do this. 1) Pass image to img-to-text then pass it to a language model 2) Create a multi-modal model (e.g. GPT-4o) which can take text, images, and audio as input
@yameen34485 ай бұрын
Vector retrieval is quite shite. Trust me. To improve accuracy of retrieval, you need to use multiple methods.