Don't Use Examples When Prompting Large Language Models
Written in December 2026
For years now, people on the Internet and in workshops have recommended putting examples in prompts for large language models. The advice has become as common as telling a model to assume a persona. Today I’m telling you the opposite: do not use examples in your prompts.
This matters most for functional LLM calls inside software, but it also matters when you’re just talking to a model. I’ll first explain why I’m so opposed to examples, and then give tips for working around them when you talk to chatbots or to agents built on large language models.
A few months ago it began to dawn on me that when I discussed something with a coding agent or a chatbot, I would bring up or explore examples; you know, as humans do. Afterwards I’d find it very hard to steer the conversation away from those concrete examples and towards the abstract idea underneath them.
While people were taught to include examples in their prompts, I have been telling people in workshops for years to have large language models write prompts for large language models, because they are very good at it. I still stand by that, even with the latest models of 2026. But I have also noticed something problematic, and it shows up all the time. Whenever a coding agent writes a prompt for a model call in an app, or instructions for a subagent, or a skill file (or similar), it leans heavily on examples, positive and negative. I haven’t measured it, but my impression is that this happens every single time. I believe that this is bad. In my experience it leads the model to overfit hard on the examples and miss the forest for the trees.
A few weeks ago it occurred to me that this should be easy to test, and today, I finally sat down, took one of my datasets and tried it.
The setup
The task is one large language models are great at: turning unstructured data into structured data. I used my dataset of meal nutrient estimates. It’s a good test because it is fairly complex and multimodal.
To have a model turn unstructured data into structured data, you usually give it a schema, in XML, JSON or something similar. The schema defines which fields exist and what values they can take, and marks some fields as optional and others as required. So far, so good. Then come the examples.
For the experiment, I ran the same prompt without examples and with them. Some sets of examples were built to bias the model towards certain ranges of values. Others were built to bias it towards filling in or leaving out the optional fields. I ran all of this on 128 meals from my dataset; small, I know, but I just wanted to test my hunch.
- 128 meals from my dataset, each with a photo and logged amounts. Three estimates per meal and condition.
- The example, appended to the system prompt: pasta with tomato sauce, 180 g, 650 kcal.
- Conditions: no example; the example; every number doubled; every number halved; optional fields filled; optional fields empty; the doubled example labelled as a wrong answer.
claude-haiku-5-5andclaude-sonnet-5-5, each on all seven conditions. Effortlow, JSON schema output, 5376 calls.- Shift: how much the estimates for the same meal change between two conditions, averaged over all 128 meals. In brackets: the range the result stays in 95% of the time when the meals are resampled.
Results
When I test a hypothesis like this, I usually expect the first results not to support it; then I have to rethink my view and work out where my intuition went wrong. Not in this case, though. Examples bias the model substantially, which fits my experience of performance degrading when they are used.
| Comparison, same 128 meals | Measure | Haiku 5.5 | Sonnet 5.5 |
|---|---|---|---|
| Doubled example vs halved example | Energy | +13.9% [+10.6, +17.0] | +8.5% [+7.1, +9.9] |
| Protein | +15.6% [+11.4, +20.0] | +12.8% [+4.7, +21.9] | |
| Grams | +12.7% [+10.5, +15.0] | +9.4% [+7.8, +11.0] | |
| One example vs no example | Energy | +3.9% [+1.7, +6.6] | +4.7% [+3.2, +6.4] |
| Doubled example, labelled wrong, vs no example | Energy | +5.2% [+2.6, +7.5] | +4.6% [+3.3, +6.0] |
Table 1. Shift of the estimate between two conditions on the same meals. Energy rows: Holm-corrected p < 0.001.
| Model | Condition | Energy error | Energy vs no example | MAE kcal | MAE vs no example |
|---|---|---|---|---|---|
| Haiku 5.5 | No example | +3.6% [-5.4, +13.8] | baseline | 170 | baseline |
| Example | +10.8% [-0.8, +24.7] | +3.9% [+1.7, +6.6] | 177 | +7 [-3, +19] | |
| Doubled | +14.8% [+3.3, +27.9] | +9.0% [+6.2, +11.5] | 174 | +4 [-9, +17] | |
| Halved | -0.3% [-9.1, +9.5] | -4.3% [-5.9, -2.6] | 179 | +9 [+1, +18] | |
| Optional fields filled | +5.9% [-3.5, +16.2] | +2.2% [-0.2, +4.3] | 165 | -5 [-13, +2] | |
| Doubled, labelled wrong | +11.7% [-0.3, +25.8] | +5.2% [+2.6, +7.5] | 175 | +6 [-5, +17] | |
| Optional fields empty | +7.1% [-2.9, +17.9] | +2.8% [+0.3, +4.9] | 168 | -2 [-10, +6] | |
| Sonnet 5.5 | No example | -7.0% [-12.9, -0.6] | baseline | 145 | baseline |
| Example | -2.0% [-8.5, +4.6] | +4.7% [+3.2, +6.4] | 144 | -1 [-7, +5] | |
| Doubled | +0.1% [-6.1, +6.8] | +7.5% [+6.1, +9.1] | 136 | -10 [-17, -2] | |
| Halved | -7.5% [-13.5, -1.1] | -0.8% [-2.2, +0.5] | 151 | +6 [+1, +11] | |
| Optional fields filled | -2.8% [-9.2, +4.2] | +4.0% [+2.7, +5.3] | 144 | -1 [-7, +5] | |
| Doubled, labelled wrong | -2.6% [-8.9, +4.0] | +4.6% [+3.3, +6.0] | 138 | -7 [-13, -2] | |
| Optional fields empty | -3.4% [-9.6, +3.1] | +3.6% [+2.4, +4.8] | 142 | -4 [-9, +2] |
Table 2. Energy error against logged amounts, and mean absolute error in kcal. "vs no example": paired over the same 128 meals, energy as mean log ratio, MAE as mean difference in kcal, 95% intervals from resampling the meals.
| Condition | Haiku 5.5 | vs no example | Sonnet 5.5 | vs no example |
|---|---|---|---|---|
| No example | 10% | baseline | 5% | baseline |
| Example | 7% | -3 pp | 0% | -5 pp |
| Optional fields filled | 15% | +5 pp | 7% | +2 pp |
| Optional fields empty | 12% | +2 pp | 1% | -4 pp |
Table 3. Share of answers that filled the optional `nutrition_basis` field. Filled vs example, McNemar: Haiku 13 meals against 2, Holm-corrected p = 0.052; Sonnet 9 against 0, p = 0.031. Holm runs over the eight fill-rate comparisons.
What I recommend
Don’t use examples at all. I would need to see proof that they are worth the tokens they take up before reconsidering. Even where the bias they introduce is acceptable, examples don’t improve the output beyond hammering that bias in. If you do use examples, at least be aware of the problems they bring.
When you write a prompt yourself, this is easy: you just leave the examples out. But how do you stop a coding agent from adding them? Examples seem to run so deep in these models’ post-trained nature, that rules and instructions won’t keep them out. In the following I share two things I use, and you’re welcome to use them too.
A hook. I set up a hook for Claude Code that makes a cheap Haiku call whenever the main agent modifies an instruction or rule file, and blocks the edit when it tries to add examples. I feel it fires on pretty much every edit. It seems like whenever the agent writes anything more than a tiny change, there is an example in it. This hook has helped me enormously and made my workflows far better.
~/.claude/hooks/rule_examples.py:
"""PreToolUse on Write|Edit: deny a write that adds example markers to a rule file.
Counts markers in the text being replaced and in the new text, so existing
wording is left alone and only additions are refused.
"""
import json
import os
import re
import sys
RULE_FILE = re.compile(r"/.claude/projects/[^/]+/memory/|/CLAUDE.md$|/AGENTS.md$|/SKILL.md$")
MARKER = re.compile(
r"e.s?g.|for (?:example|instance)|such as",
re.IGNORECASE,
)
def main() -> None:
payload = json.load(sys.stdin)
tool_input = payload.get("tool_input", {})
path = tool_input.get("file_path", "")
if not RULE_FILE.search(path):
return
if payload.get("tool_name") == "Write":
new = tool_input.get("content", "")
old = open(path, encoding="utf-8").read() if os.path.exists(path) else ""
else:
new = tool_input.get("new_string", "")
old = tool_input.get("old_string", "")
if len(MARKER.findall(new)) <= len(MARKER.findall(old)):
return
print(json.dumps({
"hookSpecificOutput": {
"hookEventName": "PreToolUse",
"permissionDecision": "deny",
"permissionDecisionReason": (
"This write adds an example marker to a rule file. "
"State the rule as a principle without examples, then write again."
),
}
}))
if __name__ == "__main__":
main() ~/.claude/settings.json, with one prompt-hook entry per if pattern: Edit and Write on **/CLAUDE.md, **/AGENTS.md, **/SKILL.md and ~/.claude/projects/*/memory/**.
{
"hooks": {
"PreToolUse": [
{
"matcher": "Write|Edit",
"hooks": [
{
"type": "command",
"command": "uv run --no-project -q python -I ~/.claude/hooks/rule_examples.py",
"timeout": 20
},
{
"type": "prompt",
"model": "claude-haiku-5-5",
"prompt": "You review one edit to a rule file for Claude agents.\n\n<edit>\n$ARGUMENTS\n</edit>\n\nJudge only the text the edit adds: for Edit, what new_string contains beyond old_string; for Write, the whole content.\n\nA rule states its principle and scope in general terms. The added text breaks this if it contains an example: a particular case the rule covers, included so the reader can infer the general rule from it. A particular the reader must use or act on belongs to the rule. A particular that stands in for other cases the rule also covers is an example.\n\nReturn ok true if the added text contains no example. Return ok false with a reason that quotes the offending phrase and names the principle it stands for, without proposing replacement wording.\n",
"if": "Edit(**/CLAUDE.md)",
"timeout": 30,
"continueOnBlock": true,
"statusMessage": "Checking rule text for examples"
}
]
}
]
}
}A skill. The second is a small skill I trigger by saying I want to distill something. I use it when I discuss or describe an idea and have used examples, whether explicit, concrete ones or descriptions that work like examples. I say “distill”, the agent loads the skill, and it turns the discussion into something useful. Since I wrote this skill, I have used it all the time. My impression is that it has made a huge difference. I finally feel I can express my train of thought without sending the agent down some specific rabbit hole.
~/.claude/skills/distill/SKILL.md:
---
name: distill
description: A method for reducing anything the user passes on to its essence before anything is built from it. Use when the user says "distill", whenever they share input to be understood rather than executed, and before their words are written into any artifact.
---
# Distill
Reduce what the user gives you to the mechanism underneath it, place that in the larger goal, and only then derive what follows. Transcribing the user's words, or turning them straight into an artifact change, is the failure this method exists to prevent.
## Steps
1. **Read the existing situation first:** the written record of the work and the positions of everyone involved. The essence is judged against the real situation, not against the sentence alone.
2. **State the point in your own words**, in one sentence: what it is about and what problem it shows.
3. **Name the mechanism.** Find the single principle that produces the individual points. Show how each point follows from it, and name any point that does not fit, since that one is either a second idea or a mistake.
4. **Place it in context.** Which goal it serves, what it changes in the work as a whole, what already covers it, and what it conflicts with. A proposed new path beside an existing one is a warning sign.
5. **Hold the user's concrete items as a working frame.** Things the user named on the spot are starting points to test and extend, never a specification. Record each with what checking it needs.
6. **Derive the consequences last.** Any change to the work comes only as a conclusion of the steps above, ranked by effect.
## Output
Short, in this order:
- **Essence:** one or two sentences.
- **Mechanism:** the principle, and how the points fall out of it.
- **Implications:** what changes, ranked.
- **To check:** the open questions, each with the source that would settle it.
When the result is written down anywhere, record the essence and the working frame, not the user's phrasing as settled fact. Delegated work is briefed only after the essence exists.