Skip to main content

12 Prompt Engineering Techniques That Actually Improve Output

A practical reference of the techniques that measurably improve results — and the situations each one is for.

8 min read · Updated

Quick answer

The most reliable prompt engineering techniques are: role prompting, few-shot examples, chain-of-thought reasoning, explicit output constraints and schemas, delimiters to separate data from instructions, decomposition into steps, self-critique passes, and grounding answers in supplied source text. Each targets a specific failure mode — vagueness, wrong format, faulty reasoning, or hallucination — so the skill is matching the technique to the problem.

Prompt engineering is not a bag of magic words; it is a set of techniques, each aimed at a specific failure mode. This is a working reference: what the technique is, the problem it solves, and a one-line example.

Techniques for controlling output

1. Role prompting

Assign a persona to pull vocabulary and rigour in the right direction. “You are a careful clinical pharmacist” produces a different, more precise answer than no role at all.

2. Few-shot examples

Provide two to five input → output examples. The model pattern-matches to your examples, which is the most reliable way to fix format and tone.

3. Output constraints & schemas

State length, format, and structure explicitly. For automation, demand “valid JSON matching this schema” and supply the schema. This removes most downstream parsing failures.

4. Delimiters

Wrap data in triple quotes, fences, or tags so the model never confuses your content with your instructions.

Techniques for better reasoning

5. Chain-of-thought

Ask the model to reason step by step before answering. Best for maths, logic, and multi-step tasks. Full detail in our chain-of-thought guide.

6. Decomposition

Break a big task into named sub-tasks the model tackles in order. “First outline, then draft each section, then tighten” beats “write the whole thing.”

7. Self-critique

Have the model produce a draft, critique it against a rubric, then revise. A second pass catches errors the first one missed.

8. Plan-then-execute

Ask for a plan first, approve or adjust it, then have the model carry it out. Useful for long or risky tasks where a wrong start is expensive.

Techniques for accuracy & grounding

9. Grounding in source text

Supply the source and instruct “answer only from the text; if it is not there, say so.” The most effective single defence against made-up facts.

10. Citation forcing

Require the model to quote the exact sentence it relied on before stating a conclusion. Quoting keeps long-context answers honest.

11. Temperature control

Lower the temperature for deterministic, factual tasks; raise it for brainstorming. Not strictly a prompt, but it shapes how your prompt behaves.

12. Negative constraints

State what to avoid: “no jargon, no hedging, do not invent statistics.” Telling the model what not to do is as useful as telling it what to do.

Combine, don’t collect. The strongest prompts stack techniques: a role, a few-shot example, a schema, and a grounding instruction in one prompt. The art is choosing which failure modes you are defending against.

Putting it into practice

Start from a working template rather than a blank page. Our best work prompts already combine several of these techniques, and the GeraPrompts marketplace publishes prompts with their benchmark results so you can see which techniques pay off.

Frequently asked questions

Which prompt engineering technique should I learn first?
Few-shot prompting — adding two to five worked examples of the exact input and output you want. It is the fastest way to lock down format and style, and it works on every model.
What is the difference between few-shot and chain-of-thought prompting?
Few-shot prompting shows the model examples of the finished output. Chain-of-thought asks the model to reason step by step before answering. They are complementary: few-shot controls the format, chain-of-thought improves the reasoning.
Do these techniques work on all AI models?
The core techniques — role, few-shot, chain-of-thought, output constraints, grounding — transfer across GPT-4, Claude, Gemini, and open-weights models. Only the formatting conventions (such as Claude favouring XML tags) differ.

Put it into practice

GeraPrompts is a marketplace of vetted, benchmarked prompts you can run on any model — and where creators keep 85% of every sale.

Related guides