08 · Text and chat

How to talk to chat AI

08Text and chat

Group 08 · 26 techniques

Text and chat

How to talk to chat AI. Clear words. Good examples. Use tags to organise.

Each slide shows one technique: the plain prompt, the same prompt with the technique applied, and what changed. Use the arrows, the keys ← →, or pick a technique on the left.

Be Clear and Direct (Anthropic)

Give clear, explicit instructions - specific output format and constraints, sequential numbered steps when order matters.

Before

Write something about our product.

After · new words marked

Write a 150-word product description for our wireless earbuds, in a friendly tone, with three bullet points: battery life, comfort, price. Do not mention competitors.

What happened

Anthropic frames Claude as 'a brilliant but new employee who lacks context on your norms and workflows.'

Text and chat · Technique 1 of 26

Be Clear and Direct (Anthropic)

Give clear, explicit instructions - specific output format and constraints, sequential numbered steps when order matters.

When to use it

Always; the baseline technique for every prompt.

Sources

Structure Prompts with XML Tags (Anthropic)

Wrap each content type in its own tag (<instructions>, <context>, <input>) so the model parses complex mixed prompts unambiguously.

Before

Here is a document and a question. Answer it. [document pasted inline]

After · new words marked

<instructions>Answer the question using only the documents below.</instructions><documents><document index='1'>[text]</document></documents><question>[question]</question>

What happened

Consistent descriptive tag names; nest tags for hierarchy. Best practice across Anthropic, OpenAI, Gemini and Microsoft guides.

Text and chat · Technique 2 of 26

Structure Prompts with XML Tags (Anthropic)

Wrap each content type in its own tag (<instructions>, <context>, <input>) so the model parses complex mixed prompts unambiguously.

When to use it

Complex prompts mixing instructions, context, examples, and variable inputs.

Sources

Give the Model a Role (Anthropic)

Set a role in the system prompt to focus behaviour and tone; even a single sentence makes a difference.

Before

Answer this customer complaint.

After · new words marked

You are a calm, empathetic customer-support agent for a bank. Answer this customer complaint in that voice.

What happened

Role in the system prompt focuses behaviour and tone.

Text and chat · Technique 3 of 26

Give the Model a Role (Anthropic)

Set a role in the system prompt to focus behaviour and tone; even a single sentence makes a difference.

When to use it

Any use case with a distinct persona, expertise, or tone.

Sources

Long-Context Prompting (Anthropic)

For 20k+ token inputs: put long-form data at the top (above query / instructions / examples), structure documents with XML, and ground responses in quotes.

Before

Put the question first, then paste 50 pages of documents.

After · new words marked

Paste the documents first, then: 'Quote the relevant parts of the documents first before carrying out the task.'

What happened

Putting data at the top improves performance across all models; quote-first grounding helps the model focus on relevant content. Note: Google advises the opposite for Gemini 3: context first, the question at the very end. Test both with your model.

Text and chat · Technique 4 of 26

Long-Context Prompting (Anthropic)

For 20k+ token inputs: put long-form data at the top (above query / instructions / examples), structure documents with XML, and ground responses in quotes.

When to use it

Large documents / data-rich inputs (20k+ tokens), multi-document QA, summarisation.

Sources

Control Output Format (Anthropic)

Steer output format by telling the model what to do (not what not to do), using XML format indicators, and matching prompt style to desired output style.

Before

Do not use markdown in your response.

After · new words marked

Your response should be composed of smoothly flowing prose paragraphs. Write the prose sections in <smoothly_flowing_prose_paragraphs> tags.

What happened

Positive framing beats negative; matching prompt style to output style helps.

Text and chat · Technique 5 of 26

Control Output Format (Anthropic)

Steer output format by telling the model what to do (not what not to do), using XML format indicators, and matching prompt style to desired output style.

When to use it

Whenever output format is drifting (e.g. unwanted Markdown, wrong structure).

Sources

Ask the Model to Self-Check (Anthropic)

Append 'Before you finish, verify your answer against [test criteria]' to catch errors, especially coding and math.

Before

Write the function and finish.

After · new words marked

Write the function. Before you finish, verify your answer against the test criteria: [criteria].

What happened

Catches errors reliably, especially for coding and math.

Text and chat · Technique 6 of 26

Ask the Model to Self-Check (Anthropic)

Append 'Before you finish, verify your answer against [test criteria]' to catch errors, especially coding and math.

When to use it

Coding / math tasks where verification pays. Remove on Claude Opus 5 - it self-verifies well and extra verification causes over-verification.

Sources

Chain Complex Prompts (Anthropic)

Break a task into sequential API calls so intermediate outputs can be inspected / logged / branched; most common pattern is self-correction: draft, review against criteria, refine.

Before

Do the whole task in one call.

After · new words marked

Call 1: generate a draft. Call 2: review it against the criteria. Call 3: refine it based on the review.

What happened

Each step is a separate API call so you can log, evaluate, or branch at any point.

Text and chat · Technique 7 of 26

Chain Complex Prompts (Anthropic)

Break a task into sequential API calls so intermediate outputs can be inspected / logged / branched; most common pattern is self-correction: draft, review against criteria, refine.

When to use it

When you need to inspect intermediate outputs or enforce a specific pipeline.

Sources

Prefill - Retired Technique (Anthropic)

Prefilled responses (partial assistant message for the model to continue from) are no longer supported on Claude 4.6+ - requests return a 400 error.

Before

Prefill the assistant turn with a partial sentence / JSON skeleton and let Claude continue it.

After · new words marked

Write the same output with an explicit instruction instead: 'Start your answer with the JSON skeleton {...} and fill it in.'

What happened

Anthropic: 'Model intelligence and instruction following have advanced such that most use cases of prefill no longer require it.' Present as a retired technique, not a current recommendation.

Text and chat · Technique 8 of 26

Prefill - Retired Technique (Anthropic)

Prefilled responses (partial assistant message for the model to continue from) are no longer supported on Claude 4.6+ - requests return a 400 error.

When to use it

Legacy prompts only: migrate prefill use cases to explicit instructions.

Sources

Developer Message as Instructions (OpenAI)

Developer messages are high-priority rules / business logic (like a function definition); user messages are inputs (like arguments).

Before

Are semicolons optional in JavaScript?

After · new words marked

Developer: 'Talk like a pirate.' User: 'Are semicolons optional in JavaScript?'

What happened

Model answers in pirate voice. Priority: developer > user > assistant.

Text and chat · Technique 9 of 26

Developer Message as Instructions (OpenAI)

Developer messages are high-priority rules / business logic (like a function definition); user messages are inputs (like arguments).

When to use it

Every API application; separating durable rules from per-request inputs.

Sources

Developer Message Anatomy (OpenAI)

Order a developer message: Identity, Instructions, Examples, Context (context last, since it varies per request).

Before

Flat unstructured prompt with identity, rules, examples and context mixed together.

After · new words marked

# Identity: You are a coding assistant that enforces snake_case in JavaScript. # Instructions: use snake_case (e.g. my_variable), not camelCase; declare variables with 'var'; return code only, no Markdown. # Examples: <user_query>How do I declare a string variable for a first name?</user_query> <assistant_response>var first_name = 'Anna';</assistant_response> # Context: [codebase notes]

What happened

Model returns 'var first_name = "Anna";' with no Markdown.

Text and chat · Technique 10 of 26

Developer Message Anatomy (OpenAI)

Order a developer message: Identity, Instructions, Examples, Context (context last, since it varies per request).

When to use it

Prompts mixing instructions, examples, and reference documents.

Sources

Reasoning vs GPT Models - Different Prompting (OpenAI)

Reasoning models generate an internal chain of thought and do best with high-level guidance; GPT models are fast / cheap but need precise explicit instructions.

Before

Give the junior model a vague goal and expect it to plan.

After · new words marked

Reasoning model: give it a goal and let it plan. GPT model: give explicit step-by-step instructions.

What happened

OpenAI's analogy: 'A reasoning model is like a senior co-worker... A GPT model is like a junior coworker. They'll perform best with explicit instructions.'

Text and chat · Technique 11 of 26

Reasoning vs GPT Models - Different Prompting (OpenAI)

Reasoning models generate an internal chain of thought and do best with high-level guidance; GPT models are fast / cheap but need precise explicit instructions.

When to use it

Choosing how much detail to put in the prompt, per model family.

Sources

Agent Prompt: Plan and Persist (OpenAI)

Instruct the agent to keep going until the query is completely resolved, decompose into sub-requests, plan extensively before tool calls, and reflect after each call.

Before

Do this task.

After · new words marked

Remember, you are an agent - please keep going until the user's query is completely resolved, before ending your turn. Decompose the query into all required sub-requests, and confirm that each is completed. Plan extensively before making function calls, and reflect on the outcomes of each call.

What happened

Also recommended: preambles for transparency - 'Before you call a tool explain why you are calling it' - and progress tracking with a task list.

Text and chat · Technique 12 of 26

Agent Prompt: Plan and Persist (OpenAI)

Instruct the agent to keep going until the query is completely resolved, decompose into sub-requests, plan extensively before tool calls, and reflect after each call.

When to use it

Agentic / long-running tasks.

Sources

Specify Constraints (Gemini)

Tell the model what to do and not to do, e.g. a hard limit on summary length.

Before

Summarize this text: [150-word quantum computing passage]

After · new words marked

Summarize this text in one sentence: [150-word quantum computing passage]

What happened

One-sentence constraint honoured: 'Exploiting quantum mechanical phenomena, quantum computers can perform calculations exponentially faster than traditional computers...' (gemini-2.5-flash).

Text and chat · Technique 13 of 26

Specify Constraints (Gemini)

Tell the model what to do and not to do, e.g. a hard limit on summary length.

When to use it

Summaries, length / format limits, content boundaries.

Sources

Partial-Input Completion (Gemini)

Give the model a partial output to continue, so it follows the started pattern / format exactly.

Before

For the given order, return a JSON object with the fields cheeseburger, hamburger, fries, or drink. Order: I want two burgers, a drink, and fries.

After · new words marked

Valid fields are cheeseburger, hamburger, fries, and drink. Order: Give me a cheeseburger and fries / Output: {"cheeseburger": 1, "fries": 1} / Order: I want two burgers, a drink, and fries. / Output:

What happened

Returns {"hamburger": 2, "drink": 1, "fries": 1} - 'cheeseburger' was excluded because it wasn't part of the order.

Text and chat · Technique 14 of 26

Partial-Input Completion (Gemini)

Give the model a partial output to continue, so it follows the started pattern / format exactly.

When to use it

Forcing a specific output shape (e.g. JSON with only the fields present) without verbose instructions.

Sources

Add Grounding Context (Gemini)

Include the information the model needs instead of assuming it has it; e.g. paste the device's troubleshooting guide into the prompt.

Before

What should I do to fix my disconnected wifi? The light on my Google Wifi router is yellow and blinking slowly.

After · new words marked

Answer the question using the text below. Respond with only the text provided. [pasted LED-status guide: slowly pulsing yellow = network error, check Ethernet cable...] What should I do to fix my disconnected wifi?

What happened

Without context the answer was generic restart steps; with context it became exact: check the Ethernet cable is connected to router and modem.

Text and chat · Technique 15 of 26

Add Grounding Context (Gemini)

Include the information the model needs instead of assuming it has it; e.g. paste the device's troubleshooting guide into the prompt.

When to use it

Support / troubleshooting, factual answers over specific source text.

Sources

Break Down Prompts (Gemini)

Split complex prompts: (1) one prompt per instruction, (2) chain prompts sequentially, (3) aggregate responses (parallel sub-tasks, then combine).

Before

One mega-prompt with many instructions.

After · new words marked

Prompt 1: extract the key facts. Prompt 2 (using Prompt 1 output): draft the answer. Prompt 3: combine the parallel drafts into one.

What happened

Gemini's three named sub-patterns: break down instructions, chain prompts, aggregate responses.

Text and chat · Technique 16 of 26

Break Down Prompts (Gemini)

Split complex prompts: (1) one prompt per instruction, (2) chain prompts sequentially, (3) aggregate responses (parallel sub-tasks, then combine).

When to use it

Complex multi-step tasks.

Sources

Recast as Multiple Choice (Gemini)

Recast a categorisation task as multiple choice to constrain the model to one of the options.

Before

Which category does The Odyssey belong to: thriller / sci-fi / mythology / biography

After · new words marked

Multiple choice problem: Which of the following options describes the book The Odyssey? Options: - thriller - sci-fi - mythology - biography

What happened

The model answered 'The correct answer is mythology.' instead of a verbose explanation.

Text and chat · Technique 17 of 26

Recast as Multiple Choice (Gemini)

Recast a categorisation task as multiple choice to constrain the model to one of the options.

When to use it

When a prompt isn't working; verbose, out-of-bounds answers.

Sources

Cue / Prime the Output (Microsoft)

A few words or phrases at the end of the prompt that jump-start the output into the desired form.

Before

Summarize the above email message: [long email]

After · new words marked

Summarize the above email message. Key Points: -

What happened

The cue produced a bulleted key-points list instead of a full paragraph summary. 'Cues act as the jumpstart for the output.'

Text and chat · Technique 18 of 26

Cue / Prime the Output (Microsoft)

A few words or phrases at the end of the prompt that jump-start the output into the desired form.

When to use it

Controlling output format / length.

Sources

Supporting Content (Microsoft)

Extra information that influences the output but isn't the main target (date, user name, preferences, 'my important topics').

Before

Summarize the workshops above, grouped by topic: [workshop list]

After · new words marked

My Important Topics: prompt engineering, search, GPT models. Summarize the workshops above, grouped by my important topics: [workshop list]

What happened

Without supporting content the model simply listed the workshops; with it, it grouped them accurately.

Text and chat · Technique 19 of 26

Supporting Content (Microsoft)

Extra information that influences the output but isn't the main target (date, user name, preferences, 'my important topics').

When to use it

Personalised / grouped output.

Sources

Start with Clear Instructions (Microsoft)

Put the task at the beginning of the prompt, before context or examples - sequence matters because of how GPT models process input.

Before

Paste snippets, then at the end: verify if this statement is supported.

After · new words marked

Your task is to verify if the statement 'Several sources mention a chance of another large eruption' is supported by a specific quote from the following set of snippets. [snippets]

What happened

Model correctly answered: 'No, the statement isn't directly implied... the snippets mention a chance of a megaquake, but don't mention another large eruption.' Caveat on the page: with ChatGPT / GPT-4 their testing showed the same response regardless of position.

Text and chat · Technique 20 of 26

Start with Clear Instructions (Microsoft)

Put the task at the beginning of the prompt, before context or examples - sequence matters because of how GPT models process input.

When to use it

Factual verification / long-context tasks.

Sources

Repeat Instructions at the End (Microsoft)

Repeat key instructions at the end of the prompt to counter recency bias (end-of-prompt information has outsized influence).

Before

Instructions only at the start of a long prompt.

After · new words marked

Instructions at the start AND repeated at the end of the prompt.

What happened

Worth experimenting with and evaluating; no numeric result given on the page.

Text and chat · Technique 21 of 26

Repeat Instructions at the End (Microsoft)

Repeat key instructions at the end of the prompt to counter recency bias (end-of-prompt information has outsized influence).

When to use it

Long prompts where early instructions get lost.

Sources

Add Clear Syntax (Microsoft)

Use separators (---), section headings, UPPERCASE variables to delineate sources / steps; --- can also serve as a stop condition.

Before

Unseparated prompt: read a paragraph and issue search queries to fact-check it.

After · new words marked

You'll read a paragraph, and then issue queries to a search engine in order to fact-check it. Also explain the queries. --- PARAGRAPH [text] --- QUERIES

What happened

Model issued explained queries: 1. 'John Smith Microsoft' - to check employment. 2. 'John Smith Lucy Smith' - marriage. 3. 'John Smith children' - five children.

Text and chat · Technique 22 of 26

Add Clear Syntax (Microsoft)

Use separators (---), section headings, UPPERCASE variables to delineate sources / steps; --- can also serve as a stop condition.

When to use it

Multi-part prompts (paragraph + queries + sources).

Sources

Specify Output Structure with Citations (Microsoft)

Ask for citations and a defined output structure (e.g. BEHAVIOR('reason'), or a JSON schema) - this forces grounding and makes compound claims verifiable.

Before

Only write true facts. Don't fabricate. [system message alone]

After · new words marked

List the different behaviors exhibited by the Customer Support agent. Classify and list them, citing the reason, using the format BEHAVIOR('reason').

What happened

Asking for citations means the model must make two errors to hallucinate: the fabricated response and a bad citation. Inline citations are better than end citations.

Text and chat · Technique 23 of 26

Specify Output Structure with Citations (Microsoft)

Ask for citations and a defined output structure (e.g. BEHAVIOR('reason'), or a JSON schema) - this forces grounding and makes compound claims verifiable.

When to use it

Reducing hallucinations; extracting structured data.

Sources

Give the Model an Out (Microsoft)

Include 'respond with not found if the answer isn't present' to avoid false responses.

Before

Answer this question from the text: [question]

After · new words marked

Answer this question from the text. Respond with 'not found' if the answer isn't present.

What happened

This addition can help the model avoid generating false responses.

Text and chat · Technique 24 of 26

Give the Model an Out (Microsoft)

Include 'respond with not found if the answer isn't present' to avoid false responses.

When to use it

Any Q&A over a piece of text where the answer may be absent.

Sources

Use Affordances / Tools Instead of Memory (Microsoft)

Let the model call an affordance (e.g. SEARCH) instead of answering from parameters; stop generation, paste results back in, and continue.

Before

Answer this fact-check from memory.

After · new words marked

Call SEARCH('John Smith Microsoft') to fact-check, then: Given the snippets, fact check each of the factual claims above.

What happened

Grounded verdict per claim, including 'Partially confirmed' - a nuance the model wouldn't produce from memory alone.

Text and chat · Technique 25 of 26

Use Affordances / Tools Instead of Memory (Microsoft)

Let the model call an affordance (e.g. SEARCH) instead of answering from parameters; stop generation, paste results back in, and continue.

When to use it

Reducing fabrication; getting up-to-date information.

Sources

How Teaching Sites Present It (PromptingGuide / Learn Prompting)

PromptingGuide.ai (DAIR.AI) is research-first: every technique page cites the original paper, shows the exact prompt and the model's output, and states limitations. Learn Prompting (Schulhoff) organises Basics -> Applications -> Intermediate -> Advanced, with a difficulty rating per article.

Before

Copy a technique page wholesale.

After · new words marked

Use their structure (definition + exact prompt + model output + cited paper + limitations) with your own prompts and results.

What happened

PromptingGuide sequence: Zero-shot, Few-shot, CoT, Zero-shot CoT, Auto-CoT, Self-Consistency, Generated Knowledge, Tree of Thoughts, RAG, ART, APE, ReAct. Learn Prompting: first guide on the internet (Oct 2022), 3M+ users.

Text and chat · Technique 26 of 26

How Teaching Sites Present It (PromptingGuide / Learn Prompting)

PromptingGuide.ai (DAIR.AI) is research-first: every technique page cites the original paper, shows the exact prompt and the model's output, and states limitations. Learn Prompting (Schulhoff) organises Basics -> Applications -> Intermediate -> Advanced, with a difficulty rating per article.

When to use it

Seeing how others present prompting, not to copy verbatim.

Sources