Prompt engineering techniques
Which prompt engineering techniques still work, and which Anthropic, OpenAI and Google now advise against on reasoning models, with a table matching each to a problem.
The prompt engineering techniques that hold up across models are clear instructions, labeled sections, a few good examples, long inputs placed before the question, a stated output format and splitting big tasks into steps. Techniques built for older models, such as “think step by step” and prefilled replies, now do little or cause errors on current reasoning models. Which technique to use depends on the problem and on whether the model reasons internally.
This page covers techniques. For the definition and the test-and-iterate loop, see prompt engineering.
Techniques that hold up across providers
Give each kind of content its own label. Anthropic says XML tags help Claude parse prompts unambiguously when a prompt mixes instructions, context, examples and variable input, and advises consistent tag names. OpenAI’s reasoning guide recommends delimiters such as markdown, XML tags and section titles.
Put long input first and the question last. Anthropic advises placing long documents near the top, above the query, instructions and examples. Google says to supply large context first and put the specific question “at the very end of the prompt.” Google adds that reordering content can sometimes change the response.
Show examples, and keep them few. Anthropic says a few well-crafted examples improve accuracy and consistency, and that they should be relevant, diverse and wrapped in <example> tags, with 3 to 5 working best. Google recommends always including few-shot examples, and warns that too many can make the model overfit. It also says to keep structure and whitespace consistent across them. More in few-shot prompting.
Say what you want, not what to avoid. Anthropic’s formatting advice is to replace “Do not use markdown” with a description of the output you do want, such as flowing prose paragraphs. Google says you can specify the response format, such as a table or list, directly in the instructions. When you need a machine-readable shape, see structured output.
Set a role or standing rules once. Anthropic says a role in the system prompt focuses behavior and tone, and that even one sentence helps. See system prompt for where each provider puts it.
Split big tasks. Google describes three ways: one prompt per instruction, chaining steps so each output feeds the next, or running parts in parallel and aggregating. Anthropic says explicit chaining is still useful when you need to inspect intermediate outputs or enforce a fixed pipeline.
Techniques that changed on reasoning models
Reasoning and thinking models produce their own chain of thought before answering, so three older techniques now differ by model type.
| Technique | Older, non-reasoning models | Reasoning or thinking models |
|---|---|---|
| Step-by-step prompting | Asking for steps was the standard way to get reasoning. | OpenAI’s reasoning guide says “think step by step” is unnecessary and may not help, and can sometimes hinder. Google says asking for visible reasoning is generally not necessary on Gemini 2.5 and 3. |
| Few-shot examples | Recommended by all three providers. | OpenAI says these models often do not need them and to try without first. Anthropic says examples still work with thinking and shape how Claude approaches similar problems. |
| Detailed procedure in the prompt | OpenAI says GPT models benefit from explicit instructions on how to do the task. | OpenAI says reasoning models do better with high-level guidance and “straightforward prompts”. |
| Prefilled reply | Start the answer yourself to force a format. Google still describes prefixes. | Anthropic no longer supports prefill on the last turn starting with Claude 4.6 models, and requests that use it return a 400 error. |
Anthropic keeps manual chain-of-thought as a fallback for when thinking is off. On its newest models it says a prompt that asks the model to write out its reasoning in tags might be declined, so it advises relying on thinking at a lower effort level when cost or latency matters. For the research behind chain of thought and when it still helps, see chain-of-thought prompting.
Emphasis has a similar problem. Anthropic notes that Claude Opus 4.5 and 4.6 respond more strongly to the system prompt than earlier models, so a line like “CRITICAL: You MUST use this tool when…” can now cause overuse. It suggests plain wording such as “Use this tool when…”.
Which technique for which problem
| Problem | Try | Source |
|---|---|---|
| Output format or tone is inconsistent | A few diverse examples, a stated format | Anthropic |
| The model mixes up instructions and data | Labeled sections or delimiters | OpenAI |
| Long document, vague answer | Document first, question last | |
| Multistep task fails partway | Split into chained prompts you can inspect | Anthropic |
| Math or code answers contain errors | Ask the model to check its answer against your criteria | Anthropic |
| Missing facts the model cannot know | Add retrieved context to the prompt | OpenAI |
| Same prompt costs too much per call | Put reusable content at the start of the prompt for caching | OpenAI |
| Wording changes keep failing | Rephrase or reorder, then search systematically with prompt optimization |
Anthropic says that appending a request to verify the answer against test criteria catches errors reliably, especially in coding and math. It makes an exception for Claude Opus 5, which verifies its own work well, so carried-over instructions can cause over-verification and extra latency. A prompt tuned for one model can therefore be wrong for the next, which is why OpenAI advises pinning production applications to specific model snapshots.
When a prompt grows past instructions into tools, retrieved data and history, the work is context engineering.
Testing a technique before you keep it
Every technique above is a hypothesis about one model. The provider guides disagree on examples and step-by-step prompting partly because the models differ. Run each change on the same set of inputs and compare scores before adopting it, and run it again when you switch models. See LLM evaluation and prompt versioning.
In HoneyHive, the Playground lets you create, test and version prompts and compare models. Offline experiments on a dataset compare prompt versions and catch regressions before deploy.
FAQ
What are the most useful prompt engineering techniques?
Clear instructions, labeled sections, a few representative examples, long inputs placed before the question, an explicit output format and splitting big tasks into steps. The Anthropic, OpenAI and Google guides each recommend several of them. See prompt engineering for the definition.
Should I still tell the model to think step by step?
Not on reasoning models. OpenAI's reasoning guide says to avoid chain-of-thought prompts because these models reason internally, and that they can sometimes hinder performance. See chain-of-thought prompting.
How many examples should a prompt include?
Anthropic suggests 3 to 5. Google warns that too many examples can lead to overfitting. OpenAI says reasoning models often do not need examples. See few-shot prompting.
How do I know a technique helped?
Run the old and new prompt on the same set of test inputs and compare scores. OpenAI recommends building tests and evaluation suites that measure prompt behavior. See LLM evaluation.