So How Does ChatGPT really work? Behind the screen!

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello and welcome to my Channel today I'd like to introduce you to Chad GPT Chad GPT is an AI powered chat bot that uses natural language processing and machine learning algorithms to interact with users what sets chat GPT apart from other chat Bots is its ability to understand context and provide relevant responses so why not give it a try and see how it can help you today this intro as you probably guessed was written by Chad GPT the topic of today's video it's like a chat bot on steroids an internet tool that allows you to have human-like conversations unlike Google which returns search results a list of web pages and articles that usually provide information related to their search queries Chad GPT provides a response based on the context and intent behind a user's question you can't for example ask Google to write a story or write code but you can ask that of chat GPT and it will give you a reasonable response the GPT stands for generative pre-trained Transformer which means it generates responses It Is pre-trained by humans and finally the Transformer is the key neural network architecture that transforms the input into a meaningful output this model was created by an artificial intelligence research company called open AI how did this company create the seemingly magical tool and how does Chad gbt actually work what's going on behind the curtain that's coming up right now [Music] before we get into the details of how Chad GPT works I want to acknowledge that part of the inspiration of this video was a 12 episode documentary I watched on Magellan TV today's sponsor called Tech talk Transforming Our Planet it takes you inside upcoming startup companies that are working on things like artificial intelligence flying cars robots holographic surgery and other innovative ideas and the fascinating stories of some of their Founders this series is just a small sample of the thousands of documentaries on Magellan TV the highest rated documentary streaming app on Google Play and more than 20 hours of new content are added weekly Magellan has a special offer for arvinash viewers right now your first month is absolutely free just click the link in the description and start enjoying the highest quality documentaries available including free 4K videos and never any ads and you'll be supporting this channel when you sign up so I can't thank you enough for that and now back to the show unless you've been living under a rock for the last year you've probably heard about chat GPT it's a seemingly super clever AI chat bot that seems to know everything it can do everything from your homework to write a cover letter for a new job to giving you advice to program and code while Google's power is the ability to do enormous database lookups and provide a series of matches that might answer your queries Chad gpt's power is the ability to interpret the context and meaning of a particular query and produce a relevant answer in grammatically correct and natural language based on the information that it has been trained on so how does it work let me just dispel a few myths first it's not magic it's just math and a bunch of clever Concepts and no it doesn't get smarter by itself it can't self-study like a human that can go to the library and start learning new things Chad gbt learns from whatever it is told to study it's also not just asking the internet for an answer to your question it does have a storehouse of knowledge and uses it to answer your questions chair GPT was trained on data from books web pages Wikipedia news articles scientific journals and other unspecified sources the material was collected up to about September of 2021 so any information newer than this Chad GPT would be clueless about at least as of today which is around April of 2023 you'd have to teach it this new material if you want an answer to something that's become new knowledge after that time the short answer to how it works is that it uses neural networking with supervised learning and reinforcement learning two key components of modern machine learning what does this mean to start off let me describe at a very high level and in a highly simplified way what Chad GPT is doing then I'll explain this in more detail let's say we give it an input such as in two sentences explain quantum mechanics in very simple terms the actual output from Chad GPT was the following quantum mechanics is a branch of physics that deals with the behavior of tiny particles like atoms and electrons it tells us that these particles can act like both waves and particles and can be in many different states at the same time as you can see this is not a bad answer so how did it come up with this what it does fundamentally is predict what words phrases and sentences are likely to be associated with the input I just made and then chooses the words and sentences that it deems most likely to be associated with the input so it attempts to understand your prompt and then output words and sentences that it predicts will best answer your question based on the data that it was trained on it also randomizes some outputs so that the answers you get for the same input will often be different so for example when I asked it to regenerate the response to the same question as before it gave me this answer quantum mechanics is a branch of physics that studies the behavior of matter and energy at a very small scale such as atoms and subatomic particles it is characterized by phenomena such as superposition entanglement and wave particle duality which are not easily explained by classical physics so as you can see this is a pretty good answer as well let's simplify this further to see what's going on behind the curtain the first thing you should understand is that how Chad GPT fundamentally works is that it tries to determine what words would most likely be expected after having learned how your input compares to words written on billions of web pages books and other data that it has been trained on a humongous data set was used to form a deep learning neural network to put it simply this is a multi-layered weighted algorithm similar to The Way We believe the human brain works it allows Chad GPT to learn patterns and relationships in the text Data one way that it utilizes this learning is to create human-like responses by predicting what text should come next in any given sense now I don't want to give you the impression that it's like the predictive text on your phone that's just guessing what the word will be based on the letters it sees chair GPT attempts to create fully coherent senses as a response to any input and it doesn't just stop at the sentence level it's generating sentences and even paragraphs that could follow your input now let's look further into the details of how it does this let's do a very simple example let's say we ask it to complete this sentence quantum mechanics is the processing that happens behind the scenes goes something like this it calculates from all the instances of this text what word comes next and at what fraction of the time now let me qualify that it doesn't look literally a text but it looks for matches and context and meaning the end result is that it produces a ranked list of words that might follow together with their probabilities so its calculations might produce something like this for the next word that would follow the word is the model would then choose the next word to complete the sentence it's basically asking itself given the text so far what should the next word be and each time it asks this it adds a word so it keeps adding words until it completes the output there is a stop mechanism built into the model based on a rough standard of what the length and format should be now you might think it will always choose a word with the highest probability but it doesn't always do that there's a Randomness built in so that its answers can be more creative so for example it might choose the word a as the next word and based on this Choice the output sequence might look something like this quantum mechanics is a is a branch is a branch of is a branch of physics and it would keep doing this until it presents the following full answer now as you might imagine if it chooses the word fundamentally instead of a then it might output a completely different answer based on the subsequent choices for example with the following sequence quantum mechanics is fundamentally is fundamentally a is fundamentally a probabilistic is fundamentally a probabilistic theory and it would keep doing this until it presents the following answer both outputs are correct but they're different the message here is that there are many possible next words so the answers could be quite different every time anyone makes the exact same query but as I said before the model doesn't just come up with the next words it also works at the sentence and paragraph level so it can output for example the best sentence that might fit the context and meaning of the first sentence but the important thing to understand about this is that fundamentally this is what the model is doing it is choosing what it determines is the best response to the query step by step now as you might imagine the sentence completion model is obviously not enough if we ask it something like explain how quantum mechanics works it has to use a different strategy if Chad gbt only used the sentence completion model its response might be something like explain how quantum mechanics Works according to the Schrodinger equation this would not be the kind of answer that the user was looking for so now the question is how does the model respond in a more appropriate and conversational way this all comes down to the way it was trained in the first stage of the training process human contractors play the role of both the user and an ideal chat bot each training consists of a human user and a human acting as the chatbot carrying on a conversation now these two roles could be played by the same person the basic idea is to train the model to have human-like conversations the thread history of this with real humans is entered into the model so this way the model learns to maximize the probability of picking the correct sequence of words and sentences in any particular conversational exchange through this supervised human thought process it learns to come up with an output that is more than just sentence completion it learns patterns about the context and meaning of various inputs so that it can respond appropriately this is why I chat with chat GPT can sometimes seem like there might be a human at the other end but this is not the end of the training process the output from this stage is further fine-tuned in a second stage where the developers teach chat GPT to assign a reward or ranking to each output so for example a trainer might ask the model something like describe an atom the potential answers could be the following it's the smallest part of a substance made of electrons neutrons and protons it's a basic chemical element it's an object made of subatomic particles it's a ticketing service a human trainer would rank this output from best to worse something like this and then this data would be fed to the model like this where a is greater than C which is greater than b which is greater than D this teaches chat GPT to critically evaluate what the best output is likely to be now the problem with solely using human trainers as in this type of supervised learning is scale human trainers would have to anticipate create all the inputs and outputs of any potential query that any one user could potentially request at any time this would be impossible to do and we know that Chad GPT doesn't have this kind of limitation for example you can have it write a short story about almost any subject and it will come up with something reasonable so how is it doing that for this it uses a third step which is called reinforcement learning this is a type of unsupervised learning this process trains the model where no specific output is associated with any given input instead the model is trained to learn the underlying context and patterns and the input data based on its earlier human taught pre-training in other words the model uses the pre-training including the ranking system to form the basis of its output for the unsupervised training stage this way the model can process a huge amount of data from various sources and learn the patterns from text and sentences of a near Limitless number of subjects and it can do it on its own so it can scale the human thought training to a much bigger data set and that data set used to train chat GPT which is based on GPT 3.5 is huge about 45 terabytes of data now this might not seem all that much by today's standards where you can buy a terabyte flash drive for 20 bucks but this is a huge amount of text to process each terabyte is equivalent to 83 million pages of information and this is big enough for chat GPT to learn patterns and relationships between words and phrases on a massive enough scale such that it can come up with relatively meaningful outputs for nearly any query the astonishing part is and maybe this is even scary to some of you that as good as Chad gbt is already the next version gpt4 is trained on even more data and is even more fine-tuned so it should be even more powerful now I did not get into the details of the way that the text information is converted to numbers and some of the mathematics and mechanisms of how neural networks like Chad CPT work now I'm I'll make a future video if you're interested in learning that so let me know in the comments if you want me to make that follow-up video in the meantime I hope you found this useful and I'm not really an AI or alien I'll see you in the next video my friend [Music] thank you [Music] foreign
Info
Channel: Arvin Ash
Views: 358,113
Rating: undefined out of 5
Keywords: chat gpt, artificial intelligence, chatgpt tutorial, how chatgpt works, open ai, chat gpt tutorial, what is chat gpt, machine learning, chatgpt explained, how does chatgpt work, artificial intelligence explained, chat gpt 3, ChatGPT, how does chat gpt work, How is ChatGPT trained
Id: WAiqNav2cRE
Channel Id: undefined
Length: 15min 1sec (901 seconds)
Published: Sat Apr 08 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.