# Prompt Engineering Techniques
A prompt framework decides what goes into your prompt. Prompt engineering techniques decide how the large language model works through it. Most guides blur the two, then list 18 methods without showing a single output. This page does the opposite. We ran one fixed task six ways on two models, three times each, published the outputs, and turned the results into a picker you can read in under a minute. If you only want the answer, skip to the technique picker table. If you want the map of prompting techniques first, start with the distinction below.
Frameworks vs techniques: what each one changes
Large language models (LLMs) such as GPT-4 and Gemini are probabilistic engines built on machine learning algorithms. They generate human-like text by next-word prediction, so a question gets an answer only because an answer is the likeliest continuation, not because the model runs a separate Q&A mode. Without structure, generative AI drifts down a statistically likely path that may have nothing to do with your task, and that is where hallucinations start. Frameworks and techniques are two different guardrails against that drift.
A framework shapes the prompt. CRISPE, RACE, RISEN and TAG are checklists that make sure the prompt carries the four pillars of a good AI prompt: a clear directive (summarize, analyze, compare), contextual data for grounding, a persona or role assignment, and a desired output format. Think of a framework as the brief you hand a contractor. Our featured guide to AI prompt frameworks walks through CRISPE, TAG and RACE with fill-in templates.
A technique changes how the model works through the prompt. Few-shot prompting conditions the model with examples for the current inference. Chain-of-thought makes it produce intermediate steps before an answer. Prompt chaining splits one job into linked calls. None of these is a checklist. Each one changes the path from input to output, and with it the response quality.
The practical test: if you are deciding what to include, you need a framework. If the output is wrong even though the prompt includes everything, you need a technique. Most production prompts use one of each, which we cover in the combining section below. Prompt construction is part science and part intuition built from experience, and the fastest way to build that intuition is to watch the same task change under different prompt structures.
The prompt engineering techniques map: four families
There are dozens of named prompting techniques, and new ones appear with every research paper. Nearly all of them fall into four families, and knowing the family tells you what problem the technique solves.
Shot-based techniques
These types of prompting differ only in how many examples you include. Zero-shot prompting (also called zero-shot learning) gives instructions alone, so the model relies on pretrained knowledge. It handles simple requests such as translation, summarization, content moderation or a sentiment analysis task ("classify this text as neutral, negative or positive"), but it struggles with ambiguous tasks where nuance matters: low complexity, moderate accuracy. One-shot learning adds a single example to set tone or format, which is surprisingly effective for establishing expectations. Few-shot learning adds 3 to 5 demonstrations as input/output pairs, a form of in-context learning that steers niche business logic and complex formats without fine-tuning. More examples bring higher complexity and very high accuracy. Use representative examples with consistent formatting, and match the label space and input distribution of the real task; studies even found that randomized labels still help, because the examples condition the model on the expected output and desired behavior. In the Chat Completion API, examples go in the messages array as user role and assistant role turns after the system role message. Our guide to zero-shot vs few-shot prompting goes deeper on example selection.
Reasoning techniques
Reasoning techniques make the model show or compare its working instead of taking confident shortcuts. Chain-of-thought prompting (CoT prompting) asks for logical steps and sub-steps; zero-shot CoT is simply "Let's think step by step," and few-shot CoT adds worked examples. It helps on arithmetic reasoning, logic reasoning and other multi-step problems, and it makes answer checking easier because you can see each step. The original chain-of-thought research described the emergence of reasoning abilities in sufficiently large models. Self-consistency prompting samples diverse reasoning paths through independent generations and keeps the most consistent answer, a voting mechanism that catches one-off logic errors at the cost of extra latency. Tree of thoughts explores several paths rather than one path, scores them, and prunes weak branches before you pick the best; it is compute-heavy, so save it for strategic planning and brainstorming. The same family includes generated knowledge prompting (produce background knowledge or scientific principles first, a form of knowledge injection at inference time), least-to-most prompting (decompose a complex problem into simpler sub-problems and solve them in order), self-ask prompting (explicit reasoning through follow-up questions, a step beyond direct prompting), program-aided language models or PAL (write Python, for example a dictionary that counts object types, for symbolic reasoning and computation), multimodal chain-of-thought across text, images and audio, graph prompting over graph structures and relationships between data points, directional stimulus prompting or DSP (cues that nudge perspective or tone) and active-prompt. Our chain-of-thought guide covers when each one earns its cost.
Structure techniques
Structure techniques control how the model reads the prompt and shapes the answer. Prompts come in three broad kinds: direct instructions (explicit commands), open-ended instructions (exploratory discussions, storytelling) and task-specific instructions. Role prompting, also called persona prompting or role-play prompting, tells the model who to be as well as what to do: "You are a skeptical venture capitalist. List the top 3 pros and cons of this pitch." A realistic role works best (a support agent, a copy editor, a math tutor, a security auditor), stated first and kept brief; elaborate personas add noise. Clear syntax is the other half. Delimiters such as --- separators and uppercase section headings separate instructions from primary content and supporting content such as the current date, user name or user preferences, and they help the model parse the prompt and act as stop conditions. Markdown and triple quotes have long suited GPT models, XML tags have long suited Claude, and newer Claude models read structure without them; matching the model's preferred syntax improves instruction adherence. You can prime the output with a prefix or a bullet-list lead-in ("Key points:" followed by a bullet) to fix the response form, specify structured output as JSON or a table for downstream systems, and ask for inline citations instead of end-of-text citations, so a fabrication also needs a bad citation. Ask for (entity, relationship, entity) triples to avoid compound claims; "Only write true facts" on its own does little. Give the model an out ("reply 'not found' if the answer is absent") to cut made-up answers. Our guide on how to structure AI prompts shows each pattern with before and after examples.
Chaining and agentic techniques
This family spreads one job across several prompts, tools or passes. Prompt chaining links prompts so the output of one feeds the next; it suits multistep processes and longer texts, for example when you break the task down into smaller steps such as "extract factual claims" and then "write search queries to fact-check them." Iterative prompting builds context over turns from conversation history, forming a contextual chain of thought that keeps irrelevant facts out. Meta prompting asks the model to write its own prompt or refine its prompt through one overarching meta-prompt, which helps build self-improving agents and saves tokens through an abstract approach; automatic prompt engineer (APE) has the AI generate the prompt and optimize it. Reflexion has the model review its previous output or first draft and improve it. Retrieval-augmented generation (RAG) adds external retrieval of source material such as a PDF, a database query or company docs, which turns static training data into live information, cuts factual errors and removes the knowledge cutoff problem: the model doesn't know your Q3 numbers until you put them in the prompt. Automatic reasoning and tool use (ART) lets a frozen LLM use affordances such as search and calculators instead of model parameters: stop generation at the tool call, run it, paste results back, and continue with no fine-tuning. ReAct, short for reason + act, runs a thought, action, observation loop that updates action plans with outside information and improves interpretability and trust; it is the foundation of agentic systems and LLM agents. Sequential prompting applies the same idea to recommender systems, using the LLM for the ranking stage after candidate retrieval, because running it on large candidate sets costs too much. Our prompt chaining guide covers multi-step pipelines in detail.
One task, six techniques: the outputs compared
Lists of advanced prompting techniques rarely show what changes when you switch one on. So we fixed a single task and changed only the technique.
The task. Classify 10 support emails into five queues (Billing, Technical Issue, Account Access, Feature Request, Cancellation & Refund) and return one line per email in the format E01: Category.
The data. Ten sample emails written for this test and modelled on common SaaS tickets: a declined card, a broken PDF export, a lost 2FA phone, a dark mode request, a plain cancellation, a wrong VAT number, a blank-output bug with a cancellation threat, a missing password reset email, a request for folders, and a customer who upgraded to an annual plan by mistake and wants to go back to monthly with a refund. That last one, E10, is deliberately ambiguous. Our answer key puts it in Cancellation & Refund because the customer wants a downgrade and money back.
The setup. Two models: Claude Opus 5.5 and ChatGPT on the free plan (GPT-6, shown as "6 Instant"). Dates: 27 and 28 October 2026. Three runs per technique per model, 36 runs in total, each in a fresh session with default settings. ChatGPT runs used temporary chats with memory and custom instructions switched off, so no run could see another's answers.
The six prompts.
- Zero-shot: the instruction and the five category names.
- Few-shot: the same, plus three labelled examples (a crash, a refund for unused months, a language request).
- Chain-of-thought: the same as zero-shot, plus "think step by step about the customer's main goal" before the final list.
- Role: zero-shot plus "You are a senior support triage lead at a SaaS company."
- Chained: call one summarizes each email's main request in 10 words or fewer; call two classifies the summaries.
- Framework-built (CRISPE): capacity and role, an insight line defining each queue, the statement, a terse personality, and the exact format.
| Technique | Claude accuracy (3 runs) | ChatGPT accuracy (3 runs) | Format followed | Output length (Claude / ChatGPT) |
|---|---|---|---|---|
| Zero-shot | 10, 10, 10 | 10, 10, 10 | Yes | 30 / 30 words |
| Few-shot | 10, 9, 9 | 10, 10, 10 | Yes | 30 / 30 words |
| Chain-of-thought | 9, 9, 9 | 10, 10, 10 | Claude: reasoning plus list. ChatGPT: list only | about 300 / 30 words |
| Role | 9, 9, 9 | 10, 10, 10 | Yes | 28 / 30 words |
| Chained | 9, 9, 9 | 10, 10, 10 | Yes | about 115 / about 125 words over two steps |
| Framework-built (CRISPE) | 10, 10, 10 | 10, 10, 10 | Yes | 30 / 30 words |
Both models sorted the nine clear tickets correctly in all 36 runs, including E07, where the customer threatens to cancel but needs a bug fixed. Every wrong answer was the same ticket, E10, and every one came from Claude filing it as Billing. ChatGPT put E10 in Cancellation & Refund in all 18 runs. Here is how the split looked:
Claude, chain-of-thought: "He isn't cancelling. The refund comes from changing the plan, so it's Billing. This one is borderline: if your team handles every refund in the Cancellation & Refund queue, put it there instead."
Claude, chained step one: "E10: Switch from annual back to monthly and refund difference"
ChatGPT, chained step one: "E10: Switch to monthly plan and refund annual plan difference"
Both models, CRISPE, every run: "E10: Cancellation & Refund"
What the test shows.
- Definitions beat technique, on both models. Only the CRISPE prompt stated which queue owns downgrades, and it was right in all six runs across both models. Plain zero-shot matched it here, but by interpretation rather than by rule.
- The same technique behaved differently on each model. ChatGPT read the plan change and refund as Cancellation & Refund every time. Claude read it as a billing correction whenever the prompt nudged it to reason, take a role or summarize first.
- Examples can make a prompt less stable. On Claude, few-shot scored 10 once and 9 twice. Its refund example covered unused months, not plan changes, so it shifted the boundary without settling it. Examples need to cover your edge cases, or a written definition has to.
- Chain-of-thought cost 10 times the output on Claude and still missed. It was the only run that explained the ticket was borderline and flagged E07 as a churn risk. That is useful when a human reviews the queue and wasted tokens when nobody does. ChatGPT's quick model returned the list alone and didn't show its reasoning.
- Chaining is only as good as the summary. Claude's summary step dropped "by mistake," so step two read a plan change as Billing. ChatGPT's summaries kept the refund wording and passed. Chains pay off on long, multi-claim documents, not on 40-word tickets.
- The role line moved Claude, not ChatGPT. A billing-minded triage lead leaned E10 toward Billing in all three Claude runs.
This is a small test: two models, 10 sample emails, three runs each. Treat it as a method, not a benchmark, and repeat it on your own tickets before you standardize a prompt.
Technique picker: which prompting technique to use
Start with a clear zero-shot instruction, then add only what the failure in front of you calls for. The table matches the task type to the technique and the effort it adds.
| Task type | Start with | Add if it still fails | Effort |
|---|---|---|---|
| Rewrite, translate, summarize | Zero-shot with a specific instruction | One example of the tone | Low |
| Classify, extract, fill a fixed format | Few-shot (3 to 5 examples) plus written label definitions | Prime the output; give the model an out | Low |
| Write in an expert voice or for an audience | Role prompting plus clear instructions | One example paragraph | Low |
| Answer from current or company facts | RAG with grounding context | Ask for inline citations | Medium |
| Long document, many claims, or two jobs in one | Prompt chaining | Separate verify step | Medium |
| Arithmetic, logic, multi-step reasoning (non-reasoning model) | Chain-of-thought | Self-consistency, 3 to 5 samples | Medium to high |
| Open strategy with several viable paths | Tree of thoughts | Score and prune each branch | High |
| Needs live data, search or calculation | ReAct or tool use (ART, PAL) | Paste tool results back into the prompt | High |
| You're not sure what the prompt should contain | A framework such as CRISPE or RACE | Meta prompting to refine it | Low |
A few rules sit under the table. Write down your labels, criteria or definitions before you reach for a heavier technique; our test shows that a single definition line held steady on both models where reasoning, roles and examples did not. Be specific, be descriptive and use analogies. Double down when needed, repeating instructions at the end of the prompt, because models can show recency bias and weigh the end of a prompt more; state the task first, which mattered more for older models such as GPT-3 than it does now. For deterministic tasks, lower temperature (0.2 gives focused output for legal documents, 0.7 gives varied output for fiction, on a 0 to 2 scale) and change randomness one setting at a time: temperature or top_p, not both. Mind token counts too: tables are more compact than JSON with repeated field names, a spelled-out month can take fewer tokens than an all-numeric date, and extra whitespace wastes tokens. Then keep testing, because a prompt that worked in one scenario won't necessarily generalize; cross-scenario prompt design is still trial and error.
[Generate a prompt with the right technique built in. Try it in the prompt generator.](/tools/prompt-generator)
Combining a framework with a technique
Frameworks and techniques stack. The framework fills the slots; the technique goes inside one of them. The one prompt that never missed on either model is a plain CRISPE build, and adding few-shot examples to its Experiment slot is the natural next step for higher-stakes routing:
Capacity and role: Act as a support triage lead for a SaaS writing tool.
Insight: Billing = payments, invoices, payment methods. Technical Issue = something
in the product is broken. Account Access = log-in, password, 2FA. Feature Request =
something the product doesn't do yet. Cancellation & Refund = ending a plan,
downgrading, money back. Route by the main request, not by threats or side comments.
Statement: Classify each email into exactly one queue.
Personality: Terse. No explanations.
Experiment: Output one line per email as `E01: Category`. Examples:
"Please add Spanish as an output language." -> Feature Request
"Can I get my money back for unused months?" -> Cancellation & RefundOther pairings that work well: RACE plus chain-of-thought for analysis where you want to check the steps, a role plus RAG for reliable answers grounded in your own documents, and any framework plus a delimiter structure when the prompt mixes instructions with long pasted content. The same stacking applies outside support queues, in chatbots and customer support, code snippets and step-by-step tutorials for developers, simpler explanations and worked math in education, business decision-making, content creation and automated workflows. For filled-in prompts, browse our prompt examples and templates, and for instructions that persist across a whole conversation, see the system prompts hub.
When techniques stop mattering: reasoning models and what still helps
Reasoning models plan internally before they answer, so several classic techniques now add little. Microsoft's prompt engineering guidance states that its techniques are not recommended for reasoning models such as gpt-5 and o-series models, and that trying to extract a model's hidden reasoning through prompts, rather than the provider's reasoning summary feature, isn't supported and may breach the Acceptable Use Policy. Chain-of-thought remains a tool for non-reasoning models.
Drop or reduce: "think step by step," forced visible reasoning, self-consistency on simple tasks and elaborate personas.
Keep: clear instructions with the task stated first, written definitions and criteria (the lesson from our test), grounding data for anything factual, one or two examples of the exact output format, delimiters between instructions and content, and an explicit out for missing answers. Hallucination, complex reasoning and common sense are still where prompts fail most, and specificity fixes more of those failures than any named method. Structural conventions also shift fast: XML tags for Claude went from best practice to optional within a single model generation, so best practices have a shelf life measured in months, not years.
The bigger shift is from single-turn prompts to agentic workflows. Better NLP and stronger model reasoning mean less prompting for complex tasks, and smarter tools increasingly automate prompt creation and optimize prompt creation for you. Agent frameworks turn high-level instructions into chains of actions inside autonomous multi-step systems, and the techniques on this page become foundational components inside those larger systems rather than standalone tricks. For the fundamentals that carry across every model, start with our Learn hub, and for channel-ready prompts see ChatGPT prompts by channel.
FAQ
What are prompt engineering techniques?
Prompt engineering techniques are repeatable ways of writing the input to a large language model so it reasons, formats and answers the way you need. The main families are shot-based (zero-shot, one-shot, few-shot), reasoning (chain-of-thought, self-consistency, tree of thoughts), structure (roles, delimiters, output formats) and chaining (splitting a task into linked prompts or tool calls).
What is the difference between a prompt framework and a prompting technique?
A framework such as CRISPE, RACE or RISEN is a checklist for what goes into the prompt. A technique such as few-shot or chain-of-thought changes how the model works through it. You can use both at once: build the prompt with a framework, then add examples or a step-by-step instruction.
Which prompting technique should I use?
Start with a clear zero-shot instruction. Add two or three examples when the output format or labels drift, ask for step-by-step reasoning when the task involves arithmetic or multi-step logic, and split the task into a chain when one prompt is doing two jobs. The picker table on this page matches task types to techniques by effort.
What is the difference between zero-shot and few-shot prompting?
Zero-shot gives the model only the instruction and no examples. Few-shot adds several examples as worked input/output pairs so the model copies the pattern. Few-shot usually wins on non-trivial tasks, especially fixed labels and strict formats.
Do prompt engineering techniques still work on reasoning models?
Partly. Reasoning models already plan internally, so adding "think step by step" adds little, and some providers advise against forcing visible reasoning. Clear instructions, grounding context, examples of the output format and a defined structure still help every model.
Should I use XML tags or Markdown in my prompts?
Use whichever the model reads most reliably, and test both. Markdown and triple quotes have long suited GPT models, XML tags have long suited Claude, and newer Claude models handle structure without them. What matters is clear separation between instructions and data.
Ready to put a technique to work? [Generate a prompt](/tools/prompt-generator) and try it in the prompt generator.