{"course":{"slug":"prompting","title":"Getting Real Work out of a Model","url":"https://addaly.com/learn/prompting","level":"beginner","track":"start"},"lesson":{"slug":"rules-and-examples-together","title":"State the rule, then show it","url":"https://addaly.com/learn/prompting/rules-and-examples-together","position":23,"of":72,"minutes":8,"answer":"A rule says what an example is an example of, and an example says what a rule means in the hard case.","keyIdea":"A rule says what an example is an example of, and an example says what a rule means in the hard case, so write the rule first and annotate each example with the reason for its label."},"body":{"format":"markdown","text":"## Neither alone is as good as both\n\nA stated rule generalises but is often imprecise. An example is precise but does not tell you what it is an example *of*. Put them together and each covers the other's weakness.\n\nRule alone:\n\n> Classify by what the customer is asking for, not by what went wrong.\n\nClear, and it leaves you wondering how it applies to a parcel that arrived smashed.\n\nExample alone:\n\n```\n\"My parcel arrived smashed and I want my money back.\" → refund\n```\n\nPrecise, and the model has to infer why. It might infer your rule. It might infer \"anything mentioning money is a refund\", which will fail on the next message.\n\nTogether:\n\n```\nClassify by what the customer is asking for, not by what went wrong.\n\n\"My parcel arrived smashed and I want my money back.\" → refund\n   (damage is what went wrong; money is what they want)\n```\n\nNow the example demonstrates the rule and the annotation names the reasoning, so it transfers to cases you never showed.\n\n## Annotate the label, not the input\n\nThe parenthetical is doing real work, and it is the part most people leave out. A one-line reason attached to each awkward example is the cheapest generalisation you can buy.\n\nThis matters most where two examples look similar and get different labels. Without a reason, that pair looks like noise, and inconsistent-looking examples do more harm than no examples at all.\n\n```\n\"Cancel my order, it's late.\"            → cancellation (they want it stopped)\n\"Where is my order? It's late.\"          → delivery      (they want information)\n```\n\nTwo nearly identical inputs, two labels, one word of explanation each. That pair teaches more than six unannotated examples.\n\n## Which to write first\n\nWrite the rule first, always, even if you end up deleting it.\n\nTrying to state the rule is how you find out whether one exists. Sometimes you write it in a sentence and discover you do not need examples. Sometimes you get three clauses in, hit a case the rule cannot cover, and you have found exactly the example to show. Either outcome is progress, and you cannot get either by starting with examples.\n\n## When the rule cannot be written\n\nSome things resist statement. House tone. What counts as \"too salesy\". Which level of detail your director wants. Whether a photo is on-brand.\n\nHere, show and *approximate*. Give the examples, then state the rule as best you can, marked as approximate:\n\n> These three replies are the tone we want. Roughly: warm, no exclamation marks, no apology unless we were at fault, first names, under 100 words. The examples take priority where my description and they disagree.\n\nThat last clause matters. You have told the model which source wins, which stops it splitting the difference between your imperfect description and your accurate demonstration.\n\n## The same structure works for output shape\n\n```\nOutput one line per row: `date | supplier | amount | VAT included?`\nDates as YYYY-MM-DD. Amounts with no currency symbol and no\nthousands separator. If VAT is not stated, write `unknown`.\n\n2026-03-14 | Adeyemi Ltd | 45200.00 | unknown\n```\n\nRule, then one instance. The instance settles a dozen small questions the rule left open (spacing around the pipes, decimal places, capitalisation) that you would otherwise discover as inconsistencies in row 40.\n\n> Figure: The compact form of a working prompt. Layers, top to bottom: The rule (one or two sentences; generalises to cases you never showed); Two to four annotated examples (awkward ones, each with a short reason for its label; pins the hard cases); The fallback (what to do when neither the rule nor an example covers it). Under two hundred words. Each part does a different job, so nothing is repeated and nothing competes. When a prompt seems to need lengthening, ask which of the three is missing; usually it is the fallback, and it is one line.\n\n## The compact form\n\nFor most working prompts, this is the whole pattern:\n\n1. One or two sentences of rule.\n2. Two to four examples, awkward ones, each annotated with a short reason.\n3. One line saying what to do when neither the rule nor an example covers it.\n\nUnder two hundred words, and it outperforms almost anything longer.\n\n## Why this beats a longer prompt\n\nA rule with annotated examples is compact because each part is doing a different job. The rule generalises. The examples pin the hard cases. The fallback covers everything neither reached. Nothing is repeated, so nothing competes.\n\nThe long prompts you inherit are usually long because somebody kept adding restatements of the same instruction in different words, hoping repetition would help. It does not, and it costs you the thing that would have: the third annotated example, or the sentence saying what to do when the rule does not apply.\n\nIf you are ever unsure whether to lengthen a prompt, ask which of the three parts is missing. Usually it is the fallback, and it is one line."},"check":{"question":"Two nearly identical customer messages appear in a prompt with different labels and no explanation. What effect should be expected?","options":[{"text":"The model will infer the distinguishing feature, since near-identical pairs are the most informative kind of example.","correct":false,"tempting":"Near-identical pairs are informative only when the distinguishing feature is named; otherwise the difference is invisible."},{"text":"Worse performance than no examples, because an unexplained contradiction teaches inconsistency rather than a rule.","correct":true},{"text":"Slightly better performance, because the pair demonstrates that the boundary is subtle.","correct":false,"tempting":"Demonstrating that a boundary is subtle without saying where it falls gives nothing to act on."},{"text":"No effect, since two examples out of a longer set are averaged away.","correct":false,"tempting":"Contradictory examples are not averaged away; they undermine the pattern the rest of the set is establishing."}]},"prev":{"slug":"order-balance-and-the-hidden-pattern","title":"What your examples teach by accident","url":"https://addaly.com/learn/prompting/order-balance-and-the-hidden-pattern"},"next":{"slug":"showing-what-not-to-do","title":"Negative examples, and when they backfire","url":"https://addaly.com/learn/prompting/showing-what-not-to-do"},"authorship":"Founder and series editor: Dr Mustafa Mun. Written by AI models to a written standard. Exam keys checked blind by a second model: 3,665 of 3,666 agreed. Academic review invited.","review":{"status":"Draft, open for academic review"},"cite":"Addaly (2026) 'State the rule, then show it', in Getting Real Work out of a Model. Edited by M. Mun. Addaly. Available at: https://addaly.com/learn/prompting/rules-and-examples-together (Accessed: 13 October 2026).","licence":{"name":"CC BY-NC-SA 4.0","url":"https://creativecommons.org/licenses/by-nc-sa/4.0/"},"reader":{"schema":1,"title":"State the rule, then show it","courseTitle":"Getting Real Work out of a Model","module":{"index":3,"slug":"teaching-by-example","title":"Teaching by example"},"answer":null,"keyIdea":"A rule says what an example is an example of, and an example says what a rule means in the hard case, so write the rule first and annotate each example with the reason for its label.","hero":{"kind":"figure","figure":{"t":"figure","label":"Figure","figure":{"type":"stack","title":"The compact form of a working prompt","layers":[{"label":"The rule","detail":"one or two sentences; generalises to cases you never showed"},{"label":"Two to four annotated examples","detail":"awkward ones, each with a short reason for its label; pins the hard cases"},{"label":"The fallback","detail":"what to do when neither the rule nor an example covers it"}],"caption":"Under two hundred words. Each part does a different job, so nothing is repeated and nothing competes. When a prompt seems to need lengthening, ask which of the three is missing; usually it is the fallback, and it is one line."},"alt":"Figure: The compact form of a working prompt. Layers, top to bottom: The rule (one or two sentences; generalises to cases you never showed); Two to four annotated examples (awkward ones, each with a short reason for its label; pins the hard cases); The fallback (what to do when neither the rule nor an example covers it). Under two hundred words. Each part does a different job, so nothing is repeated and nothing competes. When a prompt seems to need lengthening, ask which of the three is missing; usually it is the fallback, and it is one line."}},"blocks":[{"t":"h2","id":"neither-alone-is-as-good-as-both","runs":[{"text":"Neither alone is as good as both"}]},{"t":"p","runs":[{"text":"A stated rule generalises but is often imprecise. An example is precise but does not tell you what it is an example "},{"text":"of","i":true},{"text":". Put them together and each covers the other’s weakness."}]},{"t":"p","runs":[{"text":"Rule alone:"}]},{"t":"quote","runs":[{"text":"Classify by what the customer is asking for, not by what went wrong."}]},{"t":"p","runs":[{"text":"Clear, and it leaves you wondering how it applies to a parcel that arrived smashed."}]},{"t":"p","runs":[{"text":"Example alone:"}]},{"t":"code","lang":"","label":"Text","text":"\"My parcel arrived smashed and I want my money back.\" → refund"},{"t":"p","runs":[{"text":"Precise, and the model has to infer why. It might infer your rule. It might infer “anything mentioning money is a refund”, which will fail on the next message."}]},{"t":"p","runs":[{"text":"Together:"}]},{"t":"code","lang":"","label":"Text","text":"Classify by what the customer is asking for, not by what went wrong.\n\n\"My parcel arrived smashed and I want my money back.\" → refund\n   (damage is what went wrong; money is what they want)"},{"t":"p","runs":[{"text":"Now the example demonstrates the rule and the annotation names the reasoning, so it transfers to cases you never showed."}]},{"t":"h2","id":"annotate-the-label-not-the-input","runs":[{"text":"Annotate the label, not the input"}]},{"t":"p","runs":[{"text":"The parenthetical is doing real work, and it is the part most people leave out. A one-line reason attached to each awkward example is the cheapest generalisation you can buy."}]},{"t":"p","runs":[{"text":"This matters most where two examples look similar and get different labels. Without a reason, that pair looks like noise, and inconsistent-looking examples do more harm than no examples at all."}]},{"t":"code","lang":"","label":"Text","text":"\"Cancel my order, it's late.\"            → cancellation (they want it stopped)\n\"Where is my order? It's late.\"          → delivery      (they want information)"},{"t":"p","runs":[{"text":"Two nearly identical inputs, two labels, one word of explanation each. That pair teaches more than six unannotated examples."}]},{"t":"h2","id":"which-to-write-first","runs":[{"text":"Which to write first"}]},{"t":"p","runs":[{"text":"Write the rule first, always, even if you end up deleting it."}]},{"t":"p","runs":[{"text":"Trying to state the rule is how you find out whether one exists. Sometimes you write it in a sentence and discover you do not need examples. Sometimes you get three clauses in, hit a case the rule cannot cover, and you have found exactly the example to show. Either outcome is progress, and you cannot get either by starting with examples."}]},{"t":"h2","id":"when-the-rule-cannot-be-written","runs":[{"text":"When the rule cannot be written"}]},{"t":"p","runs":[{"text":"Some things resist statement. House tone. What counts as “too salesy”. Which level of detail your director wants. Whether a photo is on-brand."}]},{"t":"p","runs":[{"text":"Here, show and "},{"text":"approximate","i":true},{"text":". Give the examples, then state the rule as best you can, marked as approximate:"}]},{"t":"quote","runs":[{"text":"These three replies are the tone we want. Roughly: warm, no exclamation marks, no apology unless we were at fault, first names, under 100 words. The examples take priority where my description and they disagree."}]},{"t":"p","runs":[{"text":"That last clause matters. You have told the model which source wins, which stops it splitting the difference between your imperfect description and your accurate demonstration."}]},{"t":"h2","id":"the-same-structure-works-for-output-shape","runs":[{"text":"The same structure works for output shape"}]},{"t":"code","lang":"","label":"Text","text":"Output one line per row: `date | supplier | amount | VAT included?`\nDates as YYYY-MM-DD. Amounts with no currency symbol and no\nthousands separator. If VAT is not stated, write `unknown`.\n\n2026-03-14 | Adeyemi Ltd | 45200.00 | unknown"},{"t":"p","runs":[{"text":"Rule, then one instance. The instance settles a dozen small questions the rule left open (spacing around the pipes, decimal places, capitalisation) that you would otherwise discover as inconsistencies in row 40."}]},{"t":"h2","id":"the-compact-form","runs":[{"text":"The compact form"}]},{"t":"p","runs":[{"text":"For most working prompts, this is the whole pattern:"}]},{"t":"ol","start":1,"items":[[{"text":"One or two sentences of rule."}],[{"text":"Two to four examples, awkward ones, each annotated with a short reason."}],[{"text":"One line saying what to do when neither the rule nor an example covers it."}]]},{"t":"p","runs":[{"text":"Under two hundred words, and it outperforms almost anything longer."}]},{"t":"h2","id":"why-this-beats-a-longer-prompt","runs":[{"text":"Why this beats a longer prompt"}]},{"t":"p","runs":[{"text":"A rule with annotated examples is compact because each part is doing a different job. The rule generalises. The examples pin the hard cases. The fallback covers everything neither reached. Nothing is repeated, so nothing competes."}]},{"t":"p","runs":[{"text":"The long prompts you inherit are usually long because somebody kept adding restatements of the same instruction in different words, hoping repetition would help. It does not, and it costs you the thing that would have: the third annotated example, or the sentence saying what to do when the rule does not apply."}]},{"t":"p","runs":[{"text":"If you are ever unsure whether to lengthen a prompt, ask which of the three parts is missing. Usually it is the fallback, and it is one line."}]}],"check":{"question":[{"text":"Two nearly identical customer messages appear in a prompt with different labels and no explanation. What effect should be expected?"}],"options":[{"text":[{"text":"The model will infer the distinguishing feature, since near-identical pairs are the most informative kind of example."}],"correct":false,"tempting":[{"text":"Near-identical pairs are informative only when the distinguishing feature is named; otherwise the difference is invisible."}]},{"text":[{"text":"Worse performance than no examples, because an unexplained contradiction teaches inconsistency rather than a rule."}],"correct":true,"tempting":null},{"text":[{"text":"Slightly better performance, because the pair demonstrates that the boundary is subtle."}],"correct":false,"tempting":[{"text":"Demonstrating that a boundary is subtle without saying where it falls gives nothing to act on."}]},{"text":[{"text":"No effect, since two examples out of a longer set are averaged away."}],"correct":false,"tempting":[{"text":"Contradictory examples are not averaged away; they undermine the pattern the rest of the set is establishing."}]}],"order":[3,2,0,1],"why":null},"prev":{"slug":"order-balance-and-the-hidden-pattern","title":"What your examples teach by accident","minutes":9},"next":{"slug":"showing-what-not-to-do","title":"Negative examples, and when they backfire","minutes":8}}}