Prompt Engineering: Techniques, Examples & Test Results (2026)
Seven prompt engineering techniques tested on 18 real responses. A good prompt raised Claude Sonnet 5.5 from 12 to 30 points, and small Gemma 4 beat flagship Claude.

👁 119 reads
Prompt engineering is writing instructions for AI models so the output is predictable and ready to use right away. In practice, it comes down to seven techniques: role, context, examples, output format, steps, constraints, and iteration. In our test of 18 real responses, a good prompt raised Claude Sonnet 5.5’s score from 12 to 30 points out of 30, and the small open-source Gemma 4 with a good prompt (27 points) outperformed flagship Claude with a bad one (12 points).
As of October 4, 2026
- Our test: 3 tasks × 3 prompt versions (bad, average, good) × 2 models = 18 responses via OpenRouter.
- Models: anthropic/claude-sonnet-5.5 (flagship, $2/$10 per million tokens) and google/gemma-4-31b-it (open-source, $0.09/$0.34).
- Total test cost: $0.076, of which Gemma cost $0.0018.
- Technical principles verified in current documentation from OpenAI, Anthropic and Google (links at the end).
- Change in 2026: reasoning models (GPT-6, Claude 5.5, Gemini 3.8) plan steps themselves, so “think step by step” gives less than before. Context and format give the same benefit as always.
What is prompt engineering
A prompt is the instruction you type into ChatGPT, Claude or Gemini. Prompt engineering is the skill of structuring these instructions so the model doesn’t have to guess: it knows what role to take, who it’s writing for, what exactly to deliver, and what to avoid. You’ll find a one-paragraph definition in the AI glossary, and basics with examples of checking results in the text How to write prompts.
Documentation from the three largest companies says essentially the same thing. Anthropic advises treating the model like “a smart new employee without context,” OpenAI divides instructions into identity, rules, examples and context, and Google recommends clear instructions, examples and breaking complex tasks into steps. Differences are in details - for example, Claude responds well to XML tags, which we cover in the text about system prompts for Claude.
How to write a good prompt in 5 steps
- Start with the goal: what should be created and what you’ll use it for (email to a client, table for Excel, 10-day plan).
- Add context: facts the model doesn’t know: dates, names, amounts, the situation.
- Specify format: length, structure, table columns, level of formality.
- List constraints: what not to do, what to do when data is missing.
- Check the result and improve the prompt, not just the response. Save good prompts as templates.
Techniques with examples
1. Role
One sentence that sets perspective and vocabulary. Just “you are an expert” gives little. A specific role tied to the task works.
You are an accountant who explains regulations to small business owners without jargon. Explain the difference between flat tax and progressive tax.
2. Context
The biggest difference in our test. The model doesn’t know that a client printed flyers with a date you can’t meet. If you don’t write this, the email will be generic.
Context: the store was supposed to launch October 15, new date is October 29. The delay is our fault. The client already printed flyers with the old date.
3. Examples (few-shot)
One or several examples show format better than description. Anthropic recommends several clearly different examples so the model doesn’t copy an accidental pattern.
Example row: | Order trade show banners | Ola | 2026-11-03 | $1200 |
4. Output format
Say what the response should look like: table with columns, list, JSON, maximum 150 words, email subject in first line. This is the technique that most often saves time on corrections.
5. Steps and reasoning
For complex tasks, break the instruction into stages or ask for a plan before execution. In 2026 reasoning models, you no longer need to write “think step by step” because the model does it automatically. Better to describe what it should check before delivering results. Why old tricks stopped working is covered in the text Prompt engineering in 2026.
6. Constraints
Write what the model should not do and what to do when data is missing. The sentence “if there’s no deadline in the text, write ‘none’, don’t guess” is the simplest protection against fabrication. More on this in our test of AI hallucinations on 10 traps.
7. Iteration
Iterating a prompt means improving the instruction based on results. Instead of writing “fix this,” add the missing information to the prompt and run it again. After 2-3 rounds you have a template that works every time.
Techniques table
| Technique | When to use | Prompt fragment | Note |
|---|---|---|---|
| Role | Texts for specific audience | “You are a project manager at a small agency” | Generic “expert” gives little |
| Context | Whenever model doesn’t know facts | “Client printed flyers with date 10/15” | Biggest gain in our test |
| Few-shot | Repeatable format, style, classification | “Example row: …” | Examples should differ |
| Output format | Tables, data for Excel, emails | “Return only Markdown table” | Shortens response and time |
| Steps | Analysis, plans, code | “First list assumptions, then plan” | Reasoning models do this themselves |
| Constraints | Data extraction, facts | “Don’t guess, write ‘none'” | Cheapest defense against hallucinations |
| Iteration | Any template used multiple times | Adding missing information | Improve prompt, not response |
Our test: bad, average and good prompts on 2 models
We checked how much a good prompt actually delivers. We took three everyday work tasks, wrote three versions of instructions for each, and sent them to Claude Sonnet 5.5 and Gemma 4 31B. We scored each of 18 responses on 5 criteria at 0-2 points (maximum 10 per task, 30 per model). We tested in Polish.
Task 1: email to client about delay
- Bad:
Write an email to the client that the project will be delayed. - Average:
Write a polite, professional email to the client (Anna Kowalska, company Ogrody Kowalscy) that launching her online store will be delayed by 2 weeks. Brief. - Good:
You are a project manager at a small web agency Studio Kadr. Write an email to the client. Context: - Client: Anna Kowalska, company Ogrody Kowalscy (plant seedling store). - Store was supposed to launch October 15, 2026, new date is October 29, 2026. - Reason: payment gateway integration requires fixes on our end (our fault). - Client already printed flyers with October 15 date. Goal: maintain trust and provide concrete plan. Requirements: - Propose compensation: first month hosting free and free stickers with new date for flyers. - Provide two plan steps with dates: payment test October 22, client acceptance October 27. - Apologize once, without explaining in technical jargon. - Formal tone, warm and businesslike, maximum 150 words. Format: first line "Subject: ...", then email body, signature "Piotr Nowak, Studio Kadr". No brackets to fill in.
With the bad prompt, both models returned templates with brackets. Claude:
Dear [First and Last Name], I inform you that implementation of project [project name] will be delayed. Instead of the planned deadline [original date] we expect completion on [new date].
Gemma wrote 500 words: three email variants and “golden tips.” With the good prompt, Claude returned an email ready to send (129 words):
I’m writing to inform you that we’re moving the Ogrody Kowalscy store launch from October 15 to October 29, 2026. Payments still require fixes on our end and we take responsibility for this.
Gemma also stuck to facts, but started awkwardly, as if asking for permission: “I’m requesting to move the store launch date to October 29, 2026.”
Task 2: extracting tasks from notes
We pasted meeting notes from a tea shop (150 words, 5 tasks: Instagram posts by 10/14, Earl Grey order for $1800 by 10/9, product descriptions without person, contest with $500 budget without date, September returns without date). Bad prompt: Summarize this: [notes]. Average: List tasks from these meeting notes: [notes]. Good:
Extract all tasks to complete from the meeting notes. Return only a Markdown table with columns: Task | Person | Deadline (YYYY-MM-DD) | Amount. Rules: - One task = one row. - If notes don't have person, deadline or amount, write "none". Don't guess and don't calculate dates not in the text. - Don't add tasks not in the notes. Example row: | Order trade show banners | Ola | 2026-11-03 | $1200 | Notes: """ [notes] """
Honestly: the bad prompt worked almost as well. Claude in the “summary” caught all tasks, deadlines and amounts itself (9/10). The good prompt primarily gave repeatable format: both responses were identical 5-row tables, ready to paste into a spreadsheet:
| Place Earl Grey tea order with wholesaler | Ewa | 2026-10-09 | $1800 |
| Fix product descriptions in store (add brewing temperature) | none | none | none |
Task 3: study plan for driver’s license exam
Bad: Make a study plan for driver's license. Average: Make a study plan for category B driver's license theory exam for 10 days, in a table. Good:
I have 10 days until the category B driver's license theory exam and only 45 minutes daily because I work. I'm weakest on questions about right-of-way at intersections and first aid. Create a plan in Markdown table: Day | Topic | Minutes | How I'll check progress. Rules: - Each day is exactly 45 minutes (if a day has multiple blocks, list them in one cell, e.g. "30 + 15"). - Right-of-way and first aid should get at least 1/3 of total time combined. - Day 9 is full practice exam, day 10 is only review of questions I got wrong. - No introduction and no general advice below the table. - Don't state number of questions or passing threshold if you're not certain of current rules.
With the bad prompt, Claude wrote out an entire course from medical exams and driver candidate profile and cut off at the 1800 token limit. This isn’t the model’s fault: the instruction didn’t say it was about 10 days and 45 minutes. With the average prompt, Gemma gave a wrong fact (“full tests (30 questions)” when the exam has 32 questions) and assumed 2-4 hours of daily study. With the good prompt, Claude met all conditions, and right-of-way and first aid got 270 of 450 minutes:
| 1 | Right-of-way: equal intersections and right-hand rule + right-of-way: signs A-7, B-20, D-1 | 30 + 15 | I’ll solve 15 right-of-way questions; goal: min. 70% correct. |
Results, time and cost
| Task | Claude bad | Claude average | Claude good | Gemma bad | Gemma average | Gemma good |
|---|---|---|---|---|---|---|
| Client email | 2 | 5 | 10 | 1 | 3 | 8 |
| Notes extraction | 9 | 10 | 10 | 8 | 9 | 10 |
| Study plan | 1 | 5 | 10 | 0 | 3 | 9 |
| Total (out of 30) | 12 | 20 | 30 | 9 | 15 | 27 |
| Time (3 tasks) | 26.7 s | 20.3 s | 18.1 s | 69.5 s | 42.2 s | 16.8 s |
| Words in responses | 778 | 656 | 561 | 1107 | 671 | 357 |
| Cost (3 tasks) | $0.0297 | $0.0234 | $0.0211 | $0.0009 | $0.0006 | $0.0004 |
Scoring criteria (each 0-2 points):
- Email: specific new date, simple reason taking blame, compensation or plan with dates, formal tone, ready to send without brackets.
- Extraction: all 5 tasks, correct people, correct deadlines without guessing, amounts with proper tasks, format without fabrications.
- Plan: 10-day table, 45 minutes daily, at least 1/3 time on weak topics, practice exam on day 9 and error review on day 10, concrete without wrong facts.
Conclusions from the test:
- Good prompts gave both models +18 points versus bad ones. The gain was identical for expensive and cheap models.
- Cheap model with good prompt beat expensive with bad: 27 to 12 points, at cost of $0.0004 versus $0.0297.
- Good prompts were also faster and shorter. Responses had 28% (Claude) and 68% (Gemma) fewer words than with bad instructions, because the model didn’t have to guess and add variants.
- For simple text tasks the difference is small. Extraction with bad prompt gave 8-9 points. Prompt engineering delivers most where the model needs to know facts from your situation.
Exercises for you
- Take the last email you wrote with AI help. Add three facts to the prompt that the model didn’t know, and compare results.
- Paste meeting notes into chat and ask for a table “Task | Person | Deadline”. Then add the rule “if data is missing, write ‘none'” and check if guessed dates disappeared.
- Write a prompt with one example (few-shot) to convert 5 product names into descriptions in one style. Then add a second, clearly different example and see what changes.
- Ask the same question without constraints and with length constraint “maximum 80 words”. Count how much information remained.
- Save the best prompt as a template with fields in square brackets and use it three times in different situations. Improve it after each use.
Further reading
- Prompt engineering in 2026 - complete guide - each technique explained in depth.
- How to write a good prompt - 10 rules.
- How to write prompts for Gemini and 25 prompts for Claude Opus 5.5.
- Prompts and AI workflow for solo businesses.
- Prompt Laboratory - our model tests on real tasks.
Frequently asked questions
What is prompt engineering?
It’s the skill of writing instructions for AI models so they give predictable and useful results. It includes choosing role, context, examples, response format and constraints, and improving prompts based on results.
How to write prompts?
Start with the goal, add facts the model doesn’t know, specify format and response length, list what the model should not do, and improve the prompt after the first result. In our test, context and format alone changed an email from a template with brackets to a message ready to send.
What does iterating a prompt mean?
It’s improving the instruction in successive rounds: you check the result, determine what was missing, add it to the prompt and run it again. The goal is a template that works without corrections, not one good response.
What is a system prompt?
It’s a permanent instruction set before conversation, for example in ChatGPT settings, in Claude projects, or in API. It contains role, style and rules that apply to every response. You enter the specific task and its data in the regular message.
What is few-shot prompting?
It’s giving the model several examples of expected output in the prompt itself. The model mimics their format and style. Zero-shot means prompt without examples, one-shot with one example.
Does prompt engineering make sense in 2026?
Yes, but the center of gravity has shifted. Tricks like “think step by step” matter less because reasoning models plan themselves. Context, format and constraints remain crucial, as our test showed: +18 points out of 30 for both models.
Write prompts in English or other languages?
Today’s large models understand instructions in many languages well. All prompts in our test were in Polish and gave correct Polish responses. English is worth using for smaller local models and image generators that know other languages less well.
How much does a prompt engineer earn?
There are few separate “prompt engineer” positions, and the skill has become part of other professions. We collected data on AI work earnings in the text How much you earn working with AI and prompt engineering.
Google · Your sourcesQuantslant higher in your Google - one clickAdd to preferred sources →Sources and verification date
- OpenAI, Prompt engineering - API documentation.
- Anthropic, Prompt engineering overview - Claude documentation.
- Google, Prompt design strategies - Gemini API documentation.
- Model prices: OpenRouter, as of October 4, 2026.
We conducted the test on October 4, 2026. Prompts, responses and scoring come from 18 calls via OpenRouter (anthropic/claude-sonnet-5.5 with reasoning effort “low”, google/gemma-4-31b-it without reasoning, 1800 token limit), total cost $0.076.
More on this from QUANTSLANT
news·Trump Creates Super Intelligence Force to Oversee AI Policy

