Apply to my task
arXiv:2609.03213 ★ 79 Sep 2, 2026

Rules vs. Examples: Why ChatGPT Learns New Tasks Better from Instructions Than from Demonstrations

Key result

Discovered: LLMs are bad at guessing "AND/OR" logic from examples — they either narrow the rule down to a single case or inflate it into nonsense. The direct-rule method lets you teach a model custom classification without hundreds of demonstrations and without the risk that it picks up the wrong pattern. Instead of having the model reverse-engineer the pattern from data points, you state the condition explicitly in words — the model simply follows the instruction instead of guessing it. On compound conditions like "urgent if A OR B, and also C" — accuracy is consistently higher than with examples.

TL;DR

When you're teaching ChatGPT a new task — a custom format, unusual logic, made-up rules — it works better if you explicitly spell out the rule rather than just showing examples and hoping the model figures out the pattern on its own. Researchers compared both approaches on five novel tasks and found: a clear rule almost always beats a set of unexplained examples in accuracy.

The "show examples and the model will get it" intuition doesn't always hold. Models are bad at inferring a rule from examples when the task requires combining conditions — say, "urgent if A OR B, AND also C." That kind of logic is hard to reconstruct from a handful of demonstrations: examples give you data points, not the formula itself. The model ends up guessing a rule that's either too narrow or too broad.

A rule solves this problem simply: it names the condition directly, instead of making the model reverse-engineer it from scattered data. Stacking examples on top of an already-clear rule barely improves results — if the rule is written fully and unambiguously, demonstrations become redundant.


Method Blueprint

APPROACH 1 (rules): Describe the logic and format in words → the model applies it to a new case
APPROACH 2 (examples): Show 5-10 input-output pairs with no explanation → the model guesses the rule itself
APPROACH 3 (combo): Rule + examples together → barely better than the rule alone

All of this happens in a single prompt — no iterations, no separate follow-up requests.


Example in Practice

Task: You want to teach ChatGPT to triage support tickets using a custom priority logic — not the standard "complaint = urgent" — but based on your own business criteria.

Prompt (the version that works — using a rule):

Classify the customer ticket as URGENT or NORMAL using this rule:

The ticket is URGENT if:
(the customer mentions "financial loss" OR "legal risk")
AND
the tone of the message is aggressive or distressed.

In all other cases — NORMAL.

Response format: only the word URGENT or NORMAL.

Customer ticket: {ticket text}

The less reliable version (using examples):

Here are 10 example tickets with urgency labels:
[10 "text — label" pairs with no explanation of the logic]

Classify this ticket: {text}

Result: The rule-based version consistently handles edge cases correctly — for example, an aggressive tone with no mention of money or legal risk. The example-based version stumbles more often on exactly these "compound" conditions (AND/OR), because the model isn't seeing the logic directly — it's reconstructing it from a limited set of data points.


Why This Works

When a model learns from examples, it has to guess the hidden rule — like a game of "spot the pattern." That works fine when the rule is simple (one variable, a familiar category). But when the task requires combining several conditions — like a multi-step arithmetic operator or AND/OR logic — guessing the formula from a few examples gets hard: the examples simply don't cover the whole space of possibilities.

One of the strengths of modern LLMs is that they're good at following explicitly stated instructions. This is specifically reinforced through instruction tuning: models are trained to obey verbal rules.

The method simply removes the need to guess: instead of making the model reverse-engineer the logic from data, you hand it the ready-made formula. That's where the effect comes from — a rule gets to the target more directly than a pile of examples.

Control levers: - Complexity of the condition's logic (how many AND/OR combinations) → the more complex the condition, the bigger the payoff from an explicit rule - Reliance on the model's "general knowledge" (jargon, cultural categories, language patterns) → here a rule barely helps; examples do just as well - Number of examples stacked on top of the rule → feel free to cut these if the rule is written clearly — it saves prompt space with no quality loss


Prompt Template

Perform the task according to the following rule. Don't rely on guessing — the rule describes the logic completely.

RULE: {describe the exact condition, including any AND/OR combinations, if applicable}
RESPONSE FORMAT: {describe exactly what the output should look like}

Input data: {your data}

🚀 Quick start — paste into the chat:

Here's a template for teaching the model via an explicit rule. Adapt it to my task: {your task}.
Ask me questions to fill in the fields.

[insert the template above]

The LLM will ask what logic underlies the classification/task (conditions, formats, edge cases) — because the method only works if the rule is described fully and unambiguously.


Limitations

⚠️ "Gut feel" tasks don't benefit from rules: if the task relies on categories the model already knows (language patterns, established associations, "industry jargon") — a rule gives almost no advantage. Examples work just as well, because the model already "knows" these categories from training.

⚠️ A bad rule is worse than none: if the rule is written vaguely or incompletely, it won't save your results. The rule needs to be tested and unambiguous — otherwise there's no gain.

⚠️ Stacking examples on top barely helps: if the rule is already clear, extra demonstrations in the prompt just waste space without adding accuracy.


How It Was Studied

The team invented five novel tasks across different domains — from a card game about finding a "set," to a 3×3-grid board game, to a made-up mathematical operator and an artificial language with grammatical agreement. Each task was given to the model three ways: rule only, examples only, and rule plus examples together — on identical test cases.

They tested several model families (Gemma 3, Qwen 2.5/3, OLMo 3) at different sizes, using GPT-5.4 as a reference point for comparison. Result: rules beat examples on almost every task, especially where algebraic logic is needed — step-by-step calculations, combining conditions with AND/OR. The gap shrinks or disappears where the task relies on "gut feel" — grammar or familiar semantic categories.

Surprisingly, adding examples on top of an already-clear rule barely improved accuracy — and neither did simply piling on more examples. Instruction-tuned models amplified the advantage of rules, but didn't lose their ability to learn from examples.

Research digest

Key result

Discovered: LLMs are bad at guessing "AND/OR" logic from examples — they either narrow the rule down to a single case or inflate it into nonsense. The direct-rule method lets you teach a model custom classification without hundreds of demonstrations and without the risk that it picks up the wrong pattern. Instead of having the model reverse-engineer the pattern from data points, you state the condition explicitly in words — the model simply follows the instruction instead of guessing it. On compound conditions like "urgent if A OR B, and also C" — accuracy is consistently higher than with examples.

Principle

Simple rule: if the logic is simple (one category, a familiar pattern), examples work fine. But as soon as a compound condition with AND/OR appears, the model starts to get confused — deciding either too narrowly or too broadly. Give it the rule in words, and guessing becomes unnecessary altogether. Stacking examples on top of an already-clear rule is nearly pointless — they just eat up space in the prompt.

Why it works

The reason is simple: models are specifically fine-tuned to follow verbal instructions (this is called instruction tuning). Guessing a rule from examples is like solving a crossword from three letters: possible if the word is short, impossible if there are many conditions. An explicit rule removes the guessing step entirely — the model applies a ready-made formula immediately instead of assembling it from fragments. The exception is tasks that rely on "feel for language": jargon, established associations. There, the rule barely helps, because the model already knows these categories from training.

When to apply

Custom classification and labeling → especially ticket prioritization, content moderation, and data sorting by your own business criteria, when the logic depends on several AND/OR conditions. Not suitable if the task relies on the model's linguistic intuition — industry jargon, cultural associations, established patterns — there, the rule and examples produce the same result.

Mini recipe

1. Describe the rule in words: explicitly spell out all the ANDs/ORs, don't leave edge cases to guesswork. 2. Specify the exact response format: a single word or a clear structure — no room for improvisation. 3. Manually test the rule on 2-3 cases: if you get confused by your own wording, the model will too. 4. Don't add examples "just in case": if the rule is clear, demonstrations only bloat the prompt without adding value.

Examples

[BAD]: `Here are 10 examples of tickets with urgency labels: [list of text-label pairs]. Classify this: {text}` [GOOD]: `A ticket is URGENT if (it mentions "financial loss" OR "legal risk") AND the tone is aggressive or anxious. In all other cases — NORMAL. Answer: only the word URGENT or NORMAL. Ticket: {text}`

In plain words

Most people think a model will just "figure it out" if you bury it in examples. That's nonsense: an LLM isn't a mind reader, it's a statistical calculator. When you only feed it "question-answer" pairs without spelling out the logic, you're forcing it to play a guessing game. That works fine for dead-simple templates, but throw in any compound conditions and the model starts tripping over itself, spitting out total nonsense.

It's like training a new cook: silently plate five finished dishes in front of them and expect them to reverse-engineer your signature sauce. "You saw the plate, what's not to get?" Naturally, they dump in sugar instead of salt, because nobody ever said the hidden formula out loud, and you can't eyeball exact proportions from a photo.

What actually works: declarative rules instead of blind few-shot prompting. Researchers ran tests across 5 non-standard tasks and proved that spelling out the logic directly almost always beats a pile of examples, hands down. Don't make the model infer the pattern from data — just write the branching logic outright: "if conditions X and Y are met, then do Z."

They tested this on synthetic tasks, but the principle is universal. Custom support-ticket routing, lead scoring in a CRM, parsing messy documents — anywhere nontrivial business logic is at play, throwing context-free examples at the problem is money down the drain. Rules beat examples, because examples can never physically cover every edge case.

Bottom line: stop stuffing your context window with walls of sample dialogue and hoping for model magic. Spell out a step-by-step procedure with hard constraints right in the task text. Clear rules save tokens and prevent mistakes — meanwhile, the fans of learning-by-blind-example can keep wondering why the bot screwed up again.

AI lab assistant

Apply this study to your task

Describe what you're working on. AI takes the method and the measured results from this paper and adapts them to your case, or writes a ready prompt built on them.

Based on Rules vs. Examples: Why ChatGPT Learns New Tasks Better from Instructions Than from Demonstrations arXiv:2609.03213

Sign in to apply this study New accounts get 50 free credits.