How work Introduction to gen AI & retrieval augmented generation (RAG)

Introduction to gen AI & retrieval augmented generation

gen AI & retrieval augmented generation

I know it’s March but uh I am very excited for 2024 as you can see I’m in my new apartment uh all settled in here in London and we’re ready to kick back and uh announce some new courses and initiatives for the community as you all know we are living in the age of AI and the landscape is evolving so rapidly and it can get a bit overwhelming if you’re just starting out or if you’re looking to you know skip scale your knowledge try out different things and um when we talk about machine
learning when we talk about AI the most crucial aspect of it as you may have you know heard or assume is data you know you need data for training your machine learning models you need to manage data you need to clean the data and also when we talk about uh Ai and machine learning there are various um you know aspects of it so there is um and when you first get started Ed with machine learning you learn about uh unsupervised learning you learn about supervised learning reinforcement learning so you know types
of machine learning models then you play around with a lot of algorithms try to optimize your algorithms you learn about deep learning in the future and uh the question arises that I get quite a lot is Kunal do you need to have a very strong understanding of you know mathematics for example or how these algorithms work internally and the ability to implement these from scratch so on and so forth the answer is both yes and no it depends on what you want to do you’re more into the research aspect of things um then obviously yeah
we’ll cover that in a later you know course and uh the second answer is no you don’t you don’t have to know the Deep mathematical equations and Concepts in order to apply machine learning in your projects so ideally let’s say you want to create a uh web development project um that filters out um the requests that you’re getting those are spam or not you know like email for example or you just want to build a movie classification model um which um to which you just give a movie review and it can tell you whether the movie
was good or bad or whatever uh emotion detection you give it a poem and it will give you back U you know the emotion behind the poem whe whether it’s a love poem whether it’s a funny poem so on and so forth so natural language processing as well so in this video I’m very excited to announce that uh we’re launching a new Mini course to get your journey started in this domain and my main motivation for this um series of videos is uh to make um the use of um AI into your applications simpler and
specifically focus on the data aspects because if you can get the data right then you know that’s um very good step into further advancing your um progression in Ai and machine learning so we’re going to talk about data a lot in this series so in this series we’re going to be utilizing uh single store DB if you haven’t already checked that out make sure you check out the links in the description below but um we’re going to talk a lot more about um what in this series what it’s about is um generative
Ai and retrieval augmented Generation Now Kunal those are some very big words right you said this was going to get you started but we don’t know what these words mean not a problem that is what this first video of the course is about so in this video we’re going to learn about um introduction to gen so what is Gen and uh the most important part of AI which is I already mentioned data we’re going to learn about making AI apps that are data aware we’re going to learn about what is rag which I just mentioned
retrieval augmented generation so conal big words what even is it and uh we’re going to talk about some of the alternatives to these models and and uh why you would want to consider building a rag application why are we even talking about it why not something else and uh as you know um you know in every single video like the ones that I’ve gotten millions of views on the channel we have um had um some great feedback in terms of the intuition so even though these are big big Concepts I’ll to I’ll try to relate
it to real world examples and obviously we’ll share the technical terms as well um to get you started and build the intuition behind the cont concept so going to be a lot of fun all the links can be found in the description below if you have not already subscribed to the course to get updated about uh new new announcements make sure you do that it’s um you know free to do so and uh let’s get started all right so the first part of this video is Introduction to gen you know what is Gen why I be talking about
it uh you know in the world of artificial intelligence so gen or you know generative AI uh if we first break it down into technical um Concepts so technically speaking gen AI refers to AI systems that possess the ability to understand and perform a wide range of tasks similar to how we human beings exhibit general intelligence so unlike narrow AI which excels at very specific tasks like you can have um you know playing chess or a specific game or recognizing you know faces in your iPhone you know how that works um so
generative AI aims to tackle a diverse range of challenges with a single adaptable approach so that’s the technical definition but that you can find online as well but what does it mean in simpler terms that’s what we’re here for let’s think of it this way so imagine that you’re learning how to ride a bike you know most of us did I I I have forgotten by the way how to ride a bike uh this something I realized right now when I was in Amsterdam so I had not ridden a bike in 10 years so apparently
that is something you can forget so anyway let’s think of this way it this way you’re learning how to ride a bike and at at first it may feel like U you know a very daunting task when you’re a kid but as you practice and you gain experience you start to develop a broader understanding of how to balance and steer your bike and do all the pedals and the stunts or whatever you want to do um but soon enough you’re not just riding one type of bike right you can handle mountain bikes you can handle
road bikes you can handle U you know some some people some of my friends they also got a hang of unicycles and then you can also adapt to you know motorized bikes so on and so forth that is basically the essence of gen so the ability to learn and apply knowledge across different domains just like we humans do now let’s bring it closer to home with some of the everyday examples so think about your smartphone’s virtual assistant I have um you know iPhone II you have Alexa Google uh has Google assistant or whatever whether you’re
asking about let’s see the weather forecast and you’re setting reminders adding stuff in your grocery list or you’re playing your favorite music it adapts to your needs seamlessly that’s because it is powered by jni so it is capable of understanding and responding to a wide range of commands and queries so that’s basically what J is in a nutshell like having a versatile toolkit at your disposal ready to tackle uh whatever challenges come your way and whether it’s navigating complex tasks or
assisting with everyday routines jni opens a world of U possibilities okay moving on to the most important part of AI you guess it data as I mentioned it already so in the realm of AI data is like uh you can say life blood okay it’s the Raw material that fuels our algorithms that uh you know fuels the powers of our intelligent systems and your machine learning models and everything right but what do we mean by data when we say data what what do we mean now what do you mean by data simply put data actually refers to any
information or observations that we can collect and analyze so let’s break it down with a nice real world example imagine you are a chef and you’re creating a new recipe okay so what do you need to start cooking up U your recipe you need obviously ingredients right that’s what you need well in the world of AI the data is our ingredients and just like you know a shf will select like some of the freshest uh produced and finest uh spices and um all the vegetables and everything they also know always get the high quality ingredient
so that the dish comes out to be nice similarly in the realm of AI you you select high quality data to train your AI models make sense now the question is can now the chef gets the uh groceries from the from the you know grocery store or whatever where does this data come from that we are going to use to to create our machine learning models where does it come from so the answer is it can come from various sources okay it totally depends um you can have websites that you can scrape uh sensors social media you name it you know data is um
everywhere think of it like uh your gring ingredients from uh not just one Supermarket but from various markets like a big chain then farmers market and then you make a very nice tasty dish okay so basically with this example the more diverse and abundant our data the Richer and more flavorful our AI models can become now here’s the catch not all the data is created equal okay just like you wouldn’t want to use uh spoiled ingredients in your cooking we need to ensure that the data is clean relevant and reliable which is something I’m
going to teach you in this course and the future courses on AI and machine learning so garbage in garbage out as they say uh poor quality data can lead to inaccurate and unreliable AI predictions so sometime you may have like outliers in data or something you have to account for those as well so when we do our dedicated machine learning course which will be after this going to teach you more more about that the last point I want to mention over here is the question that some of some of the people ask me is why data is so
damn important mind my language in AI well let’s put it this way imagine you’re detective or solving a mystery the more clues and the more evidence you have the better are your chances to solve that mystery right so similarly in the case of AI the more data that we have the better our models can understand the patterns and make predictions and solve the problems so you can see that data is the Cornerstone in artificial intelligence it Powers everything from self-driving cars to your voice assistance uh to your
personalized recommendations and all sorts of things so as we continue our AI Adventure in this course always remember one thing when it comes to building intelligent systems it all starts with data that’s actually a very nice X poost so you can tweet that and you can tag U this course and share it with your friends but uh moving forward all right moving on when we talk about making AI apps that are data aware so from a technical standpoint a data aware AI application is um one that not only processes the data but also understands
its context and relevance and uh potential biases in the data so this involves integrating Advanced algorithms and techniques to interpret and utilize the data effectively leading to smarter and more accurate AI systems think of it this way in the previous example we took a chef analogy so imagine that you’re a chef who is creating a new recipe but you just don’t throw away you know random ingredients together you carefully you know select each one based on the flavor profile of the ingredient the nutritionist U value and how it
complements the other ingredients so similarly a data aware AI application doesn’t just analyze the data blindly but it understands the nuisances of the data that it’s working with and how it fits in the broader uh context of your application and um you know data aare AI applications they utilize techniques like uh if we if you dive a deep deeper into it something that we will be covering in the future videos as well so when we do talk about let’s say data aware AI applications they utilizes uh it utilizes techniques like uh feature
engineering where relevant aspects of the data are identified and extracted to enhance the performance of the model so a good example of this can be you’re making a machine learning model that uh when you give it a few characteristics of a house like okay this house is on this street this house is on this floor of the building it has these many bedrooms this much square feet and this much closer to a train station or whatever please machine learning model give me an estimate of how much this house will cost so obviously in order to

retrieval augmented generation

gen AI & retrieval augmented generation


train that model you have to give it some already existing prices of some of the houses and um houses can have some of the features that are not really relevant in order to train the model so in simple terms features of the house that don’t really affect the price of the house this can be something like um oh I don’t know color of the walls cuz you can change that later on you get my point so feature engineering right and they also employ the uh methods like uh when we talk about um you know data ware
applications um so methods like uh data normalization and pre-processing to ensure that the data is clean consistent and free from biases we’re going to talk a lot about data and you know as I’m talking about it right now there are a lot of things that you need to do with it and that’s where single store comes in so it’s going to be pretty useful for us in order to make this process seamless when we’re working with large amount of data can you know terabytes and more than that if you want to do
that right that as well so pretty amazing platform and if we take an example of like a recommendation system so the ones used by streaming platforms um you like Netflix or whatever or websites like Amazon when they are recommending you movies or products the AI doesn’t just look at what you have just you know seen you’re exploring or purchased but it also considers other factors like your viewing history your preferences and even external factors like trending topics in the area or the seasonal Trends so by being data aware the AI can
offer personalized recommendations that are more likely to resonate with you additionally another point is that the data aware AI applications often incorporate techniques like uh data augmentation where uh synthetic data is generated to supplement the existing data and um improve the model robustness so they also Implement uh monitoring and feedback mechanisms to continuously learn from the new data and adopt the behavior over time so we’ll learn about it when we do you know if we do let’s say we do a facial recognition project
in the future so let’s say you’re training a facial recognition system for security purposes so by augmenting the data set with various um conditions in lightning for example facial expressions and backgrounds the AI becomes more resilient to real world conditions and less prone to errors that’s a real world example of what enement it’s like giving AI a wider range of experiences to learn from and making it more adapt to recognizing faces in different scenarios so overall I would say that making AI
applications that are data aware is all about understanding the data its context and how it can be leveraged to build smarter more reliable AI systems and by incorporating these principles into our AI development process we can unlock you know pretty much um the this is like like the foundation when I talk about efficiency accuracy and and Innovation and it all starts with data so yeah pretty important we’re going to talk about data a lot and I I sure you you’re going to learn something new in every single step but uh yeah that’s
basically about it all right now let’s talk about the next um most important thing in this course that we’re going to be doing is rag so at it score rag combines uh two powerful AI techniques Ral based methods and generative models now that’s a mouthful I understand you know if this is something you’re hearing for the first time don’t worry let’s break it down I travel a lot right so when I visit a new city I want recommendations for the best restaurants and the attractions and the activities
around it so traditionally you might search online and like shift through countless of like reviews on Google or Trip Advisor whatever you want to you know call you want to search for ideally and that’s uh basically like retrieval based methods so they fetch relevant information from a vast pool of data okay and when we sprinkle some of the Gen AI magic into this what happens is that instead of just providing you with existing recommendations rag does it it takes it a step further so it can generate personalized suggestions tailor to your
preferences and interests it’s like having a knowledgeable local guide who not only shares the uh you know popular spots but also customizes the recommendations based on your tastes so far you know I I just use my friends in that City they know me best so it’s sort of like that you know but why is rag so powerful why are we talking about that in in traditional search engines think about this in traditional search engines you are limited to the information that is available on the indexed web pages okay
we all know search engines work if you don’t make sure you check out my networking uh video it’s pretty long 4 hours long so should give you a basic understanding but uh with rag you can leverage both the existing knowledge and also generate new insights on the fly so it’s like having access to an endless uh repository of your information that evolves and adapts U according to your needs that is basically what rag is in a nutshell obviously we’ll be doing a lot more Hands-On stuff in the future of
this video so make sure you like sh subscribe and uh for the tools and everything code samples check out the links in the description below but yeah it’s a game changer in the field of AI it combines the best of retrieval and generative techniques to provide personalized and insightful uh experiences and um yeah next time you are using an application ideally if you you know need tailored recommendations just remember the magic of uh rag behind it all right cool Canal that was fine but uh why rag are there any like um
alternatives to rag obviously there’s an alternative to everything in the world well most things and uh we’ll cover you know various uh other models in the future but one alternative worth considering is uh leveraging Transformer based language models like GPT so generative pre-trained Transformer and unlike rag which combines of retrieval and generation GPT focuses solely on the generation but of offers impressive capabilities in understanding and producing humanik text so you can have like fine-tuned GPT models on specific
tasks or domains and using uh you know uh there’s this new term now prompt engineering okay so researchers and developers can achieve pretty much remarkable results without the need for explicit retrieval mechanisms and additionally advancements in transfer learning and model architectures continually uh you know expand the possibilities of GPT and similar models basically making them um you can say versatile alternatives to rack for various applications but in the end I would just say it depends on know what
you need um the benefits that rack provides are quite a lot that we just discussed and you will see those more in the future tutorials but if you’re getting on this path then obviously you have to have a have an understanding of various models so that you can best pick the one that fits best for your use case and the type of data that you have okay Kunal so we’re going to build rag um based applications so what are some of the things that we need what are some some of the things we’re going to learn
in this course and in the future you know machine learning boot camps as well so we al already mentioned you know uh we’re going to use retrieval and generative um you know models to create intelligent uh context aware applications uh you need some some some initial uh things um going back to our quick example initial ingredients uh first and foremost you require a solid understanding um of natural language processing Concepts and uh this includes like familiarity with the retrieval models uh which retrieve relevant

A beginner’s guide to building a Retrieval Augmented .


information from let’s say a vast knowledge based and generation models which produce coherent and cont addtionally uh relevant responses additionally a bit of proficiency in uh machine learning Frameworks like uh you can use you know tensor flow you can use uh pytorch um this would be helpful when you’re uh implementing and fine-tuning these models equally important is also the access to extensive data sets because you’re going to be needing to train your models and ensuring that they understand a wide range of topics and
context so when we work with data we’re going to utilize single store and if you want to learn more about it get some hands-on experience by the way they do a lot of amazing Hands-On live webinars and code sharing sessions so go check out uh single store uh the website the link can be found in the description below and go to their webinar page tons of amazing free content over there right and further more uh because we’re going to be building applications so little bit of experience in software development and programming languages if
you know python amazing that would make things easier if not don’t worry it’s I’ll try to make the course as simple to understand as as possible and to follow along as well and I’ll share with you the course material also uh uploaded on GitHub so the the reason I say that is because when you know software development a bit so even though you have your machine learning model strained you will be able to deploy it on a website and share it with your friends in a userfriendly app interface lastly um I want to mention that a
creative mindset and a passion for Innovation and uh you know it’s going to drive you to explore new possibilities and push the boundaries of what can be achieved with rag based applications so those are some of the things you need um you’re going to be well equipped to embark on this exciting journey of our course and series whatever you want to call it but uh we’re going to be building our own rag based applications so lastly I just want to share that learning by doing is the best way to learn that’s what we’re going to focus
this uh series and the future videos on as well speaking of learn by doing and the tools we’re going to use let’s talk a little bit more about why single store what it’s all about and um what it has to offer so I don’t know if you know this but single store previously was known as a mensal and it’s like the we talk about database it’s like a Swiss army knife okay so it has a lot of uh you know capabilities for both transactional and your analytic needs so when when we look at products like that
we we see some of the real world case studies like um single store when we talk about it it’s uh trusted by a lot of big companies that you can see on their website like seen Comcast and Hulu uh for its ability to handle real time analytics and also the power of Cutting Edge genni applications using rag retrieval augmented generation so I would say picture this you’re like U crunching numbers for an inapp analytics or diving into I don’t know terabyte terab is small uh petabytes of uh scale for your
SQL aggregations with all of those uh needs in mind single store has your back and uh if we talk about rag it’s not just riding the hype train you know because it’s very easy to get lost in the hype cycle because single store has been rocking vectors and semantic search since 2017 it’s not um something that they just got on it because now everyone is talking about Ai No they have been at it since 2017 but here’s the kicker it doesn’t just stop there single store also lets you play uh you know mix and
match with your data like SQL Json you name it and even pulls off uh uh for example hybrid searches and uh combining uh keyword matches with Vector based semantics uh um and it does all of this in milliseconds so we can learn about Vector databases and all these other things in the future videos in this series itself and um you know we talk about what else um real time multimodel AI yeah it’s not just a dream anymore I think uh single store has made it a reality and uh more information can be found on the website uh as I mentioned I
gave them a shout out in terms of the amazing webinars they do because I am a big fan of learning by doing exploring a tool by doing Hands-On sessions and webinars so I explore their page the documentation blogs webinars but uh we’ll be utilizing it handson in this series and in the future ones as well so yeah very excited and check out the links in the description below that’s it for this video we covered a lot of things um I tried to break down bigger Concepts into smaller ones so I hope it was easy to understand in the next
blog we’re going to get a little a little bit more Hands-On we learn about um Vector databases in the next video so I’m very excited about that and um yeah check out the links in the description below if you have any questions let me know in the comment section below and uh you can also take a you know screenshot of this video and uh learn in public so you can share what you learned write a blog or you can check out single store and you know try it out share what you think on social media tag them.

gen AI & retrieval augmented generation

One thought on “How work Introduction to gen AI & retrieval augmented generation (RAG)

Leave a Reply

Your email address will not be published. Required fields are marked *