Zero shot vs multi shot prompting?

One way to build classifiers in past was to provide a large number of examples to the model and let model train through some kind of training algorithm. Such training is complex and time consuming.
Large language models are massive and have learned a lot of patterns. This can be leveraged to simplify the process of training a new model. Instead of training a new model from scratch, you can give a LLM some examples on the fly and the model is able to learn the patterns from those few examples. The speed comes from the fact that LLMs are trained on massive amount of data and have learned the “meta skill” of learning from patterns.
Given these examples
Jon,13 to { "name": "Jon", "age":12 }
Emma,9 to { "name": "Emma", "age":9 }
Convert
Roger, 14
Nearly any LLM today can learn from this and give you the following answer.
{ "name": "Roger", "age": 14 }
Doing the same with traditional models would be reasonably hard for open ended json parsing.
Even though example of multi-shot prompting here is simplistic this works pretty well even for more complex systems including cases were humans themselves might not be able to see the real conversion logic.
Models like Gemini can support upto 1M tokens. This is a very large context window and allows for many multi-shot examples.
Zero-shot learning and few-shot learning represent two ends of the spectrum in LLM optimization. Zero-shot learning operates purely on the general knowledge acquired during pre-training, requiring no additional task-specific data. While this approach is advantageous for its efficiency and simplicity, it often struggles with tasks that require a nuanced understanding of domain-specific information. [source]
Zero shot prompting relies only on the the embedded logic of the LLM. It is not necessarily the bad idea to rely on the embedded logic of the LLM. Since LLMs have been trained on lot of existing data, they might be better than your examples to generate certain type of outputs.
Can you generate shells command to find the string "foo"
and replace it with "bar" everywhere in a text file ?
Output:
sed -i 's/foo/bar/g' your_file.txt
Or translation
Convert “hello” to Spanish.
Zero shot is applicable when you don’t actually have examples to provide nor you want your model to be constrained by any specific examples.
Applying few shot prompting in real world applications
One great way to apply few shot prompting in real world is customer success scenarios. Given 1000 examples of last resolves customer complains, can we predict what might be the solution to the incoming customer complaint or can we match the customer with the right service representative ?
Note that choice of examples in few shot is of paramount importance. If you give wrong and irrelevant examples your precision and recall goes down. So you need to carefully design your prompts.
Another example is e-commerce product recommendations. Last 1000 customers’s purchases looked like this. If a person has following 10 items in his cart recommend another product they should add to their cart.
Historically we used collaborative filtering to solve such recommendation problems.
References:




