Day 24 - Prompting Techniques - Zero Shots
Prompting techniques
LLMs are tuned to follow instructions and are trained on large amounts of data so they can understand a prompt and generate an answer. But LLMs aren’t perfect; the clearer your prompt text, the better it is for the LLM to predict the next likely text. Additionally, specific techniques that take advantage of how LLMs are trained and how LLMs work will help you get the relevant results from LLMs.
General Prompting / zero shot
A Zero-shot prompt is the simplest type of prompt. It only provides a description of a task and some text for the LLM to get started with. This input could be anything: a question, a start of a story, or instructions. The name zero-shot stands for 'no examples'.
An example of zero-shot-prompting
- Name: 1-1-movie_classification
- Goal: Classify movie reviews as positive, neutral, or negative.
- Model: gemini-pro
- Temperature: 0.1
- Token Limit: 5
- Top-K: N/A
- Top-P: 1
- Prompt:
Classify movie reviews as POSITIVE, NEUTRAL, or NEGATIVE.
Review: "Her" is a disturbing study revealing the direction
humanity is headed if AI is allowed to keep evolving,
unchecked. I wish there were more movies like this masterpiece.
Sentiment:- Output:
POSITIVE
When zero-shot doesn't work, you can provide demonstrations or examples in the prompt, which leads to "one-shot" and "few-shot" prompting.