Advanced Prompting Techniques
Chain-of-thought, few-shot, structured outputs
Last reviewed
Recommended
Advanced Prompting Techniques — Timed Test (4 questions)
No account needed. Answers and explanations arrive when you submit.
What this topic tests
The mix every Advanced Prompting Techniques set is built to, and the questions published against it so far. Nothing here is hidden before you start.
| Level | Target share | Published |
|---|---|---|
| Easy | 40% | 1 |
| Medium | 40% | 3 |
| Hard | 20% | 0 |
| Total | 4 |
Advanced Prompting Techniques — the theory
Beyond the fundamentals — clarity, examples, and step-by-step reasoning — a handful of more advanced prompting techniques can meaningfully improve results on harder tasks.
Chain-of-thought prompting. This is the practice of explicitly asking a model to reason through a problem in steps before giving a final answer, rather than jumping straight to a conclusion. For tasks involving arithmetic, logic, or multi-step analysis, this consistently improves accuracy, because it gives the model room to catch its own errors along the way rather than committing to an answer immediately. A simple version of this is adding a phrase like "think step by step" or "explain your reasoning before answering" to a prompt.
Few-shot prompting. Rather than only describing what you want in words, showing the model one or more concrete examples of the input-output pattern you're looking for is often far more effective than a purely descriptive instruction. This is especially useful for tasks with a specific, non-obvious output format — for example, extracting structured data from unstructured text, where showing two or three worked examples teaches the pattern far faster than trying to describe it precisely.
Role and persona framing. Asking a model to approach a task from a specific perspective — "as an experienced copyeditor," "as a security-focused code reviewer," "as a skeptical fact-checker" — can shift the lens the model applies to a task, surfacing different concerns or a different tone than a neutral request would. This works because it primes the model toward the kind of reasoning and vocabulary associated with that role.
Structured output requests. For tasks where the output needs to be parsed programmatically or fit a specific template, explicitly requesting a structured format — a numbered list, a table, JSON with named fields, or specific XML-style tags around different parts of the answer — produces far more reliable, consistently-formatted results than a free-form request, and makes the output easier to extract and use downstream.
Decomposing complex tasks. Rather than asking for a large, complex deliverable in a single request, breaking it into a sequence of smaller, more specific prompts — first asking for an outline, then asking for each section, then asking for a final review pass — often produces a better result than a single giant prompt, especially for long-form writing, complex code, or multi-part analysis. Each smaller prompt is easier for the model to execute well, and easier for you to check and correct along the way before compounding errors into a large final output.
Providing negative examples. Alongside showing what good output looks like, explicitly stating what you don't want — a particular tone to avoid, a common mistake to watch for, a format not to use — can be just as valuable as positive examples, especially when a first attempt reveals a specific, recurring issue you want corrected in subsequent attempts.
Iterative refinement as a technique, not a fallback. Rather than treating a single prompt as a one-shot attempt that either succeeds or fails, treating the interaction as a deliberate multi-round refinement — reviewing the first draft, identifying specifically what to change, and prompting again with that feedback — is itself a technique worth using intentionally, not just something to fall back on when a first attempt disappoints.
Self-critique and verification prompts. A related technique is asking the model to check its own work as an explicit, separate step: "review the answer above and list anything that might be wrong or missing," or "verify this solution against the original requirements one by one." Because generation and evaluation are different tasks, a model reviewing an answer will often catch errors it made while producing that same answer — and making the check a distinct prompt, rather than hoping the first response is self-correcting, is what surfaces those catches reliably.
Combining techniques deliberately. These techniques compose naturally, and hard tasks usually benefit from more than one at a time. A demanding analysis might combine role framing ("as a skeptical financial analyst"), chain-of-thought ("work through the assumptions step by step"), structured output ("present the result as a table of claims and evidence"), and a follow-up verification prompt. The skill is not memorizing each technique in isolation but recognizing what a specific task needs: reasoning room, pattern examples, a perspective shift, an output contract, or decomposition into stages.
Knowing when the simple prompt is enough. Advanced techniques carry a small cost — longer prompts, slower responses, more setup — and for straightforward tasks they add nothing. Asking for step-by-step reasoning on a simple factual question, or building a few-shot scaffold for a task the model handles well from a plain description, is effort spent where it makes no difference. Reaching for the heavier tools only when a task actually shows signs of needing them — wrong answers, inconsistent formats, shallow analysis — keeps prompting efficient rather than ritualistic.
Together, these techniques move prompting from a single well-phrased request toward a more deliberate practice: choosing the right technique for the type of task at hand, whether that's chain-of-thought for reasoning-heavy work, few-shot examples for pattern-matching tasks, or decomposition for large, complex deliverables.
Sample questions
Three questions from this topic, with the answer and the reasoning shown.
Q1EasyWhat is role or persona framing in a prompt?
- Asking the model to approach a task from a specific perspective, like an experienced reviewerCorrect
- Requiring the model to identify as a human
- Assigning the model a random name
- Disabling all safety behavior
Explanation
Role framing tells the model whose job it is doing before it starts. "Review this as a security-focused engineer", "edit this as a copyeditor working to house style", "read this as a sceptical fact-checker" — the task is identical each time and the output is not, because the role decides which things count as problems. The security reviewer flags the unvalidated input that the copyeditor reads straight past.
In an application the role goes in the system prompt; in a chat it is usually the first line. One sentence is enough to shift the result, and a full biography is not better than a precise clause.
Two limits keep it honest. A role changes emphasis, priorities and vocabulary — it does not grant knowledge the model does not have, so "as a doctor" is a lens, not a qualification. And it is not an override: a persona sets the angle inside the model's normal behaviour rather than switching any of that behaviour off.
Q2MediumWhat is chain-of-thought prompting?
- Explicitly asking a model to reason through steps before giving a final answerCorrect
- Chaining together multiple unrelated AI tools
- Repeating the same prompt multiple times
- Only using single-word prompts
Explanation
Chain-of-thought prompting is an instruction about order: work through the problem in steps, then give the answer. "Think step by step before answering" is the whole technique in one sentence. It helps because each step the model writes becomes part of what it reads while producing the next one, so the answer is built on stated intermediate results instead of arrived at in a single jump.
Two things follow. The reasoning is visible, so a wrong answer can be traced to the line that went wrong — often a misreading of the question rather than a slip in the arithmetic. And it costs tokens and latency, which is why it belongs on multi-step work such as calculation, logic, or weighing something against several criteria, not on every prompt you write.
One wrinkle is current. Recent Claude models reason adaptively and will often do this unasked on a hard question. Asking explicitly still matters when thinking is off, and when you want the steps shown to you rather than kept internal.
Q3MediumWhat is the benefit of decomposing a complex task into a sequence of smaller prompts?
- Each smaller prompt is easier to execute well and easier to check along the wayCorrect
- It guarantees the model will never make an error
- It always takes less total time than a single prompt
- It removes the need for any review of output
Explanation
A long task fails as one thing. You get a finished output that is wrong somewhere in the middle, and the only repair on offer is to run the whole prompt again and hope. Splitting it — outline, then draft one section, then check that draft against the brief — changes both halves of that. Each prompt carries less at once, so it is executed better; and each output is small enough to actually read, so a mistake is caught at the step that made it.
It pays most where errors compound. If the first step selected the wrong ten rows, everything after it is careful work on the wrong data, and no amount of quality in the later steps recovers that.
What it does not buy is worth stating. Chaining usually costs more total tokens and more elapsed time, not less, because the steps run in sequence and each one repeats some context. And it does not remove review — it relocates it, from one hard read at the end to several easy ones along the way.
Practise all 4 questions
Every published question in Advanced Prompting Techniques, with its answer and explanation.