Prompt Engineering
Effective Prompting for
Generating High-Quality Output
Effective Prompting for
Generating High-Quality Output
Table of contents
Definition = Writing effective prompts in order to get high-quality output from AI models
Strategies
Chain of thought (CoT) = Often better answer - Avoid for reasoning models - "Reason step-by-step. Finish with final conclusion"
Clear instructions = Your instructions should NOT be open to misunderstanding
Commands / Hotkeys = Define commands. Example: --s = "Write only short answers in this discussion!" - Or: AutoHotkey (Windows)
Constraints = Define boundaries, limitations, and what the AI model should avoid
Context = Explain who you are, situation, what is important, etc
Decomposition = Break down a complex task into several smaller prompts
English = Often best to communicate with AI in English, since English is the most common language in its training data
Examples = Provide examples of what high-quality output could look like
Experiment = Try different approaches and draw conclusions - This improves your prompt engineering skills
Format = Describe desired output format - Example: Short, bulleted list / Table / XLSX file
Goal = Define desired outcome
Iterate = Ask follow-up questions and demand better answers - Continue chatting until you are satisfied
Reference material = Paste reference text (using triple quotation marks as delimiters) or upload file so AI has enough info
Role / Theme = Example, role: "Act like a senior AI expert" - Example, theme: "Let us discuss prompt engineering"
Self-correction = Ask AI to check its own output. Example: "Check your previous answer. Is it correct? Needs improvement?"
Short = Short input, short output, short chat - But long enough so that AI has enough context to produce good output
Target audience = If AI should write a text: You could define target audience + ask for language adapted to that audience
Tone = Define the desired style or tone - Example: "A casual but still professional tone"
Tool use = Tell AI to use a specific tool, if it likely will improve output quality - Example: "Search multiple reliable websites"
Written by Martin Ågren - March 17, 2025
Prompt engineering is the art of writing good instructions or questions (writing good prompts) in order to get good answers (qualitative output) from AI.
One of the best pieces of advice I could give is: Try learning by doing! The more you practice prompting AI chatbots, the better you get at it. And be curious and experiment. Try different prompts and compare the results. Draw conclusions. That's a great way of getting better at prompt engineering. But of course, I also suggest you take a look at the prompting strategies I have listed below.
To some extent prompt engineering techniques have been built in new models (like CoT-based reasoning models) but prompt engineering is still very relevant.
Since prompt engineering is about obtaining the best possible output quality from AI, it's important to understand AI hallucinations. Therefore, first read the page about AI hallucinations before proceeding to the strategies for prompt engineering listed below.
The AI reasons step by step. Avoid for reasoning models, since CoT is already built-in.
Example, prompt:
"Reason step-by-step and finish your output with your final conclusion"
Write clear instructions - Avoid misunderstandings – The AI should not have to guess.
Have a conversation with the chatbot: Ask follow-up questions or demand better answers.
Delete part of a chat: You can make the lower part of a chat disappear.
Good for making conversations short (AI gets less confused).
Hover over input field + Click pencil icon + Rewrite prompt + Click Send.
Swedish usually works well – English is the safest/best (especially for complex tasks) since most training data is in English.
Provide examples for good output - show AI what a good answer looks like.
Zero-shot prompt = 0 examples - Saves time, but does not optimize output, might not be necessary for simple tasks/questions.
One-shot prompt = 1 example
Few-shot prompt = 2+ examples - Recommended for complex tasks.
Activate internet search when prompting.
Sometimes it's best with Internet search activated, and sometimes it's best not to force AI to search online before answering.
Long prompt (vs short prompt with follow-up prompts) – Both methods work:
Advantage of long prompt: Easier to reuse (saves time in the long run).
Disadvantage of long prompt: Could take more energy and time to create the first prompt, than to just iterate until you are satisfied with the output.
To see examples of prompt format: See heading "Delimiters".
Example: “Act as a prompt engineering expert.”
Personal preference: I often define themes instead.
Ask AI to check its own output:
“Check your previous output. Is it correct? Could your output be improved?”
Even with short inputs and outputs, the conversation as a whole can become unnecessarily long. This can be a problem, since the AI chatbot can become confused trying to keep track of all previous information in the conversation. Strategies:
Start a new conversation instead of letting the current conversation get unnecessary long.
Delete part of the conversation (if the AI tool allows it).
Avoid unnecessary long inputs/outputs, to prevent the AI being distracted by excess information.
Short inputs: Create short and concise inputs (but with enough info)
Short outputs: Instruct AI to keep outputs short: “Always short answers, please!”
Break down tasks into multiple steps.
Especially useful for complex tasks. Example: Creating several code snippets instead of long and complex segments of code.
Define the type of style or tone you want from the AI chatbot.
Example: “Casual but still professional tone.”
Define who the target audience and recipients of the text are.
Define a theme for the conversation (or define AI's role).
Example: "Topic for this conversation: Prompt engineering".
Use triple double quotation marks (as delimiter) to define start and end of your reference text.
Prompt example with reference text provided using triple double quotation marks:
Hi ChatGPT! Here is a reference text that we will discuss:
"""
Prompt engineering is the art of writing good instructions or questions to...
"""
Double quotation marks ("Example") often work well, but NOT optimal when your reference text contains quote(s).
Upload file(s) when prompting, for example a PDF file with accurate information that is relevant for the topic.
Explain who you are and what is important for you related to the given task.