English
Share
Sign In
🙌

Few-Shot Prompts: Improving LLM Performance through Examples

F ew-Shot Prompting is a way to instruct a large-scale language model (LLM) to perform a complex task. This technique refers to the process of 'training' a model to respond more accurately by including several examples within the prompt .
Short-shot prompt → Few-shot prompt
We learned about short prompts earlier. Few-Shot Prompting involves giving a few examples of what you want to do.
These examples will help you understand and generate the kind of response you want your model to provide.
This technique is especially effective the larger the model.
The attached video is a very interesting example showing this. By telling the child several times false information, such as “If you raise your hand, you are sleeping, and if you lower your hand, you are awake,” you are trying to make the child recognize that he is pretending to sleep and at the same time keep his hand up.
By understanding and utilizing the concept of Few-Shot Prompting in this way, you can use artificial intelligence language models more effectively and obtain meaningful answers in a variety of situations.
From the child's point of view, if he puts his hand down, he will be found out that he is awake, so he keeps his hand up no matter what to pretend to be sleeping.
So how can this be used in artificial intelligence? We've heard this before, more than you think.
The comical answer referred to as King Sejong's MacBook throwing incident is, in a way, a technique of few-shot prompting. Things like King Sejong's MacBook throwing or Admiral Yi Sun-sin's lighting bolt are now clichés, so let's go a little further back in time.
Of course, nothing like this exists. Goguryeo, Sui Dynasty, Eulji Mundeok, and Battle of Salsu are words that actually exist, and high-output hydraulic jets are also items that exist, but it is a technology that could not have existed in the northern part of the Korean Peninsula in the 7th century when Eulji Mundeok was active. But our artificial intelligence answers like this.
🤖
Salsu Battle (Salsu Daejeon) is one of the historical battles between Goguryeo and Sui Dynasty, in which Goguryeo's famous general Eulji Mundeok played an important role. This battle ended with the defeat of the Sui Dynasty army and the victory of Goguryeo, and Eulji Mundeok's outstanding strategy and scientific and technological inventions played a large role.
At the time of the Battle of Salsu, Eulji Mundeok was active as a military leader of Goguryeo. In this battle, Eulji Mundeok used innovative strategies and scientific and technological inventions to lead Goguryeo to victory against the great army of the Sui Dynasty.
One notable technological invention is the “high-power hydraulic jet.” This ejector is a device that uses water pressure to spread water over a long distance, allowing it to inflict powerful water attacks on enemies. Eulji Mundeok used this jet to attack the enemy by spraying water, and this technical device played an important role in the Battle of Salsu.
At the Battle of Salsu, Goguryeo defeated the Sui army under the leadership of Eulji Mundeok and won. This is remembered as one of the events that represents Goguryeo's military capabilities and Eulji Mundeok's strategy and technical capabilities, and is one of the important battles in the history of the Korean Peninsula.
We can laugh it off, but to some, this is a serious problem.
Example of Few-Shot Prompt
Example: Let's say you ask an artificial intelligence (AI) to write a 'kind email to a friend'. Few-Shot Prompting shows the AI ​​2-3 examples of how to write an email.
Result: AI creates friendly, natural emails based on these examples.
In the video above, the mother and father slowly explain and tell the child that if they repeatedly put their hand down, the child will wake up.
Pros and Cons of Few-Shot Prompting
Advantages:
Flexibility: Enables AI to perform a variety of tasks quickly and flexibly.
Learning efficiency: Given just a few examples, AI can learn how to perform a specific task.
Disadvantage:
Limitations: Performance may be limited in tasks that require complex reasoning or knowledge.
Accuracy Issues: Sometimes AI can misunderstand or react in unexpected ways.
Of course, Few-Shot Prompting shows more effective performance than Zero-shot and One-shot. To some extent, it can achieve performance that allows an ordinary model to catch up with what we commonly call the highest performance model (SOTA).
This also means that those who are good at handling prompts can produce good results even by using the free version of GPT-3.5. (Of course, if you go to the inference level, this also has clear limitations.)
0️⃣
⛓️
ⓒ 2023. Haebom, all rights reserved.
The source is indicated and may be used for commercial purposes with the permission of the copyright holder.