So How Does ChatGPT really work? Behind the screen!

549.63k views2506 WordsCopy TextShare
Arvin Ash
Claim your SPECIAL OFFER for MagellanTV here: https://try.magellantv.com/arvinash Start your free tr...
Video Transcript:
hello and welcome to my Channel today I'd like to introduce you to Chad GPT Chad GPT is an AI powered Chad bot that uses natural language processing and machine learning algorithms to interact with users what sets Chad GPT apart from other Chad 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 gbt the topic of today's video it's like a chad on steroids an internet tool that allows you to have
humanlike 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 Chad 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 aai how did this company create this seemingly magical tool and how does Chad GPT 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 mellan 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 found ERS this series is just a small sample of the thousands of documentaries on mellan TV the highest rated documentary streaming app on Google Play and more than 20 hours of new content are added weekly mellin has a special offer for Arvin Ash 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 Chad GPT it's a seemingly super clever AI chatbot 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 programming 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 GPT 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 Chad 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 and the text Data one way that it utilizes this learning is to create humanlike 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 Chad GPT attempts to create fully coherent sentences 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 IFI that it doesn't look literally a text but it looks for matches in context and meaning the end result is that it produces a rank 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 sense it's basically asking itself given the text so far what should the next word be and each time 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 stepbystep 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 GPT only used the sentence completion model its response might be something like explain how
quantum mechanics Works according to the shinger 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 a user and an ideal chatbot 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 humanlike 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 taught 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 a 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 Chad 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 worst 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 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 right 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 texts and sentences of a near Limitless number of subjects and it can do it on its own so it can scale the human taught 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 terabyt 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 Chad 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 GPT is already the next version GPT 4 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 GPT 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 in AI or alien I'll see you in
the next video my friend [Music]
Copyright © 2024. Made with ♥ in London by YTScribe.com