B Binance · The world's largest crypto exchangeBinance Sign up → AD OKX OKX · A leading global crypto exchangeOKX Sign up → AD
🤖 AI Basics · Lesson 6 / 10

Advanced Prompting — Roles, Examples, Steps, Format

Add the techniques of roles, examples, steps and format on top of the four basic elements, and you can reliably hand even complex jobs to AI. These techniques are not magic; they are just another name for "clearer instructions."

⏱ About 19 min ✍️ 4 practice questions Updated 2026-10-08
🎯 By the end of this lesson you can
  • Explain how assigning a role changes the perspective and level of an answer
  • Write a prompt that shows examples of the answer you want
  • Hand over a complex job by breaking it into steps
  • Specify output formats such as tables and lists precisely

1.Role: decide whose eyes it should see through

If you assign a role, such as "You are an elementary school science teacher," the perspective, tone and level of the explanation change to fit that role. Even for the same topic, photosynthesis, a teacher would explain with analogies and questions, a botanist with chemical equations, and a farmer by connecting it to growing crops. A role is a powerful piece of context that tells the model what kind of text to continue.

But giving a role does not turn the model into an expert in that field. Saying "You are a lawyer" does not create legal knowledge the model doesn't have. Remember that a role changes only the tone and perspective; it does not guarantee factual accuracy.

Roles are also useful for getting criticism. If you say, "You are a strict reviewer seeing this proposal for the first time. Find five weaknesses," you can spot holes you missed before anyone else does.

2.Examples: if it's hard to describe, show it

When the result you want is hard to describe in words, showing one or two examples is the fastest way. Just as people understand at once when they see a sample "along these lines," the model copies the length, tone and structure of the examples. Giving no examples is sometimes called zero-shot, one example one-shot, and several examples few-shot.

Be careful about two things when giving examples. First, the model follows examples very faithfully, so if all three examples are phrased the same way (say, all starting with an "-ing" verb), all the results will be phrased that way too. If you want varied results, give varied examples. Second, so that it doesn't copy the content of the examples as well, say clearly, "Use only the format as a reference; write new content."

ExampleYou want to classify product reviews as "positive, negative or neutral" with a one-line reason. Write a prompt that includes examples.
  1. Write the instruction first: Classify each review as positive, negative or neutral, and give a one-line reason.
  2. Add two examples that show the format. Example 1 — Review: "Shipping was fast, but it's smaller than I expected" → Neutral / Reason: mentions both a pro and a con.
  3. Example 2 — Review: "This is my second purchase. Still great" → Positive / Reason: repeat purchase and expression of satisfaction.
  4. At the end, paste the reviews to classify and add, "in the same format as the examples above."
AnswerStructure it in this order: instruction + two examples that show the format + the material to process + "in the same format."

3.Steps: break big jobs into pieces

If you hand over a big job like "Write a market research report" all at once, the result tends to be shallow. Breaking it up in the order a person would work makes it much better: first get an outline, then revise the outline yourself, have it write each chapter, and finally have it polish the whole thing. The biggest advantage is that you can check and steer the direction at every step.

For questions that require calculation or reasoning, it also helps to ask, "Don't just give the answer; show the solution step by step." As we saw in Lesson 4, the model writes one token at a time, so having it write out the intermediate process gives the next step something to build on. Above all, it lets a person check each step. Even if the steps look plausible, a wrong calculation can slip in along the way, so check the numbers yourself.

  • Step 1: Get an outline or plan first
  • Step 2: Revise the plan yourself (remove, add, reorder)
  • Step 3: Produce the content part by part
  • Step 4: Have it review and polish the whole thing at once
  • Step 5: A person checks the facts and numbers

4.Format: fix the shape of the result

If you plan to move the result somewhere else, it is a good idea to define the format precisely. Rather than just saying "as a table," specify the column names and their order too, and you will get results of the same shape even across multiple requests, which makes them easy to compare. Match the format to where it will be used: "in comma-separated format (CSV)" if it is going into a spreadsheet, or "in a title–subheading–body structure" if it is going into a document.

Format also includes length and count. Setting counts, such as "three pros and three cons, one sentence each," keeps it from going on at length about only one side. And if you build rules for marking uncertainty into the format, such as "If you don't know, say you don't know" or "Add (needs checking) to any item you're not sure about," the verification we cover in Lesson 7 becomes easier.

  • Wrong: Compare three laptops.Right: Compare laptops A, B and C in a table. Use the columns "Weight, Screen size, Battery life, Price range, Needs checking" in that order. Leave any value you're not sure about blank, and write "needs checking" in the last column.If you define the column names, their order and a rule for marking uncertainty, you can review the result and move it elsewhere as-is.

5.Using the four techniques together

In practice, you mix the techniques. For example, to get a draft of an English email, you might write: "You are a coworker who is good at business English (role). Use the tone of the sample email below as a reference (example). First, show me the key points in three lines, and once I confirm, write the email (steps). Use the order subject, body, closing, and keep the body under 120 words (format)."

When a prompt gets long, don't mix material and instructions; divide it into sections. If you add headers such as "### Instructions," "### Material" and "### Example," or wrap the material in quotation marks, the model won't confuse what is a command and what is content to process. This habit also helps reduce the mistake of following stray instructions that happen to be mixed into the material.

More techniques are not always better. Ask simple questions simply, and when the result is not what you expected, add the missing techniques one at a time.

6.When the result isn't what you expected: finding the missing technique

As the tip above says, rather than putting in every technique from the start, it is better to look at the result and add them one at a time. To do that, you need to be able to look at the "symptoms" of a result and guess which technique is missing. The table below lists common symptoms and the matching remedies.

The trick is to try one remedy at a time. If you change several things at once, even if the result improves you won't know what worked, so you are left with no lesson you can reuse the next time you do something similar. Write the remedies that worked into your prompt templates, as in the tip from Lesson 5.

Remedies by symptom
Symptom in the resultWhat is most likely missingHow to fix it
The explanation is too hard or too easyRole / readerSet the perspective and level, e.g. "as a science teacher explaining to a middle school student"
The tone or length is not what you wantExamplesShow one short example of the result you want and add "use only this format as a reference"
The content is shallow and important parts are missingStepsGet an outline or plan first, revise it yourself, then have it write part by part
The shape differs every time, making it hard to compare or moveFormatDefine the column names, order, counts and length
It mistakes sentences in the material for instructionsDividing into sectionsPut a boundary between instructions and material with headers or quotation marks
ExampleYou asked for a summary of meeting minutes, but the length differs every time and it leaves out who is responsible for what. Fix it one thing at a time, according to the symptoms.
  1. Symptom 1, "the length differs every time," is a format problem: set the length to "decisions in three lines or fewer."
  2. Symptom 2, "the person responsible is missing," is also a format problem: add "put action items in a table with the columns action item, owner, deadline."
  3. Get it again, and have it mark any item whose owner is not written in the minutes as "(needs checking)."
AnswerDefine the format (a length limit and an action-item table), add a rule for marking uncertainty, and fix one thing at a time to see what works.

📌 Key points

  • A role changes the perspective, tone and level, but it does not add knowledge
  • Show results that are hard to describe with examples — the model follows examples faithfully
  • Hand over big jobs in steps: plan → review → write the parts → polish
  • Define the format concretely, down to column names, order, counts, length and how to mark uncertainty
  • Write long prompts in separate sections for instructions, material and examples

✍️ Practice questions

Answer first, then open "Answer and explanation".

Q1. When you assign the role "You are a tax accountant," what effect can you best expect?

⭕ Correct

❌ Not quite — see the explanation

Answer and explanation
Answer ② It will answer with a perspective and tone close to a tax consultation

A role changes the perspective and tone but does not guarantee accuracy or up-to-date knowledge. For tax questions, look up the current law or check with a professional.

Q2. You gave three examples, and every result started with words similar to the examples. What is the best fix?

⭕ Correct

❌ Not quite — see the explanation

Answer and explanation
Answer ② Give examples in varied forms and add "use only the format as a reference"

The model follows examples faithfully. Make the examples varied and make clear what it should copy (the format).

Q3. What is the biggest advantage of breaking a long report into steps when you hand it over?

⭕ Correct

❌ Not quite — see the explanation

Answer and explanation
Answer ② A person can check and correct the direction at each step

Correcting the direction at the planning stage saves you the trouble of rewriting the whole thing later. Fact-checking is still necessary.

Q4. In one sentence, write why it is a good idea to keep instructions and pasted material separate within a prompt.

Answer and explanation
Answer So the model doesn't confuse what is a command and what is content to process

Even if the material contains sentences that look like instructions, the model is more likely to treat them as content to process when the sections are separated.

🤖 Try asking AI like this

Copy a prompt and replace the [ ] parts with your own situation. Don't take the answer on trust — check it against this lesson.

When you want to find the weaknesses in your proposal or writing in advance

You are a strict reviewer seeing this document for the first time. Find five weaknesses in the document below, in order of importance, and for each one suggest in one line how to fix it. Skip the praise.
### Document
[paste the document]

When you need results in the same format many times

### Instructions
Organize each item in the material below into a table. Use the columns "Item, Key point (20 characters or fewer), Date, Needs checking" in that order. Leave any value that isn't in the material blank and mark it in the "Needs checking" column.
### Example
| Meeting | Discuss next quarter's budget | March 5 | |
### Material
[paste the material]

When you want to work through a big task in steps

I want to write a report on [topic] together with you. Today, just make the outline. For each chapter, add one line with the key question it will answer. Once I revise the outline and send it back, start writing from Chapter 1.
References
  • General prompting techniques (roles, examples, steps, format) commonly found in guides to using generative AI

Reached every goal above? Mark the lesson complete.

🤖 AI Basics

  1. 1What Is AI? — Rules and Learning
  2. 2Machine Learning Basics — Data, Model, Training, Evaluation
  3. 3Neural Networks, Intuitively — Small Calculations Add Up to Judgment
  4. 4How Do Large Language Models Produce Text?
  5. 5Prompt Basics — Saying Exactly What You Want
  6. 6Advanced Prompting — Roles, Examples, Steps, Format
  7. 7Hallucination and Verification — How to Doubt What Sounds Plausible
  8. 8Privacy, Copyright and Ethics — Using AI Responsibly
  9. 9Working with AI — Delegate, Check, Connect
  10. 10Learning Strategies for the AI Era — The Basics Shape Your Questions
📚 Worth reading
🧠What Generative AI Does and Where It Fails→ ✍️How to Write a Good Prompt→ 🔍Checking AI Answers→ 📚Using AI for Study and Work Without Plagiarism→
← Foundations for the AI Era