Module 3 of 6 · 30 minutes

Core prompting techniques

These are the techniques professional prompt engineers use most — and they work just as well for everyday tasks.

Learning objectives

  • Use few-shot examples to control format and judgement
  • Structure prompts with delimiters or XML tags
  • Encourage step-by-step reasoning appropriately
  • Break complex tasks into prompt chains
  • Reduce made-up answers and sycophancy

3.1 Few-shot prompting: show, don't just tell

Including a few examples of the input and output you want is one of the most reliable ways to control format, tone and judgement. It's called few-shot prompting (zero-shot means no examples). Use examples that are varied, so the model learns the pattern rather than copying one example.

Classify each customer message as BILLING, DELIVERY, PRODUCT or OTHER.

Message: "I was charged twice for order 1182."
Category: BILLING

Message: "The handle on my pan came loose after a week."
Category: PRODUCT

Message: "Where's my parcel? It said Tuesday."
Category: DELIVERY

Message: "Do you have a shop in Norwich?"
Category:
Examples in the prompt'Charged twice'BILLING'Handle came loose'PRODUCT'Where's my parcel?'DELIVERYModel picks upthe pattern'Shop in Norwich?'OTHERnew inputconsistent output
Few-shot prompting: a handful of varied examples teaches the model the exact format and judgement you want, then it applies the pattern to new inputs.

3.2 Structure with delimiters and tags

When a prompt contains several parts — instructions, a document, examples — separate them clearly so the model doesn't confuse your data with your instructions. Both Anthropic and OpenAI recommend using Markdown headings or XML-style tags.

<instructions>
Summarise the report for a non-technical board.
Use 5 bullet points, then one line: "Decision needed: …"
</instructions>

<report>
[paste report here]
</report>

3.3 Let the model think

For problems involving analysis, maths or several steps, asking the model to work through the problem before giving a final answer often improves quality. With standard models you can ask it to "think step by step" or to reason inside <thinking> tags before the answer. Reasoning models do this automatically — for them, focus on stating the goal and the criteria for a good answer.

Remember Module 3 of "How AI Works"

A model's written reasoning helps performance and lets you spot errors — but it isn't a guaranteed record of how it reached the answer. Check the conclusion, not just the reasoning.

3.4 Prompt chaining: break big tasks into steps

A complex task in one giant prompt often produces a mediocre result. Instead, chain prompts, feeding each output into the next step:

  1. Extract the key facts from these five customer interviews.
  2. Group the facts into themes.
  3. For each theme, suggest product improvements.
  4. Review your suggestions: which are most feasible for a two-person team?

Chaining makes each step easier, lets you check intermediate results, and makes it obvious which step needs fixing.

Extract factsfrom interviewsGroup intothemesSuggestimprovementsRank byfeasibility✓ you can check✓ you can check✓ you can check
Prompt chaining: each step's output feeds the next. Smaller steps are easier for the model, and you can check — and fix — each one.

3.5 Give the model permission not to know

Models tend to answer even when they shouldn't. Reduce made-up answers by saying explicitly what to do when information is missing:

Answer using only the policy document provided.
If the answer isn't in the document, say "The policy doesn't cover this"
and suggest who to ask. Do not guess.

3.6 Ask for critique and alternatives

  • Self-review: "Now review your draft against the brief. List anything missing or weak, then produce an improved version."
  • Options: "Give me three different approaches, with pros and cons of each."
  • Devil's advocate: "What are the strongest arguments against this plan?" — useful for countering sycophancy.
Try it: chain a task

Pick a report you need to read. Prompt 1: "Extract every recommendation and its supporting evidence as a table." Prompt 2: "Which recommendations have the weakest evidence?" Prompt 3: "Draft a five-line summary for my manager, flagging the weak ones." Compare with asking for a summary in one go.

Key takeaways

  • Varied examples (few-shot) are one of the most reliable controls.
  • Separate instructions from data with tags or headings.
  • Ask standard models to think step by step; give reasoning models clear goals.
  • Chain big tasks into checkable steps.
  • Explicitly allow 'I don't know' and ask for counter-arguments.