Prompting

Prompting is the practice of specifying a language model task through instructions, context, examples, constraints, and output format. It is not a substitute for data, tools, or verification; it is the interface layer between a task and a model.

A prompt-conditioned generation can be written as:

where is the prompt and is the generated output.

A more realistic prompt decomposes into:

where is the instruction, is context, is evidence or examples, and is the requested format.

Key Ideas

  • Instructions define the task, but context and examples often dominate behavior.
  • Prompting can control style, scope, constraints, and output shape.
  • Ambiguous prompts produce ambiguous evaluation.
  • Prompt quality should be judged by external task success, not by fluent answers.
  • If correctness depends on private state, tools, or calculation, prompting alone is usually insufficient.

Prompt Contract

A useful prompt separates task, context, evidence, constraints, and verifier.

PartMeaningGood prompt question
instructionWhat should be done?
contextWhat state or background is available?
evidence/examplesWhat should the model ground on or imitate?
restrictionsWhat must not be used, changed, or exposed?
formatWhat shape should the output take?
verifierHow will correctness be checked?

This is why a prompt can improve interface quality without replacing verification.

Prompt Types

TypeUse forRisk
Direct instructionsimple known taskunderspecified output
Few-shot examplesformat or pattern transferexamples overfit or conflict
Evidence-grounded promptanswer from supplied sourcessources may be stale or adversarial
Structured-output promptJSON, table, schema, checklistsyntax valid but semantics wrong
Tool-use promptask model to select actionside effects need external verifier
Critique promptreview or find gapscan invent issues without evidence

Prompting vs Context Engineering

Prompting writes the immediate instruction. Context engineering decides what evidence and state enter the context at all.

QuestionBelongs closer to
What wording should the instruction use?Prompting
Which files, chunks, or examples are included?Context engineering
How is context ordered under token budget?[[concepts/llm/context-packing
How is output checked after generation?[[agents/verification/index
What tool may be called?[[agents/tools/tool-use

Evaluation Pattern

Prompt changes should be evaluated against a task set, not one pleasing answer.

where is a fixed set of tasks or examples.

Evaluation itemWhy
baseline promptprevents subjective improvement claims
fixed task setmakes before/after comparable
output rubricseparates style, correctness, safety, completeness
failure slicesshows which tasks got worse
external verifieravoids judging fluency as correctness

Practical Checks

  • What evidence is provided, and what evidence is missing?
  • Are instructions and examples consistent?
  • Is the output format machine-checkable?
  • Are untrusted documents treated as data rather than instructions?
  • Is there a verification step outside the model?
  • Is the prompt being asked to solve a retrieval, calculation, or tool problem that should be externalized?
  • Is the prompt change evaluated on repeated tasks, not a single anecdote?