Interactive roadmap
Prompt Engineering roadmap
This roadmap is for anyone wanting to write better instructions for AI models. You will learn how to get accurate, useful, and reliable answers every time.
- 1
How Models Read Prompts
0 of 3 done
Learn the basics of how language models process text.
Keep tokens and memory limits in mind so your instructions never get cut off mid-sentence. - 2
Writing Clear Instructions
0 of 3 done
Master the art of telling the AI what to do.
Be upfront about what you want so the model does not have to guess your intentions. - 3
Context and Examples
0 of 3 done
Provide background information and samples to guide the AI.
Provide background facts and solid examples so the model has a clear pattern to follow. - 4
Getting Structured Output
0 of 3 done
Format the AI responses into neat, usable layouts.
Ask for tables, lists, or code formats to make the output easy to read and reuse. - 5
Reasoning and Logic
0 of 3 done
Help the model solve tricky problems step by step.
Ask the model to show its working out step by step to catch logic errors early. - 6
Testing and Safety
0 of 3 done
Check your prompts work well and avoid common pitfalls.
Test different prompt variations and watch out for made-up facts or sneaky text tricks.
Learn it all, with a tutor that never sleeps
Every topic links to LevelUp lessons, practice exercises and the 24/7 AI Tutor. Your progress updates as you master lessons.
Every topic explained
Step 1: How Models Read Prompts
- Models work by guessing the most likely next word based on what you typed. Understanding this helps you guide their output.
Read more
Language models do not actually think or understand like humans do. Instead, they look at your words and calculate which word is most likely to come next based on everything they read during training. Think of it like predictive text on your phone, just on a much larger scale.
For example, if you type peanut butter and, the model knows jelly is a very common pairing. Understanding this helps you guide the AI because you realise that the quality of its guess depends entirely on the clues you provide in your prompt.
This matters because knowing how predictions work stops you from expecting human reasoning. You learn to phrase your requests so the most logical next words lead straight to the answer you need.
- Models predict the most likely next word
- They do not possess true conscious thought
- Output quality relies on your input clues
- Good prompts guide statistical probabilities
- A token is a chunk of a word that the model reads. Knowing this helps you save space and write clearer inputs.
Read more
Models do not read full words or single letters. They break text down into smaller chunks called tokens, which might be whole words, parts of words, or even just punctuation marks. Common words usually take one token, while rare or long words get split into several pieces.
Imagine feeding a heavy book into a shredder that cuts sentences into neat little syllables before reading them. If you use unusual jargon, you use up your chat memory much faster because the model needs extra tokens to process it.
This matters for your roadmap because keeping an eye on token usage helps you write concise prompts that fit comfortably inside the model memory limits without wasting space.
- Tokens are word chunks, not always whole words
- Rare words and code use more tokens
- Long prompts risk hitting memory limits
- Concise wording saves precious token space
- (optional)
- This is the memory limit for your chat. If your prompt is too long, the model might forget earlier instructions.
Read more
The context window is the total amount of text a model can remember during a single conversation. Once that limit is reached, the model starts to forget the very beginning of your chat, just like a person trying to remember a very long shopping list without writing it down.
For example, if you paste a massive report and chat for an hour, the model might completely forget the rules you set in your first message. It only sees what fits inside its active memory window right now.
This matters because you must manage long conversations carefully, summarising key points or starting fresh chats when tackling large projects to ensure instructions are never forgotten.
- Context windows represent active chat memory
- Old instructions disappear when limits fill up
- Long chats need periodic summaries
- Start fresh sessions for new tasks
Step 2: Writing Clear Instructions
- Be specific about your goal. Avoid vague phrases so the model does not have to guess what you mean.
Read more
Using direct language means stating your exact goal clearly without beating around the bush. Vague phrases leave room for misinterpretation, forcing the model to guess what you want rather than delivering a precise result.
Imagine telling a colleague to write something up versus asking them to draft a three-paragraph email summarising the morning meeting. The specific request gets you a usable result immediately, saving time on revisions.
This matters because clear instructions reduce back-and-forth chatter with the AI, helping you get accurate and useful answers on your very first try.
- State your exact goal upfront
- Avoid vague or ambiguous phrasing
- Specify formats and lengths clearly
- Reduce the need for guesswork
- Tell the model to act as a specific expert, like a friendly teacher or a helpful programmer, to change its tone.
Read more
Assigning a persona tells the model to adopt a specific perspective, such as a cautious financial advisor or an enthusiastic cooking teacher. This changes the vocabulary, tone, and depth of the answer to match that role.
Think of it like hiring a specialist for a job. If you need a website review, you ask the AI to act as an experienced web designer rather than just a general assistant.
This matters because personas help the model automatically adjust its style, making the output feel much more natural and tailored to your specific audience without extra tweaking.
- Tell the model who it should act as
- Changes vocabulary, tone, and style
- Matches output to your target audience
- Brings relevant expertise to the task
- (optional)
- Tell the model what not to do. Adding limits prevents long, rambling answers and keeps the focus tight.
Read more
Constraints are the boundaries and rules you set to keep the model focused and prevent unwanted rambling. Telling the model what not to do is often just as important as telling it what to do.
For instance, if you ask for a summary, you might add a constraint to keep it under fifty words and to avoid all industry jargon. This forces the output to be punchy and accessible.
This matters because strict boundaries save you time spent editing out fluff, ensuring the final response directly addresses your needs.
- Set clear rules on what to avoid
- Limit word counts and formatting styles
- Prevent rambling or off-topic answers
- Keep the response focused and sharp
Step 3: Context and Examples
- Give the model relevant facts before asking your question so it has the right information to work with.
Read more
Adding background information means giving the model the essential facts it needs before you ask your question. Without this context, the model relies on general guesses that might not match your specific situation.
Imagine asking a mechanic why your car makes a noise without telling them the make, model, or when the sound happens. Providing those background details first gets you a much better diagnosis.
This matters because models cannot read your mind or access your private knowledge unless you feed it to them directly inside the prompt setup.
- Provide key facts before asking questions
- Prevents generic or inaccurate guesses
- Gives necessary context for custom tasks
- Grounds the response in reality
- Give the model a few examples of good inputs and outputs. This teaches the pattern faster than explaining it.
Read more
Few-shot prompting is the technique of giving the model a few clear examples of inputs and desired outputs before asking it to handle a new one. Showing patterns works much faster than trying to explain them with long rules.
Think of showing a new employee two completed invoices before asking them to process the rest of the stack. They see the exact format you want straight away.
This matters because examples teach tone, structure, and style instantly, ensuring the model matches your exact expectations on the very first try.
- Provide two or three input-output examples
- Teaches patterns faster than long explanations
- Ensures consistent formatting and style
- Great for tricky or unusual tasks
- (optional)
- Paste your own documents into the chat and tell the model to base its answers strictly on that text.
Read more
Using reference documents involves pasting your own text directly into the chat and instructing the model to base its answers strictly on that content. This stops the model from mixing up outside facts with your documents.
For example, you can paste a company policy document and ask the model to answer staff questions using only the rules found in that specific text.
This matters because it turns the AI into a reliable search assistant for your personal files, drastically cutting down on guesswork and made-up facts.
- Paste source text directly into the chat
- Instruct model to use only provided text
- Prevents mixing up outside facts
- Turns AI into a reliable personal researcher
Step 4: Getting Structured Output
- Ask the model to present information in bullet points, numbered lists, or tables for easy reading.
Read more
Asking for tables and lists forces the model to organise messy information into clean, readable rows and columns. Instead of wading through blocks of text, you get neat visual summaries.
Imagine looking at a paragraph comparing three phones versus seeing their specs laid out in a neat comparison table. The table lets you spot differences in seconds.
This matters because structured layouts make complex data much easier to scan, digest, and share with others without extra formatting work on your part.
- Request bullet points or numbered lists
- Ask for markdown tables to compare data
- Makes complex information easy to scan
- Saves time on manual text cleanup
- Ask the model to output data in JSON format so you can easily use it in other software applications.
Read more
Formatting as JSON allows you to ask the model to output data in a structured programming format that other software applications can easily read and process automatically.
Think of it like filling out a digital form where every piece of data has a specific label, such as name and age, making it ready to drop straight into a database.
This matters because it bridges the gap between natural language prompts and technical workflows, letting you automate tasks like data extraction and report generation.
- Request data in JSON key-value format
- Enables easy integration with other software
- Keeps data organised and machine-readable
- Great for automated workflows and scripts
- (optional)
- Provide an exact template outline in your prompt and tell the model to fill in the blanks.
Read more
Creating output templates involves writing out an exact skeleton or layout in your prompt and telling the model to fill in the blank spaces with its generated content.
Imagine handing a staff member a blank feedback form with specific headings and asking them to fill in each section. You get a consistent layout every single time.
This matters because templates give you total control over the structure, ensuring every response follows your exact template without straying into unwanted formats.
- Provide an exact layout skeleton in prompts
- Tell the model to fill in the blanks
- Ensures consistent output structure every time
- Eliminates unwanted conversational filler text
Step 5: Reasoning and Logic
- Ask the model to show its working out before giving the final answer. This greatly reduces math and logic errors.
Read more
Chain of thought prompting asks the model to explain its working out step by step before jumping to a final conclusion. This mimics how humans solve difficult problems by breaking them down on scratchpaper.
For example, instead of asking for a math answer immediately, ask the model to write down each calculation stage first. This simple trick catches arithmetic errors before they happen.
This matters because models make fewer logic mistakes when they write out their reasoning process, leading to much more reliable and accurate final answers.
- Ask models to show working out first
- Reduces math and logic mistakes
- Mimics human step-by-step problem solving
- Improves final answer reliability
- Split complex requests into smaller, separate prompts rather than asking for everything at once.
Read more
Breaking down big tasks means splitting a massive, complex request into several smaller, sequential prompts rather than demanding everything in one giant instruction.
Think of building a house. You lay the foundations, build the walls, and put on the roof one stage at a time, rather than trying to do everything at once.
This matters because smaller prompts prevent the model from getting overwhelmed or confused, resulting in much higher quality work across every single step of your project.
- Split complex requests into separate prompts
- Tackle one sub-task at a time
- Prevents the model from getting overwhelmed
- Improves overall quality and detail
- (optional)
- Tell the model to check its own work for mistakes and suggest improvements before finishing.
Read more
Asking for review involves telling the model to check its own work for mistakes, biases, or missing details, and then suggest improvements before presenting the final result to you.
Imagine finishing a report and taking five minutes to proofread and edit your own draft before handing it to your manager.
This matters because asking the AI to act as its own editor catches silly slips and weak arguments, saving you valuable time during the review process.
- Tell the model to review its draft
- Ask it to spot errors or missing points
- Apply suggested improvements before finishing
- Acts as a built-in quality check
Step 6: Testing and Safety
- Try multiple versions of your prompt to see which wording gets the most consistent results.
Read more
Testing different variations means trying out multiple versions of your prompt to see which exact wording gets the most consistent, high-quality results over time.
Think of it like tweaking a recipe by adding a pinch more salt until it tastes just right, then noting down the winning formula for next time.
This matters because prompt writing is an experimental process. Systematic testing ensures your instructions are robust and work reliably across different situations.
- Try multiple versions of your prompts
- Compare results to find the best wording
- Keep notes on what works reliably
- Treat prompt writing as an experiment
- Learn how to spot when the model invents false information and how to prompt it to admit uncertainty.
Read more
Hallucinations happen when a model confidently invents false information, presenting made-up facts as absolute truth because it tries to complete every prompt rather than admit defeat.
Imagine a confident person guessing directions when they are lost, sounding totally sure of themselves even though they are pointing the wrong way.
This matters because spotting these fake facts keeps your work accurate. You can prevent this by adding a phrase to your prompt telling the model to say I do not know if it lacks reliable information.
- Models sometimes invent convincing false facts
- They prefer guessing over admitting confusion
- Instruct models to say I do not know
- Always verify important facts independently
- (optional)
- Keep your prompts secure from sneaky text tricks that try to make the model ignore its instructions.
Read more
Prompt injection is a security trick where hidden instructions inside external text try to make the model ignore its original rules and do something unexpected.
Think of a prankster slipping a sneaky note into a stack of official papers telling the reader to ignore the boss and do a silly dance instead.
This matters because if you build apps or workflows using user-submitted text, malicious inputs could hijack your AI system. Learning to separate instructions from data keeps your prompts secure.
- Sneaky text tricks try to hijack instructions
- Risky when processing untrusted user data
- Separate system rules from user input clearly
- Keep automated AI workflows secure and defensive