We use analytics cookies.We use cookies to analyze site traffic and improve your experience.
Loading...
AI Engineering · Prompting
Free preview: the first 2 parts of this 20-part lesson.
Already bought the course? Sign in to read the whole lesson.
this lesson is part of
Generative AI and Agentic AI Engineering
Unlock this lesson and the 208 other paid lessons
$35 once, by PayPal
See the Generative AI and Agentic AI courseread the rest of this lesson in
Generative AI and Agentic AI Engineering
Unlock this lesson and the 208 other paid lessons
$35 once, by PayPal
See the Generative AI and Agentic AI coursein Prompting
This lesson is part of the AI Engineering course. Unlock the full course, a separate one-time payment, for lifetime access.
One-time payment by card or PayPal
Get Lifetime AccessOne-time payment: UPI, card or netbanking
Get Lifetime AccessFoundation lessons of this course are free, no payment needed. Try them now
When a new colleague joins a team, you can explain the job in words, or you can work next to them through a few real cases together. Most people learn faster from the cases. The words say what to do; the cases show what "done" looks like, including all the small details nobody thought to write down.
A language model can be taught the same way inside a prompt. Before the real question, you include a few finished cases: a message, then its right answer, written in exactly the form you want back. These are called examples, and a prompt that contains them is often called a few-shot prompt.

Lesson 1 added two examples to a prompt that was already perfect, so it could not tell whether they helped. This lesson tests examples properly, on a prompt that still makes mistakes, and on two models. It asks three questions: does adding examples help, does it matter which ones you choose, and does it matter what order they are in?

Example. One finished case inside the prompt: a message, then the answer you would want for it, written in the same format you want the model to use.
Zero-shot. A prompt with no examples at all, only the instruction. In this field a "shot" means one example.
Few-shot. A prompt with a handful of examples, often one to five.
Order. Which example comes first in the prompt and which comes last, just before the real question.
Choice. Which messages you picked to be the examples. Two sets can cover the same categories and still be quite different messages.
One more idea from earlier lessons matters here: the model does not learn anything permanent from the examples. It only reads them, as part of the text of this one request, and they change which next token is most likely. Remove them from the next request and they are gone.