Home Videos

Chain-of-thought prompting – Explained! (YouTube Video Transcript)

Need transcripts for other videos? Try our YouTube Transcript Generator →
Title: Chain-of-thought prompting – Explained!
Duration: 00:08:33
Total Correct Answers:
Current Caption
Correct

Learning Modes

YouTube Video Transcript Hide

Ask AI Result

The ask AI result will appear here..
(00:00:00) Your YouTube transcript will appear here (00:00:00) greetings fellow Learners now before we (00:00:02) get into this thought-provoking world of (00:00:04) Chain of Thought prompting I have a (00:00:06) thought-provoking question for you when (00:00:09) did you start to understand the (00:00:11) importance of critical thinking now for (00:00:14) me school was more a wave of all right (00:00:18) here's some stuff on my plate and let's (00:00:20) just get it over with and it wasn't (00:00:23) really until about 11th grade that I (00:00:25) really liked thinking outside the (00:00:27) curriculum and particularly in a (00:00:30) computer science course that I took in (00:00:32) 11th grade and throughout College it is (00:00:35) this thinking outside of what is being (00:00:37) taught that really served me well into (00:00:40) trying to solve problems that really (00:00:42) weren't solved much by my peers and so (00:00:46) flipping this question over to you what (00:00:47) is your take on critical thinking and (00:00:49) when did you see the importance of it (00:00:51) share your story down below and I would (00:00:53) love to hear your thoughts now in this (00:00:57) video we're going to talk about Chain of (00:00:58) Thought and Chain of Thought prompting (00:01:00) so let's get to it so let's start with (00:01:04) our llm here and these llms first they (00:01:07) start out as untrained and then we will (00:01:10) train them on a specific task of (00:01:13) language modeling which is basically we (00:01:15) train them on task where we feed in some (00:01:18) early part of a sentence and we try to (00:01:20) make them predict the next word so we (00:01:23) feed some examples like this and then (00:01:26) eventually this language model becomes (00:01:29) pre-trained (00:01:31) we have a pre-trained (00:01:32) llm now this llm can now be fine-tuned (00:01:36) on a multitude of tasks it could be (00:01:39) question answering it could be text (00:01:40) summarization and so many others and it (00:01:43) actually works pretty well on these (00:01:46) tasks however there are a few tasks (00:01:49) where llms even when fine-tuned on a (00:01:51) specific task struggle and this includes (00:01:54) arithmetic or some common sense (00:01:58) reasoning and so how do we deal with (00:02:00) this well one way to deal with this is (00:02:03) the Chain of Thought prompting so Chain (00:02:07) of Thought prompting is essentially the (00:02:08) combination of two main Concepts which (00:02:11) is f shot learning as well as reasoning (00:02:16) let's talk about each of these starting (00:02:18) with fuse shot learning so for fuse shot (00:02:21) learning we have this llm that's (00:02:23) pre-trained on language modeling and (00:02:26) instead of just passing in let's say a (00:02:28) direct question which we want to answer (00:02:29) to we will pass an Exemplar problem so (00:02:33) we pass in a question where I have three (00:02:35) tennis balls I got three more how many (00:02:38) do I have the answer is six this is a (00:02:40) complete example of what we want our (00:02:43) model to do we then pass in a question (00:02:46) and then we will now expect that the llm (00:02:50) will try to respond similar to the (00:02:52) example that we gave (00:02:54) previously now this here is known as one (00:02:57) shot learning it is one shot because we (00:02:59) passed in one one example before passing (00:03:02) in our actual (00:03:04) request and so you can imagine with you (00:03:07) know few shot learning we have a few (00:03:10) examples where we have one question (00:03:12) answer pair over here we have another (00:03:15) question answer pair over here and (00:03:17) probably some in between and then we can (00:03:20) pass in our question into the llm and it (00:03:24) can then generate a response and so (00:03:27) because we have a few examples that we (00:03:29) pass in with R prompt this is fuse shot (00:03:32) learning fuse shot learning is actually (00:03:35) quite useful in fact the original (00:03:37) version of gpt3 uses fuse shot learning (00:03:41) and the performance of f shot learning (00:03:43) is pretty good for the largest 175 (00:03:46) billion parameter model we see that F (00:03:48) shot learning even outperforms the (00:03:51) fine-tune state-ofthe-art (00:03:52) for certain tasks so there is some (00:03:56) promise here however for certain other (00:03:59) types of problems especially esally (00:04:00) those that involve arithmetic we can see (00:04:03) that the answer that is given is wrong (00:04:05) and so it struggles with arithmetic and (00:04:09) so for example I have three oranges and8 (00:04:12) two how many do I have the correct (00:04:14) answer is not two oranges so how do we (00:04:18) deal with this well this is where the (00:04:20) second component comes in and that is (00:04:23) using reasoning so now we have this (00:04:26) prompt that has an example here of (00:04:29) tennis ball I have three tennis balls I (00:04:32) got three more how many do I have we (00:04:35) have six tennis balls and then it (00:04:36) proceeds with the original question that (00:04:39) we want to ask this is how we do it in (00:04:41) one shot learning but what we can do (00:04:44) from here is now add a rationale or (00:04:47) reasoning of how we got from this (00:04:50) question to this answer so we have that (00:04:52) question and in between the question (00:04:54) answer we would say well I start with (00:04:56) three tennis balls and when I get three (00:04:59) more balls (00:05:00) I add to the existing balls that I have (00:05:03) and 3 + 3 is six and hence six tennis (00:05:07) balls is the answer so the answer is six (00:05:10) tennis balls and now when we pass in the (00:05:13) question with this more informed prpt (00:05:16) with a chain of (00:05:19) thought we can then get a solution that (00:05:21) is much more structured with some (00:05:24) rational so we prompt the llm to say (00:05:27) okay I start with three oranges and when (00:05:30) I eat two I subtract them from the (00:05:33) original and because 3 minus 2 is 1 (00:05:37) hence one orange should be the answer (00:05:41) and in this case the entire Chain of (00:05:43) Thought prompt is going to be this (00:05:45) question along with the rationale for (00:05:48) the answer and then the answer itself (00:05:51) and then we pass it along with the (00:05:52) question that we want the llm to (00:05:54) actually answer and so a Chain of (00:05:57) Thought is intermediate steps of reason (00:06:00) reasoning that link the input to the (00:06:04) output and the input could be a question (00:06:07) the output could be an (00:06:09) answer now let's take a look at the (00:06:11) performance of these across arithmetic (00:06:13) data sets as well as some common sense (00:06:16) reasoning data sets and looking at that (00:06:19) we can see that for the larger models (00:06:21) which are over like 100 billion (00:06:23) parameters we can see this blue line (00:06:25) which is the performance of Chain of (00:06:26) Thought prompting in some cases can even (00:06:29) super if not come pretty close to the (00:06:33) fine-tuned version and with fine-tuning (00:06:37) we tend to have the drawback of (00:06:38) typically just collecting data and also (00:06:41) having the amount of space in compute in (00:06:44) order to actually tune the model but we (00:06:47) can sidestep the entire thing with just (00:06:50) taking the pre-train model using few (00:06:52) shot learning and interjecting some (00:06:54) rationale in a few of those prompts and (00:06:57) so Chain of Thought prompting opens a (00:06:58) world of opportunity for reasoning tasks (00:07:02) while still using less compute and (00:07:05) memory resources quiz time have you been (00:07:09) paying attention let's quiz you to find (00:07:11) out what is an example of a Chain of (00:07:14) Thought prompt a the question B (00:07:19) providing a question an answer to that (00:07:22) question and then another question C (00:07:26) providing the question the rationale the (00:07:29) answer answer to that question and then (00:07:32) the question you want to ask or D (00:07:35) providing the question the rationale and (00:07:36) the answer and then providing the (00:07:39) question you want to ask along with the (00:07:41) reasoning or rationale for that question (00:07:43) you want to (00:07:45) ask know that multiple answers may be (00:07:47) correct but I'll give you a few seconds (00:07:49) to think about (00:07:58) this the correct answer is C but can you (00:08:03) tell me why give your reasoning in the (00:08:05) comments below and let's have a (00:08:07) discussion and if you think I do deserve (00:08:09) it please do consider giving this video (00:08:11) a like because it will help me out a lot (00:08:14) now that's going to do it for this quiz (00:08:16) time and also for the video it's a nice (00:08:18) and short one so if you do like what you (00:08:21) saw please do consider giving this video (00:08:23) a like and also subscribe for more and (00:08:25) if you want some more AI content do (00:08:27) check out this video right over here (00:08:30) thank you so much and I'll see you in (00:08:32) the next one bye-bye

Leave a Reply

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