We can't find the internet
Attempting to reconnect
Something went wrong!
Hang in there while we get back on track
Zero-shot, One-shot and Few-shot Prompting Techniques Explained | Prompt Engineering | Generative AI
0:04 [Music]
0:05 hello everyone welcome back to my
0:07 YouTube channel in this particular video
0:10 we'll be looking into zero shot
0:12 prompting one shot prompting and few
0:15 shot prompting which are nothing but
0:18 techniques of prompt
0:20 engineering so these are the basic
0:23 techniques that everyone should know who
0:26 is learning prompt engineering and using
0:29 these Tech techniques we can simply
0:31 tackle multiple scenarios of handling
0:34 the response format as well as the
0:37 understanding of the large language
0:40 models so we'll be first looking at the
0:43 zero shot prompting technique now what
0:46 exactly it is let's have a look at the
0:47 definition first over here it's a type
0:50 of prompting technique in which inside
0:53 the prompt you do not provide any
0:56 examples here no examples are given just
1:00 the instructions are jotted down now if
1:03 you have seen my previous video on the
1:05 art of prompt engineering where I have
1:07 shown you how basically we can write a
1:10 prompt so there I have told you the
1:13 three components of a prompt system
1:15 prompt user prompt and the assistant
1:18 prompt all these three components will
1:20 be included in zero shot prompting here
1:22 we are only going to provide the
1:25 instructions for the large language
1:27 model to follow with the input variable
1:29 Ables that we want to input into the llm
1:33 for example if I want the large language
1:35 model to summarize the given paragraph
1:38 into one single statement then in that
1:40 case inside the prompt instructions I
1:43 would simply write summarize the given
1:46 paragraph in one single sentence that's
1:49 it here only instructions are provided
1:52 we won't be explicitly defining any
1:54 examples for example I would just
1:56 provide a paragraph and then how to
1:59 Output it into one single statement I
2:01 would just provide an example here no
2:04 examples are given so I hope you might
2:06 have got a basic idea of what exactly
2:08 zero shot prompting is now let me make
2:11 the agenda clear we'll be writing a
2:14 prompt which will take a query it can be
2:18 a statement or a paragraph and the large
2:22 language model should take out all the
2:25 nouns from that particular
2:27 sequence it should return the counts in
2:30 the form of a list whatever be the
2:32 number it should return it in the form
2:35 of a
2:36 list so now we will be writing a prompt
2:39 for it for now just ignore this
2:42 particular code just focus on this
2:44 particular prompt under the system tag
2:47 we'll be writing the system instruction
2:50 what exactly the large language model
2:52 has to behave like under the user tag
2:56 we'll be simply writing the inputs that
2:59 we that we are going to provide to the
3:01 LGE language model we might provide the
3:05 instructions of the output format also
3:07 inside the user prompt or inside the
3:10 system
3:11 prompt and then we'll keep the assistant
3:14 tag as it is we won't be writing
3:16 anything inside
3:19 it so let me write the prompt for this
3:23 particular
3:25 scenario you are a smart assistant
3:31 you will
3:33 be given a
3:35 sequence it can be a
3:40 sentence or a
3:42 paragraph your
3:44 task provide a list of all the
3:50 nouns that are
3:53 present in the
3:56 give provided sequence
4:00 so here we have simply defined how the
4:02 large language model should act and what
4:05 exactly is the agenda for it next we'll
4:08 be writing the user prompt under this
4:10 we'll simply write the inputs that we
4:12 are going to
4:13 provide so we'll write here is
4:18 the
4:19 given
4:24 sequence let me clear it with the output
4:27 format strictly provide
4:31 a list of all the
4:36 nouns without any
4:42 explanation now over here I have defined
4:44 this particular prompt now let's try to
4:47 provide a query a simple query and let's
4:50 check whether it provides whatever we
4:54 require so here we go with our query a
4:57 person walks to the beach and watches
5:00 the sunset let's try to check whether we
5:03 get a list of nouns from it let's
5:06 execute this and we are going to call
5:09 Lama 3.1 70 billion versatile model from
5:12 the gro API I have already made a video
5:15 on accessing large language model using
5:17 the gro AI inference API so if you have
5:20 not watched it yet please watch it from
5:23 the Gen playlist on my channel let's
5:26 execute this
5:27 cell and
5:31 over here you can see what it has given
5:33 as the
5:34 output the output is something like this
5:37 over here it has provided the list of
5:40 nouns to us person Beach and the sunset
5:44 and yes it is exactly correct now what
5:48 if I don't provide it with any noun so
5:51 let's provide this letter a and let's
5:54 execute
5:56 it so in this particular case it is
5:58 returning none as the output but now
6:02 what I want is I want the output in the
6:04 form of a python list let me show you
6:09 something like this it should provide
6:11 the list of nouns in this way so for
6:15 this I'll have to provide the output
6:17 format either I can simply provide the
6:19 output format over here or I can provide
6:23 it with the help of few short
6:25 examples so either we can provide the
6:28 output instructions
6:30 or we can simply provide the few short
6:32 examples to
6:33 it also we can provide the case where we
6:36 don't have any nouns present inside this
6:39 particular query so in that case it
6:41 should return an empty list something
6:43 like this so we can show it with the
6:47 help of example or we can Define the
6:49 output
6:50 instructions so for some use cases it is
6:53 better to apply the few short examples
6:56 and you will get to see the Boost in the
6:58 accuracy
7:00 now over here in our case let's try to
7:03 solve this particular problem with the
7:05 help of the onot prompting
7:08 technique first I'll simply solve the
7:11 problem of getting the list of nouns in
7:14 the python list format so if I provide
7:17 this particular query it should provide
7:19 me output in the form of a python list
7:22 and it should be a list of strings
7:24 person Beach and
7:26 sunset so now let's try to write a
7:29 prompt
7:30 let's try to add some example here in
7:32 this particular case we'll simply
7:34 provide one single example so it will be
7:35 called as onot prompting
7:38 technique so here is the template for it
7:42 one shot prompting technique involves
7:43 one single example so basically till
7:46 here it will be the one and the same as
7:48 of zero shot prompting system user and
7:51 assistant prompt now since we are going
7:54 to provide one example we'll be adding
7:56 on the user tag and the assistant tag
8:00 why because we'll be providing one user
8:03 question one sample user
8:05 question and one sample assistant answer
8:09 okay so over here you can see we have
8:11 the system prompt then we have the user
8:13 prompt then we have the assistant prompt
8:16 till here you can see it's same as zero
8:19 shot prompting
8:20 Technique we have addon these two tags
8:24 that is the user prompt and assistant
8:26 prompt now why we are doing this because
8:29 we are going to Define
8:31 example which will include a user
8:34 question an example user question and an
8:37 example answer for that particular user
8:40 question so for that we have added the
8:44 user prompt and the assistant prompt
8:47 tags so what I will do is I'll simply
8:50 copy the system prompt as it is that we
8:53 had defined earlier and then we'll
8:57 Reserve this particular user tag and the
8:59 assistant tag for our
9:02 example and then under this particular
9:05 user tag I'll simply paste in the
9:07 previous prompt things like here is the
9:11 given sequence and we are passing the
9:13 dynamic query over here strictly provide
9:16 a list of all the nouns without any
9:18 explanation so this was already defined
9:20 in our previous prompt now what we'll do
9:23 is we'll simply Define a sample user
9:27 example user query example example so
9:30 let me paste the same thing over here
9:33 but instead of the dynamic query we'll
9:36 simply Define a static example let's
9:39 take the same example over
9:42 here we'll copy
9:46 this and over here we'll paste
9:49 it and what answer we expect for this
9:52 particular query is the list of all the
9:56 nouns so we'll Define that under the
9:58 assistant
10:00 tag so I'll simply Define the output
10:04 over here we'll have to Simply write
10:06 list of values of the
10:09 nouns so first noun is our person
10:13 word then next we have the beach and the
10:17 sunset so you can see I have simply
10:19 defined the output in the format that I
10:22 want now by giving this particular
10:25 example the llm will properly understand
10:29 what exactly has to be done since it
10:32 contains only one single example it will
10:34 be called as onot prompting now let's
10:37 try to define a query and we'll pass on
10:40 the dynamic query next and let's check
10:43 whether the prompt has got improved and
10:45 the LM provides our expected answer or
10:49 not so let me write the query so here is
10:52 the example a child plays in the park
10:56 and laughs loudly so now let's let's try
10:59 to execute this particular
11:01 cell so now our prompt is ready let's
11:05 try to pass the prompt in the llm and
11:09 let's check what answer do we
11:13 get so let's
11:16 execute cool you can see over here now
11:19 we have got the list of noun in the form
11:22 of python list because we have defined
11:25 the
11:26 examples because of the example it
11:29 becomes more clear for it and it try to
11:32 follow every single instruction that you
11:34 provide it understands from that
11:37 particular example that what exactly is
11:39 the expectation so I hope this oneshot
11:42 prompting is clear to you all now let me
11:46 Define one more query over
11:48 here let me write a single letter A
11:51 since this particular query doesn't
11:53 contain any noun let's check whether it
11:57 returns an empty list
12:02 cool so you can see by simply providing
12:05 one single example it has
12:08 understood multiple scenarios multiple
12:11 things and of course by defining
12:13 examples your prompt becomes more
12:17 intelligent so this was one shot
12:20 prompting now in some use cases there
12:22 might be multiple scenarios that has to
12:24 be handled one single example won't
12:27 handle all the scenarios or all the test
12:30 cases so we can Define more than one
12:33 examples in that particular
12:35 case and the way of defining more
12:38 examples is the same as the as the
12:41 format that we have seen in onot
12:43 prompting we we just have to replicate
12:46 these things we just have to define the
12:48 user instruction and the assistant
12:51 output for that particular user
12:54 prompt let me show you one example let
12:57 me copy this
13:00 now we'll try to define a few short
13:04 prompt I'll simply copy this particular
13:07 two things user prompt and the assistant
13:11 prompt
13:12 example and then I'll simply paste that
13:17 cool now in this second
13:21 example I'll Define one more statement
13:25 over
13:27 here let's take this particular
13:38 statement now for this statement
13:40 obviously what output we have got you
13:43 might be
13:45 remembering the first noun is
13:48 child and the second noun is
13:53 bark so you can see we have defined two
13:55 examples the very first example was this
13:59 the output for that was this and the
14:02 second example is this the output for it
14:05 is this so this is how you can Define
14:09 more
14:10 examples by defining more examples you
14:13 can simply cover more number of cases so
14:16 that the llm will single-handedly handle
14:20 multiple scenarios and test cases but
14:23 make a note of a thing
14:26 that it's not like if you define
14:29 multiple examples your your llm will
14:32 understand it correctly no there is a
14:35 limit of setting the number of example
14:37 you will understand that by practice and
14:40 it differs in various use cases so
14:44 you'll have to try for multiple possible
14:46 cases of defining n number of examples
14:50 in your prompt and you will have to
14:53 understand it by checking each case that
14:55 what number of optimal examples your
14:58 prompt requires so that that it becomes
15:00 the most intelligent so I hope this
15:02 thing is
15:03 clear and this is what is called as few
15:07 shot prompting I hope the zero shot
15:11 prompting technique with one shot and
15:14 few shot prompting technique is also
15:17 clear to you all I have tried my level
15:19 best to cover each and every scenario of
15:22 explaining you about this particular
15:25 techniques I hope everything is clear in
15:29 the upcoming videos we'll be looking
15:30 into more interesting and complex
15:32 prompting techniques so stay tuned for
15:35 that for more such videos do like share
15:38 and subscribe to my channel also hit the
15:40 Bell icon and don't forget to follow me
15:42 on Instagram please join me on telegram
15:45 thanks for watching have a good day
15:47 ahead
15:55 [Music]
0:05 Xin chào mọi người, chào mừng các bạn trở lại với kênh YouTube của mình. Trong video đặc biệt này, chúng ta sẽ cùng tìm hiểu về zero-shot prompting (gợi ý không cần ví dụ), one-shot prompting (gợi ý một ví dụ) và few-shot prompting (gợi ý vài ví dụ). Đây đều là những kỹ thuật thuộc lĩnh vực prompt engineering (kỹ thuật gợi ý).
0:20 Đây là những kỹ thuật cơ bản mà bất kỳ ai học về kỹ thuật gợi ý cũng nên biết. Khi sử dụng chúng, chúng ta có thể dễ dàng xử lý nhiều tình huống liên quan đến định dạng phản hồi, cũng như cải thiện khả năng hiểu của các mô hình ngôn ngữ lớn.
0:40 Đầu tiên, chúng ta sẽ xem xét kỹ thuật zero-shot prompting. Vậy chính xác thì nó là gì? Hãy bắt đầu với định nghĩa. Đây là một loại kỹ thuật gợi ý, trong đó bạn không cung cấp bất kỳ ví dụ nào trong prompt. Tức là, không có ví dụ mẫu, mà chỉ có hướng dẫn.
1:03 Nếu bạn đã xem video trước đây của mình về nghệ thuật kỹ thuật gợi ý, trong đó mình đã hướng dẫn cách viết một prompt, thì mình đã đề cập đến ba thành phần chính: gợi ý hệ thống, gợi ý người dùng và gợi ý trợ lý.
1:18 Cả ba thành phần này đều có trong zero-shot prompting. Ở đây, chúng ta chỉ cung cấp các hướng dẫn để mô hình ngôn ngữ lớn tuân theo, cùng với các biến đầu vào mà chúng ta muốn đưa vào LLM.
1:33 Ví dụ, nếu mình muốn mô hình ngôn ngữ lớn tóm tắt một đoạn văn thành một câu duy nhất, thì trong phần hướng dẫn của prompt, mình chỉ cần viết: "Tóm tắt đoạn văn sau thành một câu duy nhất." Chỉ vậy thôi. Ở đây, chúng ta chỉ cung cấp hướng dẫn.
1:52 Chúng ta không đưa ra bất kỳ ví dụ nào. Ví dụ, mình không cần phải cung cấp một đoạn văn mẫu và cách tóm tắt nó thành một câu. Không có ví dụ nào cả. Hy vọng các bạn đã nắm được khái niệm cơ bản về zero-shot prompting.
2:11 Bây giờ, mình sẽ nói rõ mục tiêu của chúng ta. Chúng ta sẽ viết một prompt để lấy một truy vấn – có thể là một câu hoặc một đoạn văn – và mô hình ngôn ngữ lớn sẽ trích xuất tất cả các danh từ từ chuỗi đó. Kết quả sẽ trả về dưới dạng một danh sách.
2:32 Dù có bao nhiêu danh từ, nó sẽ trả về tất cả dưới dạng một danh sách. Bây giờ, chúng ta sẽ viết prompt cho việc này. Hiện tại, các bạn cứ bỏ qua đoạn code này. Hãy tập trung vào prompt này thôi. Trong phần "system", chúng ta sẽ viết hướng dẫn cho hệ thống: chính xác thì mô hình ngôn ngữ lớn phải hoạt động như thế nào.
2:52 Trong phần "user", chúng ta sẽ viết các đầu vào mà chúng ta sẽ cung cấp cho mô hình ngôn ngữ lớn. Chúng ta cũng có thể đưa ra hướng dẫn về định dạng đầu ra trong phần "user" hoặc "system", còn phần "assistant" thì chúng ta sẽ để trống.
3:23 Bây giờ, mình sẽ viết prompt cho tình huống này. "Bạn là một trợ lý thông minh. Bạn sẽ nhận được một chuỗi – có thể là một câu hoặc một đoạn văn. Nhiệm vụ của bạn là cung cấp một danh sách tất cả các danh từ có trong chuỗi đó."
4:00 Ở đây, chúng ta chỉ đơn giản xác định cách mô hình ngôn ngữ lớn nên hành động và mục tiêu của nó là gì. Tiếp theo, chúng ta sẽ viết prompt cho phần "user". Ở đây, chúng ta sẽ viết các đầu vào mà chúng ta sẽ cung cấp.
4:13 Chúng ta sẽ viết: "Đây là chuỗi đã cho. Vui lòng cung cấp một danh sách tất cả các danh từ, không kèm theo bất kỳ giải thích nào." Bây giờ, mình đã xác định prompt này. Hãy thử cung cấp một truy vấn đơn giản và xem nó trả về kết quả như thế nào.
4:54 Đây là truy vấn của chúng ta: "Một người đi bộ đến bãi biển và ngắm hoàng hôn." Hãy xem liệu chúng ta có nhận được danh sách các danh từ hay không. Chúng ta sẽ thực thi đoạn code này và sử dụng mô hình Lama 3.1 70 tỷ tham số từ Gro API.
5:12 Mình đã có một video hướng dẫn cách truy cập mô hình ngôn ngữ lớn bằng API suy luận Gro AI. Nếu bạn chưa xem, hãy tìm nó trong danh sách phát Gen trên kênh của mình nhé. Bây giờ, hãy thực thi ô này.
5:31 Đây là kết quả mà nó trả về. Nó đã cung cấp cho chúng ta danh sách các danh từ: người, bãi biển và hoàng hôn.
5:44 Và đúng vậy, hoàn toàn chính xác. Bây giờ, điều gì sẽ xảy ra nếu mình không cung cấp bất kỳ danh từ nào? Hãy thử với câu "a" và thực thi nó. Trong trường hợp này, nó trả về "không có".
6:02 Điều mình muốn là kết quả trả về phải ở dạng danh sách Python. Mình muốn nó trả về danh sách các danh từ như thế này. Để làm được điều này, mình cần cung cấp định dạng đầu ra.
6:17 Hoặc là mình có thể cung cấp định dạng đầu ra ở đây, hoặc là mình có thể sử dụng kỹ thuật few-shot prompting bằng cách cung cấp các ví dụ. Chúng ta có thể cung cấp hướng dẫn về định dạng đầu ra, hoặc là cung cấp các ví dụ few-shot.
6:33 Ngoài ra, chúng ta có thể xử lý trường hợp không có danh từ nào trong truy vấn. Trong trường hợp đó, nó sẽ trả về một danh sách trống, như thế này. Chúng ta có thể minh họa điều này bằng một ví dụ, hoặc là xác định các hướng dẫn về định dạng đầu ra.
6:50 Trong một số trường hợp, việc sử dụng các ví dụ few-shot sẽ mang lại kết quả chính xác hơn. Bây giờ, trong trường hợp này, chúng ta sẽ thử giải quyết vấn đề bằng kỹ thuật one-shot prompting.
7:08 Đầu tiên, mình sẽ giải quyết vấn đề lấy danh sách các danh từ ở định dạng danh sách Python. Nếu mình cung cấp truy vấn này, nó sẽ trả về kết quả ở dạng danh sách Python, một danh sách các chuỗi: người, bãi biển và hoàng hôn. Bây giờ, hãy thử viết một prompt.
7:30 Chúng ta sẽ thêm một vài ví dụ vào đây. Trong trường hợp này, chúng ta sẽ chỉ cung cấp một ví dụ duy nhất, vì vậy đây là kỹ thuật one-shot prompting. Đây là mẫu của nó.
7:42 Kỹ thuật one-shot prompting bao gồm một ví dụ duy nhất. Về cơ bản, cho đến phần gợi ý hệ thống, người dùng và trợ lý, nó sẽ giống hệt như zero-shot prompting. Nhưng vì chúng ta sẽ cung cấp một ví dụ, chúng ta sẽ thêm vào phần "user" và "assistant".
8:00 Tại sao? Bởi vì chúng ta sẽ cung cấp một câu hỏi mẫu của người dùng và một câu trả lời mẫu của trợ lý. Được rồi, ở đây bạn có thể thấy chúng ta có gợi ý hệ thống, sau đó là gợi ý người dùng, rồi đến gợi ý trợ lý.
8:16 Đến đây, bạn có thể thấy nó giống như kỹ thuật zero-shot prompting. Chúng ta đã thêm hai phần này, đó là gợi ý người dùng và gợi ý trợ lý. Tại sao chúng ta làm điều này? Bởi vì chúng ta sẽ xác định một ví dụ, bao gồm một câu hỏi mẫu của người dùng và một câu trả lời mẫu cho câu hỏi đó.
8:40 Vì vậy, chúng ta đã thêm phần gợi ý người dùng và gợi ý trợ lý. Mình sẽ sao chép phần gợi ý hệ thống mà chúng ta đã xác định trước đó, và sau đó chúng ta sẽ dành riêng phần "user" và "assistant" cho ví dụ của chúng ta.
9:02 Trong phần "user", mình sẽ dán những thứ từ prompt trước đó, như "Đây là chuỗi đã cho," và chúng ta đang chuyển truy vấn động ở đây, "vui lòng cung cấp một danh sách tất cả các danh từ mà không có bất kỳ giải thích nào." Điều này đã được xác định trong prompt trước đó của chúng ta.
9:20 Bây giờ, chúng ta sẽ xác định một ví dụ truy vấn người dùng mẫu. Mình sẽ dán cùng một thứ ở đây, nhưng thay vì truy vấn động, chúng ta sẽ xác định một ví dụ tĩnh.
9:39 Hãy lấy cùng một ví dụ ở đây. Chúng ta sẽ sao chép cái này và dán nó vào đây. Câu trả lời chúng ta mong đợi cho truy vấn này là danh sách tất cả các danh từ. Vì vậy, chúng ta sẽ xác định điều đó trong phần "assistant".
10:00 Mình sẽ xác định đầu ra ở đây. Chúng ta sẽ viết danh sách các giá trị của các danh từ. Danh từ đầu tiên là "người", sau đó là "bãi biển" và "hoàng hôn".
10:17 Bạn có thể thấy mình đã xác định đầu ra ở định dạng mà mình muốn. Bằng cách đưa ra ví dụ này, LLM sẽ hiểu đúng những gì cần phải thực hiện.
10:29 Vì nó chỉ chứa một ví dụ duy nhất, nó được gọi là one-shot prompting. Bây giờ, hãy xác định một truy vấn và chúng ta sẽ chuyển truy vấn động tiếp theo và kiểm tra xem prompt đã được cải thiện và LM cung cấp câu trả lời mong đợi của chúng ta hay không.
10:49 Mình sẽ viết truy vấn. Ví dụ: "Một đứa trẻ chơi trong công viên và cười lớn." Bây giờ, hãy thực thi ô này. Prompt của chúng ta đã sẵn sàng. Hãy chuyển prompt này vào LLM và xem chúng ta nhận được câu trả lời gì.
11:13 Hãy thực thi. Tuyệt vời! Bạn có thể thấy bây giờ chúng ta đã có danh sách danh từ ở dạng danh sách Python vì chúng ta đã xác định các ví dụ.
11:26 Nhờ có ví dụ, mọi thứ trở nên rõ ràng hơn và nó cố gắng tuân theo mọi hướng dẫn mà bạn cung cấp. Nó hiểu từ ví dụ đó chính xác những gì được mong đợi.
11:39 Mình hy vọng one-shot prompting này đã rõ ràng với tất cả các bạn. Bây giờ, mình sẽ xác định thêm một truy vấn ở đây. Hãy viết một chữ cái duy nhất "A".
11:51 Vì truy vấn này không chứa bất kỳ danh từ nào, hãy kiểm tra xem nó có trả về một danh sách trống hay không. Tuyệt vời! Bạn có thể thấy bằng cách chỉ cung cấp một ví dụ duy nhất, nó đã hiểu nhiều tình huống, nhiều điều, và tất nhiên, bằng cách xác định các ví dụ, prompt của bạn trở nên thông minh hơn.
12:17 Đây là one-shot prompting. Trong một số trường hợp, có thể có nhiều tình huống cần phải xử lý. Một ví dụ duy nhất sẽ không xử lý được tất cả các tình huống hoặc trường hợp thử nghiệm, vì vậy chúng ta có thể xác định nhiều hơn một ví dụ trong trường hợp đó.
12:35 Cách xác định nhiều ví dụ hơn cũng giống như định dạng mà chúng ta đã thấy trong one-shot prompting. Chúng ta chỉ cần sao chép những thứ này. Chúng ta chỉ cần xác định hướng dẫn của người dùng và đầu ra của trợ lý cho gợi ý cụ thể đó của người dùng.
12:54 Mình sẽ cho bạn xem một ví dụ. Hãy sao chép cái này. Bây giờ, chúng ta sẽ cố gắng xác định một prompt few-shot. Mình sẽ sao chép hai phần này: gợi ý người dùng và ví dụ gợi ý trợ lý, và sau đó mình sẽ dán nó vào.
13:17 Tuyệt vời! Bây giờ, trong ví dụ thứ hai này, mình sẽ xác định thêm một câu ở đây. Hãy lấy câu này. Bây giờ, đối với câu này, rõ ràng, đầu ra chúng ta đã nhận được là gì, bạn có thể nhớ.
13:45 Danh từ đầu tiên là "trẻ em" và danh từ thứ hai là "công viên". Bạn có thể thấy chúng ta đã xác định hai ví dụ. Ví dụ đầu tiên là cái này, đầu ra cho nó là cái này, và ví dụ thứ hai là cái này, đầu ra cho nó là cái này.
14:05 Đây là cách bạn có thể xác định nhiều ví dụ hơn. Bằng cách xác định nhiều ví dụ hơn, bạn có thể bao gồm nhiều trường hợp hơn để LLM có thể xử lý nhiều tình huống và trường hợp thử nghiệm hơn.
14:23 Tuy nhiên, cần lưu ý rằng không phải cứ xác định nhiều ví dụ thì LLM sẽ hiểu chính xác. Không, có một giới hạn về số lượng ví dụ bạn có thể đưa vào.
14:37 Bạn sẽ hiểu rõ điều này thông qua thực hành, và nó khác nhau tùy theo từng trường hợp sử dụng. Bạn cần thử nghiệm với nhiều trường hợp khác nhau, xác định số lượng ví dụ (n) trong prompt của bạn, và kiểm tra từng trường hợp để tìm ra số lượng ví dụ tối ưu mà prompt của bạn cần để đạt được hiệu quả tốt nhất.
15:02 Hy vọng điều này đã rõ ràng, và đây chính là few-shot prompting. Mình hy vọng kỹ thuật zero-shot prompting, one-shot prompting và few-shot prompting đều đã rõ ràng với các bạn.
15:17 Mình đã cố gắng hết sức để bao gồm mọi khía cạnh và giải thích cho các bạn về những kỹ thuật này. Hy vọng mọi thứ đều dễ hiểu. Trong các video sắp tới, chúng ta sẽ xem xét các kỹ thuật gợi ý phức tạp và thú vị hơn.
15:32 Vì vậy, hãy theo dõi nhé. Để xem thêm nhiều video như vậy, hãy like, chia sẻ và đăng ký kênh của mình. Đừng quên nhấn vào biểu tượng chuông và theo dõi mình trên Instagram. Hãy tham gia cùng mình trên Telegram nữa nhé.
15:45 Cảm ơn các bạn đã xem. Chúc các bạn một ngày tốt lành!
Translated At: 2025-03-03T02:12:09Z
Translate Version: 3.1 Improved translation step with full context