Prompt Engineering
Shaping a model's input to make the desired behaviour reliable rather than occasional.
Prompt engineering is the practice of designing the text given to a Large Language Model so that the behaviour you want happens reliably. The framing has matured: it is less about clever phrasings and more about structure, evidence, and knowing which channel actually carries influence.
A few findings recur across systems.
Structure beats persuasion. When a model systematically omits something it is merely permitted to produce, prose encouragement rarely fixes it — restructuring the output shape so the thing is required fixes it immediately. Models reliably produce what the grammar demands and unreliably produce what the text merely invites. See Constrained Decoding and Structured Output.
Systematic and probabilistic misses need different treatments. A retry that names the rejection helps when the model sometimes gets it wrong. It does nothing when the model always gets it wrong, because nothing about the situation has changed.
Every channel is a channel. Tool descriptions, field descriptions, enum values, and error messages returned to the model all steer behaviour, often more than the instructions written for that purpose. Error text is worth writing as guidance, since the model reads it verbatim.
Numbers stated become numbers targeted. See Anchoring Effect and Goodhart's Law.
Because a prompt change cannot be type-checked, the only way to know whether it helped is to measure — see Evaluation Harness.
See also4
Hand-picked in the note itself — the neighbours worth reading next.
System Prompt
The standing instructions that frame every turn of a conversation with a model.
Agents & Language Models14 connections
Prompt
The text supplied to a language model to elicit a response.
Agents & Language Models12 connections
Tool Use
Giving a model a set of callable functions so it can act on the world rather than only describe it.
Agents & Language Models24 connections
Nondeterminism
The property that identical inputs may produce different outputs, and what it costs to test around.
Agents & Language Models17 connections
Linked from16
Notes elsewhere in the wiki that reach for this one.
- Agent SkillAgents & Language Models
A packaged, invocable set of instructions that loads into an agent's context on demand.
- Anchoring EffectMethod
A stated number pulls subsequent estimates toward it, regardless of relevance.
- Constrained DecodingAgents & Language Models
Restricting a model's next-token choices to those a formal grammar permits.
- Evaluation HarnessAgents & Language Models
A repeatable test suite for model behaviour, since prompts and tool descriptions cannot be type-checked.
- Goodhart's LawMethod
When a measure becomes a target, it stops being a good measure.
- GuardrailAgents & Language Models
A rule constraining what a model may do, enforced by prompt, schema, or surrounding code.
- HallucinationAgents & Language Models
Fluent, confident output that is not grounded in anything real.
- JSON SchemaAgents & Language Models
A vocabulary for describing the shape of JSON data, and the lingua franca of model tool interfaces.
- Model RoutingAgents & Language Models
Choosing which model handles which step, trading capability against cost and latency.
- NondeterminismAgents & Language Models
The property that identical inputs may produce different outputs, and what it costs to test around.
- PromptAgents & Language Models
The text supplied to a language model to elicit a response.
- Record and Replay TestingAgents & Language Models
Capturing a real interaction once and replaying it deterministically in later test runs.
- Schema ValidationAgents & Language Models
Checking data against a declared shape at runtime, and using the result as the typed value.
- Structured OutputAgents & Language Models
Constraining a model to emit data conforming to a declared schema rather than free text.
- System PromptAgents & Language Models
The standing instructions that frame every turn of a conversation with a model.
- TokenAgents & Language Models
The sub-word unit a language model actually reads and writes; the unit of cost and of context.