Module 2: Uses · 3 min read
Advanced Prompting: Examples, Reasoning Steps and Prompt Chaining
Four research-backed techniques for tasks where a simple prompt isn't enough.
The previous lesson covered the basics. Here are four techniques for tasks where even a well-organized prompt gives inconsistent results: classifying hundreds of requests, analyzing a complex document, or a process with several steps.
1. Few-shot: teaching by example
Instead of describing what you want, show the model two or three examples of input and output, then give it a new input.
Request: "The package still hasn't arrived after two weeks" → Category: Shipping, Urgency: High Request: "Can I get an invoice in the company's name?" → Category: Invoices, Urgency: Low Request: "I was charged twice on my card" → ?
The examples convey format, level of detail and logic precisely. It's the technique that pays off most for recurring tasks.
2. Chain of thought
In 2022 Google researchers published a paper showing that models solve math and logic problems much better when asked to write out the solution steps before the answer. The reason: each step written becomes context for the next one.
In practice: "Before you recommend, analyze the pros and cons of each option, and only then give a recommendation."
What changed: since September 2024, with the launch of OpenAI's o1, there are reasoning models that perform this thinking step themselves before they answer. With them you don't need to ask them to "think step by step." It's better to invest in a clear definition of the problem and of what counts as a good answer.
3. Structure: separating instructions from content
When you paste a long document, the model can confuse your instructions with the text. Anthropic recommends wrapping each part in tags:
<contract> ...the text... </contract>
<instructions> Find clauses that impose penalties on the customer </instructions>
It looks technical, but it works with every model. Even simple headings like "### Document" and "### Task" do part of the job.
4. Prompt chaining
A big task in one prompt gives mediocre results in every part. It's better to break it into steps:
- "Extract all the decisions and tasks from the transcript."
- "From this list, write a 5-line summary for the manager."
- "Write a follow-up email for each task owner."
Each step is simple, you can check it, and if something breaks you know where. This is also the basis for building automations and agents, where each step is a separate call to the model.
Bonus: self-critique
After the model has written something, ask it: "Check your answer against the original requirements. What's missing or wrong?" It will often find problems itself. It's no substitute for your own review, but it filters out some of the errors.
Bottom line: Examples for consistency, reasoning steps for complex problems (if the model doesn't do it on its own), tags for separation, and chaining for big tasks. Most everyday use doesn't need all of this. When results are inconsistent, this is the toolbox.