Prompt Engineering
The ability to formulate requests so that the model provides an accurate, useful, and predictable response.
What is it?
A prompt is not a "question", but an instruction. A good prompt describes:
- who you are;
- what needs to be done;
- in what format;
- what cannot be done.
Basic Formula
Role + Context + Task + Format + Constraints
Example:
You are a technical editor.
Write an explanation of the term "token".
Format: a short paragraph and one example.
Do not use complex formulas.
Main Principles
- Give a role — "You are an experienced Python developer".
- Add context — "I am writing for beginners".
- Specify the format — "In a list of 5 points".
- Show examples — few-shot.
- Limit unnecessary things — "Do not make up facts".
Related Techniques
- Chain-of-Thought — step-by-step reasoning;
- Few-shot prompting — examples in the prompt;
- Prompt Chaining — chain of prompts;
- Prompt Templates — ready-made templates.