LLMs Learn Better In-Context from Rules than from Examples
TL;DR Highlight
Describing rules in the prompt beat few-shot examples by 17 accuracy points on average.
Who Should Read
An LLM app developer who stuffs long few-shot examples into prompts, gets inconsistent results, and wants to restructure them.
Core Mechanics
- Rules beat examples
- Open-weight models (7B–32B) were more accurate with rules only than with examples only.
- Five tasks across games, arithmetic and linguistic inference used the same test items.
- Adding examples to rules doesn't help
- Rules plus examples was not significantly better than rules alone.
- The pattern held across all tasks.
- More examples don't reliably help
- Many task/model combinations showed flat or negative gains versus rules as examples scaled up.
- Instruct models fell into long repetitive pattern analysis with many examples and got truncated.
- Rules help some tasks more
- Gains were largest for Operator Function (sequential operations) and Set Game (same/different judgments).
- Gains were small or not significant for Lexical Category Inference, which relies on parametric knowledge.
- Instruction tuning boosts rules only
Evidence
- Rules vs examples +0.171
- In the mixed-effects model (LMM), rules beat examples by 0.171 accuracy (p<.001).
- Per task: Operator Function +0.401, Set Game +0.319, Noun Class Agreement +0.208.
- Examples on top of rules: +0.012
- Combined beat rules-only by just 0.012, not significant.
- Per-task differences ranged from -0.044 to +0.064.
- Instruction tuning effect
- Instruct vs base: +0.213 with rules and +0.178 with combined (both p<.001).
- With examples it was -0.024, not significant.
- Difficulty and model size
- Versus easy, medium dropped -0.073 and hard -0.150, with nearly parallel slopes across the three conditions.
- Larger models (14–32B) beat smaller ones (7–12B) by +0.063 to +0.064.
How to Apply
- Rewrite a few-shot prompt as rules today
- Pick one example-heavy prompt and write the input format, output format and decision criteria as numbered rules.
- Compare accuracy against the old prompt on the same 20–50 test cases.
- Spell out output format and edge cases
- Add one line each for label set, output format and exceptions you used to convey by example.
- The paper's rule prompts also stated the allowed answer format.
- Sort tasks by whether rules help
- For calculation, logical conditions and step-by-step procedures, start with rules.
- For tasks needing semantic knowledge or stylistic feel, rule gains may be small, so A/B test.
- Measure before adding more examples
- Run rules-only and rules+examples on the same eval set and drop the examples if no difference.
- You also save tokens.
Try It
# Paste into Claude/ChatGPT (simplified version of the paper's method: rules vs examples)
Process the same input {{test input}} with each of the two prompts below and compare the results in a table.
[Prompt A: rules only]
Task: {{task description}}
Rules:
1. {{rule 1}}
2. {{rule 2}}
3. {{exception/edge case}}
Output format: {{allowed answer format}}
Input: {{test input}}
[Prompt B: examples only]
{{input1}} → {{output1}}
{{input2}} → {{output2}}
{{input3}} → {{output3}}
{{test input}} →
Next to try: also run a version C that adds B's examples to A, and see whether it differs from A.Terminology
Related Papers
AI is a tool and using it well takes skill
A rebuttal to Hickey: LLMs are tools, and skill in directing and checking them decides the outcome
Reflective Prompt Optimization of a Deep-Research Agent: A Topic-Disjoint, Multi-Seed Protocol for Measuring Transferable Gains and Prompt-Level Overfitting
Reflective prompt optimization raised held-out citation reward from 0.702 to 0.781 on a deep-research agent.
GPT‑6 and Intelligent UI for everyone
GPT-6 reportedly adds generated UI to chat; with no article text, only comment reactions are available.
Base Models Can Reason By Taking a Cue From Training Data
Prefilling just two opening tokens lifted Olmo-3-7B's MATH-500 accuracy from 42% to 78%.
Labels Override Definitions in Jev-Style Typed Decision Models
Renaming options to A/B raised routing accuracy by +0.1511 over meaningful labels.
How Much Prompt Is Enough? A Blackbox Minimization of Few-Shots in LLMs
Delta debugging trimmed few-shot prompts by 65.3% on average with unchanged propositional output
Related Resources
Original Abstract (Expand)
Large language models (LLMs) exhibit in-context learning capabilities, where they can learn new tasks from prompt contexts without weight updates. We compare the learning efficacies of two prominent modes of in-context learning: (1) learning from descriptions of rules (instruction following); and (2) learning from examples of input-output demonstrations (few-shot prompting). Through five learning tasks that cover diverse domains (games, arithmetic, linguistic inferences), we compare two modes of learning (rules vs. examples) specifying the same underlying task. We furthermore explore model and task properties that modulate the learning efficacies. We find that models generally learn more reliably from rules than from examples alone, and additional examples on top of rules or simply scaling up the number of examples do not lead to consistent and significant gains. Instruction tuning amplifies the benefit of rule-based learning while keeping example-based learning capacities intact. Surprisingly, we find no privileged effect of example-based learning in base models, and rules still lead to gains in algebraic task domains. Overall, the comparative efficacy of rules over examples is larger when the task recruits algebraic abstractions and computations, and smaller when the task requires distributional sensitivity and/or recruits parametric knowledge.