Prompt engineering

Definition

Prompt engineering is the practice of writing and testing instructions for a language model so that it reliably returns the required result in the required format. A good prompt sets the role, goal, context, examples, constraints and output format, and the team keeps prompts under version control and checks every change against a set of real examples.

Free to quote with a link to initask.com · Author: Vitalii Miniailo · Updated:

Key traits

Prompt engineering
01
Role and goal
02
Context and examples
03
Output format
04
Test set
Prompt engineering
01
Role and goal
02
Context and examples
03
Output format
04
Test set

Role and goal

The model knows its role in the task and what a finished result looks like.

Context and examples

Data, company rules and 2-3 samples of a good answer right in the prompt.

Output format

A table, JSON or email template that a system or a person reads next.

Test set

Every prompt change runs against the same test examples.

Comparison

CriterionPrompt engineeringFine-tuningRAG
What changesThe instruction to the modelThe model's weightsThe data the model gets per request
SpeedHoursWeeksDays
CostMinimalHigh: data, compute, rerunsMedium: index and search
When to useFormat, tone, order of actionsA fixed style or narrow task at high volumeAnswers from company documents

What changes

Prompt engineering
The instruction to the model
Fine-tuning
The model's weights
RAG
The data the model gets per request

Speed

Prompt engineering
Hours
Fine-tuning
Weeks
RAG
Days

Cost

Prompt engineering
Minimal
Fine-tuning
High: data, compute, reruns
RAG
Medium: index and search

When to use

Prompt engineering
Format, tone, order of actions
Fine-tuning
A fixed style or narrow task at high volume
RAG
Answers from company documents

How to implement

  1. Describe the task and the definition of done in one paragraph.
  2. Collect 10-20 real inputs with correct answers.
  3. Write the prompt: role, goal, context, constraints, format, examples.
  4. Run the set, review failures and change the prompt one edit at a time.
  5. Version prompts and rerun the set whenever you switch models.

Common mistakes

  • Writing prompts without examples and getting inconsistent answers.
  • Changing several things at once and losing track of what helped.
  • Testing on one lucky example instead of a set.
  • Keeping prompts in employees' chats with no versions or owner.

Questions and answers

Do we need a dedicated prompt engineer?

For a few processes, a process expert and a developer can own prompts and the test set together. A dedicated role makes sense once you run dozens of agents.

Will a prompt work with another model?

Mostly yes, with differences in detail. When switching models, rerun the same test set and adjust the prompt to the results.

Where can I find ready-made business prompts?

A prompt library gives a starting point; then adapt the prompt to your data and test it on your own examples.