Prompting Flashcards
Fine Tuning
Prompt Engineering
Crafting an input prompt. Trial-and-error process. Helps define which training data should be used to formulate the response.
Key Elements of Context
- Persona/Role
- Purpose
- Clear/Precise
- Concise
- Specific
- Details
- Examples
Persona / Role
Works best when:
* Quality of answer is subjective.
* You’re trying to emulate a specific style.
Purpose
Define the purpose of the prompt:
* Tone, e.g., funny, professional, casual?
* Format: paragraph, bulleted list, essay, code, etc.
* Audience: who is this for?
Clarity / Precision
Get rid of unnecessary information, jargon, confusing phrases, or mistakes.
They can lead AI down the wrong path.
Conciseness
Less words –> less tokens –> less cost.
Chain of Thought Prompting
Request AI show its thought process (or provide the thought process in the prompt) as it solves a given problem. This technique forces an AI to reason about a problem and solve it in a way a person would, by breaking it down and solving it step-by-step. Also, by asking the AI to show us its thought process, we can identify where something went wrong if the AI were to give an incorrect answer. Use “show me your thought process” or something similar in the prompt.
Use Cases for Chain of Thought Prompting
- solving multi-step/complex problems requiring logical reasoning
- addressing tasks that require logical deduction
- solving mathematical or analytical challenges
- explaining complex concepts or processes
Complex Tasks
Avoid making assumptions. Instead, break down complex tasks into simple sub-problems with a logical order and relationships.
- Improves understanding: allows AI to focus on one task at a time, reducing the thought processing required and increasing accuracy.
- Reduces errors: the step-by-step nature of this technique facilitates error detection and correction during task execution.
- Better accuracy: clear instructions for each subtask ensure the AI applies appropriate logic and principles, improving overall accuracy.
- Better logical flow: A structured, step-by-step approach maintains a coherent and understandable flow in problem-solving.
Iteration
Trying multiple prompts until you get an adequate response.
Specificity
Include specific limitations or requirements. However, avoid too much information as it may confuse the AI or cause it to focus on less important aspects of your request.
Details & Context
Include any details essential to understanding the request, such as historical context or related concepts.
Example: lines of code and error message.
Examples
Adding examples clarifies what you mean and gives the AI a baseline to work from.
Types of Prompting
- Zero Shot
- One Shot
- Few-Shot
Zero-Shot Prompting
No examples provided. Use for simple tasks where answer is straightforward.