Hypothetical scenario. Northwind now retains the source behind extracted evidence. Maya asks a policy question, but the assistant supplies a polished answer to a broader question. Dev proposes adding demonstrations. Priya wants the team to agree which behavior those demonstrations should teach.
Maya: “It explained the general policy instead of checking this employee’s eligibility.”
Dev: “We could show an example that checks each condition.”
Priya: “Include a case where a condition cannot be established. We need to teach when the answer must remain incomplete.”
You will compare few-shot examples, chain-of-thought demonstrations and least-to-most decomposition against an explicit task contract. Instructions can organize a proposal; source checks and application controls still decide whether to accept it.
What should an example teach the assistant to do?
Few-shot prompting supplies example inputs and desired outputs. Wei and colleagues' chain-of-thought study adds demonstrations of intermediate reasoning steps. Zhou and colleagues' least-to-most method first decomposes a problem, then solves simpler subproblems in sequence. These methods change the supplied task context and generated process; neither turns a model's explanation into independent evidence.
Hypothetical scenario. A policy question needs three conditions: employee category, region and effective date. A decomposition can resolve those as three explicit subquestions before combining them. If the region answer is unsupported, the final combination must stop or request evidence. Successfully producing three intermediate answers is not three verified facts. Retain the original question and authoritative passages so that a fluent decomposition cannot quietly replace the requested task.
Hypothetical scenario. Two prompt revisions give Priya incompatible refund answers for the same order.
In short. Define the answer contract before editing instructions. Test revisions on the same labeled cases.
A plausible answer can fail the task
Hypothetical scenario. A library assistant receives a question about borrowing equipment. Its prompt says to be helpful and concise. The response sounds reasonable, but it invents an exception that the supplied policy never stated. A longer instruction telling it to be extremely accurate produces more polished wording without resolving the missing evidence.
The design problem is a missing task contract. What material may support an answer? Which output is required? What should happen when the material is insufficient? How will a reviewer distinguish a useful response from a plausible guess?
Prompt design makes those choices explicit enough to test. It can change the behavior of a model under a particular configuration, but it does not turn natural-language instructions into a deterministic program or replace the application's permission checks.
Separate reasoning suggestions from executable acceptance rules
Hypothetical scenario. A prompt supplies examples of supported answers and appropriate abstentions. Few-shot demonstrations influence behavior; they do not enforce permission or make the next answer true. Keep authoritative rules in application-controlled checks where possible.
| Artifact | Concrete evidence | Decision boundary |
|---|---|---|
| Task contract | supported answer / abstention | Expected observable behavior |
| Prompt version | instructions and demonstrations | Behavioral intervention |
| Acceptance checks | evidence, schema, authority | Enforced application boundary |
Least-to-most decomposition can expose missing subproblems, while intermediate reasoning can still contain unsupported assumptions. Validate observable conclusions, source references and calculations rather than treating confident reasoning text as proof. External retrieved text remains task data even when it contains instructions addressed to the assistant. A prompt revision belongs in a versioned evaluation comparison with unchanged cases, not a new set chosen because the demonstration looks better.
Length and authority are weak substitutes for a specification
A request to act like an expert supplies a role, not an acceptance criterion. A request to answer every question may conflict with a requirement to use only the provided evidence. Repeating such instructions can increase text without resolving the conflict.
Examples can help show the desired behavior, but they can also imply a rule the author did not intend. If every demonstration contains an answer, a reader or model receives no demonstration of an insufficient-evidence case. If every answer uses the same phrasing, an evaluation can accidentally reward style rather than the intended decision.
There is also a boundary between instructions and material to analyze. A retrieved document can contain text that looks like a command. Separating and labeling that content helps communicate its intended role, but delimiters alone are not an authorization mechanism. The OWASP prompt-injection guidance discusses why externally supplied content can influence model behavior and why application-level controls matter.
Build a contract around evidence and outcomes
For the hypothetical library task, define the authorized evidence collection, the question, the requested answer form, and the insufficient-evidence behavior. A practical contract might ask for a short answer supported by named passages, with a statement of uncertainty when those passages do not settle the question. It should not ask the system to fill missing policy with general knowledge while simultaneously claiming every answer comes from the policy.
Keep the source material distinguishable from the instructions that describe its use. Provide stable identifiers for passages so that a claimed citation can be checked. Then decide what happens outside the model: verify that a referenced passage exists, enforce document access, and route an unresolved case appropriately. A citation string is a proposal until it has been matched to actual evidence.
In-context examples condition the model through its input. They are distinct from a training procedure that updates parameters. Language Models are Few-Shot Learners studies demonstrations supplied in context. Its results motivate examining this mechanism; they do not provide a universal improvement percentage for a new application.
Start the document assistant with an acceptance example before optimizing its prompt. Hypothetical scenario. Ask for a cancellation rule for customer A under revision R. An acceptable response uses eligible revision R evidence, identifies the relevant rule and cites its source. A fluent answer drawn from another customer's policy fails even if its wording looks plausible. When the permitted source does not establish the rule, an explicit limitation is an acceptable outcome under this chosen contract.
Write those examples before comparing prompts. The evaluation chapter develops paired cases and error categories, while the evidence foundation explains how to distinguish the claim from the test that supports it.
Work a comparison that includes the unanswered cases
Hypothetical scenario; these are invented evaluation counts. On 100 fixed cases, prompt A produces 72 supported answers, 20 unsupported answers, and 8 abstentions. Prompt B produces 76 supported answers, 8 unsupported answers, and 16 abstentions. Each row sums to 100.
The supported-answer rate over all cases changes from 72 ÷ 100 = 72% to 76 ÷ 100 = 76%, an increase of 4 percentage points. The unsupported-answer rate falls from 20% to 8%, a reduction of 12 percentage points. Abstentions increase from 8% to 16%, or 8 percentage points.
Now change the denominator. A answers 72 + 20 = 92 cases, while B answers 76 + 8 = 84. Among answered cases, the supported fractions are 72 ÷ 92 ≈ 78.3% and 76 ÷ 84 ≈ 90.5%. B answers fewer cases while supplying more supported answers in this illustration.
These totals do not establish whether every abstention was appropriate. For that, the evaluation needs to distinguish answerable cases from cases whose supplied evidence is insufficient. Nor do the invented counts establish statistical certainty or a production gain. They demonstrate why a report should include coverage, support, and abstention behavior rather than only a favorable conditional percentage.
In the wild: Prompts as Contracts: Writing Instructions You Can Test
Language Models are Few-Shot Learners: In-context demonstrations differ from parameter training.
Prompt experiments need comparison boundaries
Record the prompt revision, model configuration, available context, retrieval outputs, and scoring rule. If the candidate changes both its instructions and its retrieved documents, a changed score concerns that combined system. It does not isolate the effect of wording.
Start with a small set of cases that exposes the intended distinctions: clear evidence, missing evidence, conflicting passages, irrelevant content, and text that attempts to redirect the task. Define what an acceptable result looks like for each category. Then evaluate on cases not repeatedly used to select the wording.
Adding examples or splitting a task into steps can be reasonable options. A staged workflow can extract relevant evidence before writing a response, with checks between steps. It also adds work and additional failure boundaries. Anthropic's Building effective agents discusses composable workflows and intermediate checks; it is guidance to evaluate, not proof that a particular pipeline meets your requirements.
When demonstrations conceal an edge case
Hypothetical scenario. A support team provides demonstrations for common policy questions. Every example has a complete answer, and the prompt says to follow the examples. The deployed assistant then confidently answers a question whose policy exception was never supplied.
The team adds an example where the evidence does not support a decision, and explicitly describes the abstention behavior. That is a plausible revision to test, not a guaranteed repair. The next evaluation must include missing-evidence cases and check whether the change damages useful answers elsewhere.
A single successful demonstration after the edit is not enough. Keep cases that previously worked, add the failure class, and inspect unsupported answers separately from format violations. A task contract should make those failures distinguishable.
Four claims to resist
“A longer reasoning response proves better reasoning.” Additional text can contain errors or unsupported rationalizations. Evaluate the answer and its checkable evidence. Do not use explanation length as a correctness certificate.
“Putting a document inside tags makes it trusted.” Tags describe an intended boundary. The application still needs access controls and safe handling of proposed actions. A model's compliance with a textual instruction is not equivalent to a permission decision.
“A few examples train new model weights.” Supplying examples in a request is distinct from parameter training. A product may separately implement adaptation, but that requires its own documented process.
“One winning prompt is a permanent setting.” A prompt is evaluated with particular inputs, model behavior, and application logic. Changes to those conditions call for regression checks rather than assuming the old comparison still holds.
Use prompting to clarify a task, not replace missing controls
Use prompt design when the intended behavior is unclear, demonstrations can resolve a decision boundary, or the model has relevant context but needs a clearer output request. It is often a useful first intervention because the task contract itself becomes easier for people to review.
Do not expect wording to supply missing source documents, make an unauthorized action authorized, or turn an inaccurate acceptance rule into a correct one. A lookup with a precise deterministic rule may not need generation at all. Choose the component that can address the actual failure, then measure the complete task outcome.
Limits of Prompts as Contracts: Writing Instructions You Can Test
Instructions guide model behavior within the evidence and authority supplied by the application. They cannot supply absent source facts or enforce an external permission rule. Evaluate the proposed prompt against retained failures, including exceptions and permitted abstentions, instead of treating longer wording as an acceptance guarantee.
Test the task contract boundary
A longer reasoning trace reaches the wrong policy conclusion. What should the reviewer score?
Reveal the design reasoning
The observable answer and evidence under the rubric, including unsupported inference. Diagnose the prompt if useful, but do not reward reasoning length as correctness.
Decision: Version prompts and evaluate their consequences; keep authority and verification explicit.
Check yourself: name the missing contract
A prompt demands an answer to every question and says to use only supplied documents. Some questions are not answered by those documents. What should change first?
Resolve the incompatible requirements
Define the insufficient-evidence outcome and its acceptance rule. More forceful wording cannot make missing evidence appear. Evaluate supported answers and appropriate abstentions separately.
A candidate prompt has 18 supported answers, 2 unsupported answers, and 5 abstentions over 25 cases. What is its supported fraction among answered cases?
Choose the denominator explicitly
Answered cases are 18 + 2 = 20, so the conditional fraction is 18 ÷ 20 = 90%. Over all cases, supported answers are 18 ÷ 25 = 72%. Both are valid summaries, but they answer different questions.
A document tells the assistant to ignore the task and perform a privileged action. Does labeling the document as untrusted make the application safe by itself?
Separate instruction handling from authorization
No. Labeling communicates the intended role of the text, but permission checks and action controls must remain enforced by the application. Test adversarial inputs and validate proposed actions rather than treating a prompt boundary as a guarantee.
Northwind decision log
Define the answer contract before editing instructions.
Test revisions on the same labeled cases.
Keep the prompt version with the acceptance evidence.
Go deeper: context, training, and evaluation
The book links are the authors' draft chapters, with their own draft dates.
- Book chapter: Speech and Language Processing, Chapter 1: Introduction, Daniel Jurafsky and James H. Martin. Places prompting and contextual prediction within the broader language-model setting.
- Book chapter: Speech and Language Processing, Chapter 8: Post-training, Daniel Jurafsky and James H. Martin. Explains instruction tuning, helping separate training on instructions from supplying instructions during use.
- Video lecture: Intro to Large Language Models, Andrej Karpathy. Offers an overview of model use and limitations before treating a prompt as an entire application.
- Primary paper: Language Models are Few-Shot Learners, Tom B. Brown and colleagues. Read its in-context demonstration setup and task-specific evaluation rather than assuming a general improvement for every prompt.
Check the mechanism in this lesson
Three decomposed subquestions all receive fluent answers, but the region answer lacks evidence. May the final decision be accepted?
Compare the explanation
Not on that basis. Decomposition organizes work; it does not verify each intermediate result. Stop, retrieve permitted evidence or return an incomplete outcome before composing a policy decision from an unsupported premise.
Carry the decision forward
Northwind now has instructions and examples to test against the same task. Repeated requests can still produce different continuations. Page 08 traces how sampling changes those choices without turning repeatability into evidence of correctness.