
Prompt engineering is the practice of writing instructions that get reliable, useful answers from a large language model (LLM). The model is the same for everyone; the prompt decides whether it guesses or does exactly what you need. This guide covers the ten prompt engineering techniques we use most in business applications, with an example and the limits of each, and how they change with today’s reasoning models.
What makes a good prompt?
Every technique below builds on the same basics. A good prompt states:
- The task – what the model should do, in one or two direct sentences
- The context – the facts, documents or data it should use
- The role and audience – who it writes as and who reads the answer
- The format – length, structure, language, and what to do when it doesn’t know
Most poor answers come from a missing piece of this list, not from a missing “trick”. Start here before reaching for an advanced technique.
1. Clear instructions and a role
Tell the model who it is and what good looks like. “You are a customer service agent for an online shop. Answer in at most three sentences, in a friendly tone, and never promise a refund; refer refund requests to the returns team.” A role sets the vocabulary and level of detail; explicit rules prevent the answers you can’t accept.
Use it: always. In applications, put the stable rules in the system prompt and the user’s request in the message.
2. Zero-shot prompting
Zero-shot prompting asks the model to do a task with no examples, relying on what it learned in training. For example, a marketing team can classify social media posts by sentiment just by asking: “Classify the sentiment of this post as positive, neutral or negative.” The model already understands “sentiment”.

- Advantages: fast to write, handles new tasks without preparation.
- Limits: less precise on specialised or ambiguous tasks, and the output format can vary.
3. Few-shot prompting
Few-shot prompting adds a handful of worked examples to the prompt so the model copies the pattern. An e-commerce company classifying customer reviews into “product quality”, “shipping”, “customer service” and “pricing” gets far more consistent labels when the prompt includes two or three labelled reviews per category.

- Advantages: better accuracy and a consistent format with very little effort.
- Limits: the model copies the examples’ flaws too, so choose varied, correct ones; long examples cost tokens on every call.
4. Structured output
Ask for a fixed format, such as JSON with named fields, when the answer goes into software rather than to a person. “Return JSON with the fields category, confidence (0–1) and reason.” Most model APIs now also support schemas that force valid output. Structured output turns a chat answer into data you can validate, store and act on.
Use it: whenever another system reads the model’s answer.
5. Context and grounding (RAG)
Grounding gives the model the facts it must use and tells it to answer only from them. In retrieval-augmented generation (RAG), the application first searches your documents, then puts the relevant passages in the prompt: “Answer using only the documents below. If the answer isn’t there, say so.” It is the most effective way to reduce made-up answers about your products, policies or data.
- Advantages: current, company-specific answers that you can trace to a source.
- Limits: the answer is only as good as the search; irrelevant passages confuse the model.
6. Chain-of-thought prompting
Chain-of-thought (CoT) prompting asks the model to reason step by step before giving the answer. It helps with calculations, multi-step decisions and rules with exceptions. For example, a chatbot helping a customer choose a subscription plan should first list the customer’s usage, compare it with each plan, and only then recommend one.

- Advantages: better results on reasoning tasks, and you can see how the model got there.
- Limits: longer, slower and more expensive answers; an early mistake carries through to the conclusion.
In 2026: reasoning models (such as OpenAI’s o-series, Claude with extended thinking or Gemini’s thinking models) already reason internally before they answer. With them, “think step by step” adds little; describe the problem and the criteria well instead, and keep explicit CoT for standard models.
7. Self-consistency
Self-consistency asks the same question several times and takes the most common answer. Because a model can reach different conclusions on different runs, the majority answer is usually more reliable than any single one. It is useful for classification and extraction where an error is costly.
Limits: it multiplies the cost by the number of runs, so use it where accuracy matters more than price.
8. Prompt chaining
Prompt chaining splits a complex task into a sequence of smaller prompts, each feeding the next: extract the facts from a contract, then check them against the policy, then draft the summary. Each step is simpler, easier to test and easier to fix. The same idea, combined with tools (search, a database, a calculator), is how AI agents work: the model decides the next step, calls a tool, and continues with its result.
- Advantages: reliable results on tasks too big for one prompt; each step can use a different, cheaper model.
- Limits: more moving parts to build and monitor.
9. Reflection (self-critique)
Reflection prompting asks the model to review and improve its own answer, either in the same prompt or in a second pass: “Check your reply against the customer’s question and our policy. List anything missing or wrong, then write the corrected reply.” In our customer service example, the model notices that its first reply about an incomplete order didn’t say when the missing item will arrive, and fixes it.

- Advantages: catches omissions and errors before a person sees them.
- Limits: a model can confidently “confirm” its own mistake; for important checks, use a separate prompt with clear criteria or a different model as the reviewer.
10. Tree of thoughts
Tree-of-thoughts (ToT) prompting asks the model to explore several lines of reasoning, evaluate them, and continue with the most promising one. It suits strategic questions with several options, such as whether an online retailer should launch a category of eco-friendly home products. A simple single-prompt version, proposed by Dave Hulbert (2023), asks the model to imagine three experts who each write one step of their reasoning, share it, and drop out when they realise they are wrong.

- Advantages: considers alternatives instead of the first plausible answer.
- Limits: long and costly; most useful for decisions, not for routine tasks.
Which prompt engineering technique should you use?
| Task | Start with |
|---|---|
| Simple question, summary, rewrite | Clear instructions (1), zero-shot (2) |
| Classification, extraction, fixed style | Few-shot (3) + structured output (4) |
| Answers about your own products or documents | Grounding / RAG (5) |
| Calculations, rules, multi-step decisions | Chain-of-thought (6) or a reasoning model |
| High-stakes classification | Self-consistency (7) |
| Large workflows, agents | Prompt chaining (8) |
| Drafts that must meet a standard | Reflection (9) |
| Strategic options | Tree of thoughts (10) |
How to test and improve prompts
A prompt that works on three examples can fail on the fourth. Treat prompts like code:
- Collect a test set of real inputs with the answers you expect, including difficult and unusual ones.
- Change one thing at a time and run the whole test set after each change.
- Measure accuracy, format errors, length and cost, not just whether the answer “looks good”.
- Version your prompts and re-run the tests when you change the model, because the same prompt can behave differently on a new version.
Prompting techniques improve single answers; a production application also needs evaluation, cost control and security. We cover these in the challenges of large language models in real applications, and our Generative AI for enterprise systems service builds them into LLM features from the start.
Frequently asked questions
What are prompt engineering techniques?
Prompt engineering techniques are ways of writing instructions for a large language model so it gives more accurate, consistent and useful answers. The most common are zero-shot and few-shot prompting, chain-of-thought, structured output, grounding with your own documents, prompt chaining and reflection.
What is the difference between zero-shot and few-shot prompting?
Zero-shot prompting gives the model only the instruction. Few-shot prompting adds a few examples of inputs with the correct outputs, so the model follows the pattern. Few-shot is usually more accurate and consistent for classification and formatting tasks.
Is prompt engineering still needed with reasoning models?
Yes, but it changes. Reasoning models need fewer tricks like “think step by step”, but they still depend on a clear task, the right context, explicit constraints and a defined output format. Testing prompts against real examples matters as much as before.
Which prompting technique reduces AI hallucinations?
Grounding the model in your own documents (retrieval-augmented generation) and instructing it to answer only from them, and to say when the answer isn’t there, reduces made-up answers the most. A reflection step that checks the answer against the sources helps further.
Further reading: Prompt Engineering Guide · PanelGPT: “magic words” that improve language models’ reasoning
Thank you for signing up!



