OpenAI GPT 3.5 AI assistant with Langchain + Pinecone #1

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
okay so I'm going to share something that I've been working on for the last few days and it's going to take I think quite a few more days for this to progress into something that is in a more showable state but I wanted to kind of share that progress and I think it makes sense for us to walk through the steps of building it as they are built so the idea is something that I've actually I think wanted to build since I kind of came into the space of NLP and machine learning and in fact I think it's one of the main reasons I even got interested in NLP in the first place which is actually trying to build some kind of AI assistant and I don't mean the AI assistant like Siri or Alexa because honestly I don't think they're that useful like okay it's cool because you can speak and the lights will turn on or a certain song will play that's great but it's not actually helping me and do things in my daily life that I you know personally would think of as productive so what I've always wanted to build is an AI assistant that can actually do that but unfortunately it's always been kind of Out Of Reach to do anything like this that is until very recently with the release of these crazy AI models we've seen chat GPT obviously gpt3 for quite a while we have long-term memory we have essentially all of these different components are kind of coming into place where we're now at the stage that we can build an AI system that is actually useful and it shouldn't be too difficult to actually do it either so the idea I have so far is what you can see here so I want to obviously build this personal chat but I think it's bad to call it an AI assistant than chatbot because that's kind of like one component of it and the first thing that I'm going to work on is can help me with like researching papers from archive so this will be an incredibly helpful thing because I spend a lot of my time just kind of like reading things and trying to research things and you know what I always find is that I end up going down like a rabbit hole of papers okay there's this paper and to understand what it's talking about I need to go and read another paper and then to understand that I need to go and read another paper and that's fine but I think it would be so useful to actually just be able to ask a question in like a a chat or in like a search bar or something and get a answer that kind of takes all of these relevant parts of the research and summarizes it to me and also tells me where that's from so I can read into it more so that would be incredibly useful and that's my main focus right now actually building this part of it and to some degree it's kind of there so let me just show you what we have so far with that okay so we're going to start with a couple of questions that I've already asked and this is just in a notebook at the moment so there's a ton of code that I've just run in order to get to this point and then we'll just see a couple of questions just so you can get a feel for what the idea behind this might look like when it is more kind of flesh out so right now what we're working with is a very small portion of data set and of course this is not really in a chatbot like format it only has the archive data in there it can't really do that much right now this is really like the first component of the idea of an AI assistant so yeah let's take a look okay so now I'm asking something that is kind of in there what is the latest research on reasoning and acting in language models so if I come down we get this paper here towards reasoning in large Change Model as a survey it says straight away like a very it seems like a very useful paper but this is quite a lot of text maybe I don't want to realize it's not in the best format either so what we can do is put them all together and feed them through an open AI completion endpoint so doing text DaVinci zero zero three so we come down here and then this is asking the question now and let's just take a little bit of time because I have a lot of information going into the large language model and small amount coming out but it's you know all of that together is considered by the large Range model and based on how much we have it's going to take longer or less time so the latest research on reasoning and acting in language models includes techniques for improving and eliciting reasoning in these models so this is I think probably referring to things like Chain of Thought which is true methods and benchmarks evaluating reasoning abilities findings implications of previous research in the fields and suggestions feature are interested so it's a it's an okay review but it's not very specific so I kind of figured it probably doesn't have that much specific information on this topic in there at the moment because that there isn't much I think I got like a month's worth of papers in there which is not necessarily that much so to run this and what we're going to do is ask this so what is the term that describes how large language models seem to exhibit reasoning abilities when they get to a certain size all right this is something do know the answer to and it will hopefully give it us okay so imagine behavior that is correct so essentially this is the idea that large language models you keep increasing the size of them and once you get to a certain size it's like they can all of a sudden just do this new thing right so kind of like what we're doing here once the GPT model has got to a certain size all of a sudden they could answer questions very easily and they could do like named entity extraction just by you know telling them to within the prompt and all these like crazy things that just kind of seem to emerge out of nowhere all of a sudden even though they were not necessarily fine-tuned to do that in the first place so that's pretty cool and then okay let's try this tell me about the idea behind immersion abilities in large language models let's run this okay Okay cool so took quite a while and that's definitely something you need to work on but okay tell me about the idea behind these immersion abilities and it says okay imagine abilities of language models is a concept that larger models are more proficient at meta learning than small models and can acquire abilities that are not present in those smaller models which is true this includes tasks such as fuchsia prompting it's the idea that you can give a few examples within your prompt and the model will learn how to do something based purely on that a transliteration from the International Phonetic Alphabet you know I don't know whether that's true or not this is the point where you'd like okay let's take a look at these papers and see what they say recovering a word from its scrambled letters and Persian question answering now recovering word from scrambled letters I I'm pretty sure I've seen that Persian question answering no I have no idea but it would not surprise me it seems pretty realistic furthermore large language models can be trained with more data which can potentially lead to miscorrelation between different modalities so I'm not entirely sure what that means but you know again we have these papers in there so we can read into it which is pretty cool to mitigate the risk associated with emergent abilities researchers are urge to develop up-to-date benchmarks to measure unforeseen behaviors in their large language models so this is something that people keep talking about it's like okay we have all these benchmarks have been created pretty quickly but then the models are kind of saturating these benchmarks almost as soon as they are made like they just become irrelevant because the models are just so far beyond these benchmarks so quickly so that's definitely like an important thing right now and then final question or final serious question is what are trainer thoughts in large language models so this is kind of like a prompting technique or hopefully it will explain it a little better than I can so chain of thoughts are a technique used to enable complex reasoning and generate exclamation with large language models by forcing them to explicitly verbalize their reasoning steps as natural language so this is kind of like you you ask it a question and what it's going to do is first it's going to kind of say okay this is your question this is the first step I'm going to take in order to you know find the answer to your question now based on that first step it's going to move on to the next step right and then the next step and then it will come to your answer so this is kind of a very human way of going about things when we are trying to answer a question we'll usually go through it step by step in our heads and this is essentially what we're getting the models to do here as well and it works very well for just improving the performance or the question answering abilities of these models so it's really cool and this method has improved performance on a variety of tasks and spot the active development of further refinements which is true there are kind of further advances on that one of those is the react thing that I mentioned earlier so yeah it's this is kind of getting there like the data set I have behind this is very small it's not even that relevant to what I'm wanting to do now I'm kind of discuss that a little more in a moment and yeah it's already doing relatively well which I think is pretty cool and then I wanted to test so can you tell me why zebra is a stripy I kind of try to force it to not answer questions that are not answerable by whatever you have within the data being given so I asked if the question cannot be answered using the information in the context answer I don't know so usually or at least some of the time when you do this it will say I don't know if it doesn't see the answer in the context but I've only had that work so far with smaller context we're feeding quite a lot into here so I think I need to kind of figure out this prompt a bit better because when I last tried this it didn't work so if we come down yeah so like it does actually give you the answer and I also checked in these papers to make sure that they don't actually tell you why zebra is a stripey inside them and they didn't it is kind of just making this up not making this up it knows this within the model weights but it doesn't know it from The Source knowledge which is the context that we've tried to provide here so this is just something that I will be testing and hopefully at some point I can get it so it will say I don't know even for a really obvious question because I don't want it to be outputting false information now that is you know the idea of what we have so far so the archive part of it what we'll do is very quickly go through the rest of it and then I'll probably leave there and we'll go through some of the data pre-processing stuff that I did in the next video right so I wanted to be able to make good writing suggestions so a lot of my work is writing articles so that would be insanely useful if I can get good writing suggestions on these Niche topics because I've tried with like chat GPT and gbt3 and when it comes to kind of like technical topics it doesn't really do very well it can help a little bit of like ideation on kind of getting out of I want to say writer's block but beyond that it's not actually that useful so it would be really good to get good suggestions on these more technical topics I would really like this if we do go for like a chat about type thing to be able to talk well like chat gbt can so I can like go through a more touch step process of answering questions I don't know how realistic that's going to be because the research behind track GPT hasn't been released so you know there's no way of knowing how they how they did that unless they they will probably release a GPT endpoint at some point so you know maybe that will feature in this at a later date there are other data sources I'd like to include like YouTube videos articles so a ton of the you know when I'm going through things and or building something I will end up kind of forgetting things over time that I did you know like years ago and what I will do very often is either you know find someone else who's explaining it or if I know that I've explained it in the past I'll go back to my old videos go back to my old articles and actually use them to kind of relearn because it's almost like I'm speaking to myself like it's just an older version of myself so with the language I'm using it's super easy for me to understand so I would like to be able to index all that stuff as well like just pass things that I've done and as well as kind of including that would be my notes like in this here I'm using obsidian which is like a note taking app which I've just only just started using in the past week before then my notes were just kind of everywhere but if I continue using this and I have a lot of notes in here it'd be really good to index all of that code documentation so you know like line chain it's a new library chat GPT doesn't know anything about it so you can't answer questions about it it'll be really good to like be able to put that in our long-term memory component and then actually we can answer questions about it like super quickly which will be amazing now what will it look like um yeah this Lane chain pine cone for storing all the archive papers and everything else so one thing I did want to mention this is right now what you just saw all the papers I got for that they've just kind of been brought in bulk from scraping the archive website and using the archive API and there was no intelligent logic behind that well I have started working on and it's kind of you know it's getting there is basically you give one paper and then it's going to work throughout paper it's going to extract the references and then it's going to find the other papers that were mentioned in that paper and it's kind of like a graph or a tree that kind of expands out or branches out from that that'll be really cool because I think then you can be a lot more specific on what you're indexing and not just kind of index the last 20 years of archive which would be insane so that would be really cool maybe you can do a bit of both though I always say like maybe some is more recent papers you just kind of get them in and index them in bulk right uh the okay react framework is kind of what I mentioned before uh there's no CR didn't actually mean to press that so let's go back to here so this is basically okay your chat bot your AI assistant will be able to search the internet it will be able to use Python to answer questions and all of these kind of like cool crazy things but that'll be really fun to to try and then there's also the trainer thought thing so I haven't actually tested that yet I would like to so that is in there as well and then where are we at the moment we are still doing step one so this is where we are for now uh that's all I'm focusing on that I think that would take a little bit of time to build and it's definitely going to take a couple of videos to actually walk you through everything so you know we're going to be on this for a little while and then we'll move on to trying to make it into more of a chatbot we're going to have like the endpoint and a nice like web app like maybe I can use angular or something like the only framework I've ever used before I don't know if that's even relevant anymore but my idea actually here was to as chat GPT to help me build that uh so that will be interesting to to try out let's see and then finally I want it to be in a super easy to use format so you can literally just like get clone it and use it for your own things so yeah that's where we are at the moment you know for this video I'm going to leave it there because there's a ton of code super messy but I will take you through it in the next video where we're going to focus on actually getting all these archive papers and we'll kind of explore both options there so we have like that graph method or we have just kind of like the dumb method of bookly downloading everything for now that's all for this video I hope it's been interesting I'm super excited to see where this project goes and it's already looks kind of promising so that'll be cool to see so thank you very much for watching and I will see you again in the next one bye
Info
Channel: James Briggs
Views: 29,898
Rating: undefined out of 5
Keywords: python, machine learning, artificial intelligence, natural language processing, nlp, semantic search, similarity search, vector similarity search, vector search, ai assistant python, james briggs, ai assistant, ai assistant project, langchain, openai, pinecone, pinecone ai, gpt 3, gpt 3.5, gpt 4, gpt 3 tutorial, gpt 3.5 tutorial, gpt 3 python api, chat gpt, chatgpt plus free, llm, llm course, chatbot tutorial, chatbot using python, python chatbot, langchain in python, gpt 2
Id: 15TDwVSpwKc
Channel Id: undefined
Length: 17min 7sec (1027 seconds)
Published: Thu Feb 16 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.