Prompt engineering glossary
69 terms used in prompt engineering, each defined in one sentence you can quote. Covers the techniques (few-shot, chain-of-thought, role prompting), the structural ideas (delimiters, recency bias, structured output), the failure modes (hallucination, prompt drift, sycophancy), and the safety vocabulary (prompt injection, jailbreaks, guardrails).
Core concepts
- Prompt
- A prompt is the text you give a language model to tell it what to produce, including the task, any background it needs, and the rules the output must follow.
- Prompt engineering
- Prompt engineering is the practice of writing and refining model instructions so that a language model produces the output you want reliably, rather than occasionally.
- System prompt
- A system prompt is a persistent instruction that sets a model’s role, rules, and boundaries for an entire conversation, separate from the individual messages a user sends.
- User message
- A user message is a single turn of input in a conversation with a language model, carrying the specific request and any material that request depends on.
- Assistant prefill
- An assistant prefill is text placed at the start of the model’s own reply so that it continues from there instead of choosing its own opening.
- Context window
- A context window is the maximum amount of text, measured in tokens, that a model can consider at once — including the prompt, any supplied documents, and the reply it generates.
- Token
- A token is the unit a language model reads and writes — roughly four characters of English text, or about three quarters of a word.
- Temperature
- Temperature is a setting between 0 and roughly 2 that controls how much randomness a model uses when choosing each next token.
- Top-p (nucleus sampling)
- Top-p is a sampling setting that restricts the model to the smallest set of next tokens whose combined probability exceeds a threshold, discarding the rest.
- Determinism
- A process is deterministic when the same input always produces exactly the same output, with no randomness involved.
Techniques
- Zero-shot prompting
- Zero-shot prompting is asking a model to perform a task using instructions alone, without showing it any completed examples.
- One-shot prompting
- One-shot prompting is giving a model exactly one worked example of the task before asking it to perform that task.
- Few-shot prompting
- Few-shot prompting is giving a model several worked examples of a task inside the prompt so it can infer the pattern and apply it to new input.
- Chain-of-thought prompting
- Chain-of-thought prompting is instructing a model to work through its reasoning step by step before giving an answer, rather than answering immediately.
- Role prompting
- Role prompting is telling a model to adopt a specific persona or professional perspective so that its vocabulary, priorities, and level of detail match that role.
- Persona
- A persona is a defined character a model maintains across a conversation, covering how it speaks, what it knows, and what it will not do.
- Self-consistency
- Self-consistency is a technique that samples several independent answers to the same prompt and takes the most common result, instead of trusting a single response.
- Step-back prompting
- Step-back prompting is asking a model to state the general principle behind a question before answering the specific question.
- Prompt decomposition
- Prompt decomposition is breaking one complex request into a sequence of smaller prompts, each handling a single step and feeding the next.
- Prompt chaining
- Prompt chaining is connecting several prompts so that the output of one becomes the input of the next, forming a pipeline.
- Negative prompt
- A negative prompt is a separate list of things a model should exclude from its output, used mainly by image generation models.
- Pattern matching
- Pattern matching is a model’s tendency to continue the structure it has been shown, which is why consistent examples change output more reliably than described rules.
Prompt structure
- Delimiter
- A delimiter is a marker such as an XML tag, a row of dashes, or triple backticks that separates one part of a prompt from another.
- XML tags in prompts
- XML tags in prompts are paired markers such as `<context>` and `</context>` used to label each section of a prompt so the model can tell them apart.
- Prompt structure
- Prompt structure is the order and separation of a prompt’s parts — role, context, task, constraints, format, examples — which changes model behaviour independently of the words used.
- Recency bias
- Recency bias is a model’s tendency to give more weight to instructions near the end of a prompt than to those buried earlier.
- Lost in the middle
- Lost in the middle is the observed effect that models recall information placed at the start or end of a long context more reliably than information in the middle.
- Context stuffing
- Context stuffing is pasting large amounts of material into a prompt in the hope that the model will find the relevant part itself.
- Structured output
- Structured output is model output constrained to a machine-readable shape such as JSON, CSV, or a fixed schema, rather than free prose.
- JSON mode
- JSON mode is a model setting that constrains generation so the response is always syntactically valid JSON.
- Schema
- A schema is an explicit description of the fields, types, and structure that a model’s output must conform to.
- Stop sequence
- A stop sequence is a string that causes a model to stop generating as soon as it produces that string.
- Stop condition
- A stop condition is an instruction telling a model when to stop and ask for clarification instead of proceeding on assumptions.
- Template variable
- A template variable is a labelled placeholder in a reusable prompt, such as `{{audience}}`, that is replaced with a real value before the prompt is sent.
- Prompt template
- A prompt template is a reusable prompt with placeholders for the parts that change, so the same tested structure can be applied to many inputs.
Failure modes
- Hallucination
- A hallucination is model output that is presented confidently as fact but is fabricated — an invented citation, statistic, quotation, function name, or event.
- Grounding
- Grounding is constraining a model to answer only from supplied source material, rather than from its training data.
- Sycophancy
- Sycophancy is a model’s tendency to agree with a user’s stated position rather than evaluate it independently.
- Leading question
- A leading question is a prompt phrased so that it presupposes its own answer, which biases the model toward confirming rather than evaluating.
- Prompt drift
- Prompt drift is the gradual loss of adherence to a prompt’s instructions over a long conversation, as earlier instructions are outweighed by more recent turns.
- Overfitting a prompt
- Overfitting a prompt is tuning it so tightly to a handful of test inputs that it performs worse on the general case.
- Vague qualifier
- A vague qualifier is a word such as "good", "engaging", or "comprehensive" that reads as a requirement but gives a model no way to check whether it has been satisfied.
Evaluation
- Prompt evaluation
- Prompt evaluation is testing a prompt against a fixed set of inputs and grading criteria to find out whether a change actually improved it.
- Golden dataset
- A golden dataset is a fixed set of inputs with known-good outputs, used as the benchmark for judging whether a prompt change is an improvement.
- LLM as judge
- LLM as judge is using one language model to grade another model’s output against a written rubric.
- Rubric
- A rubric is an explicit set of scored criteria used to judge output consistently, rather than relying on an overall impression.
- Regression
- A regression is a case that used to work and stopped working after a change to a prompt, a model version, or a template.
- Success criteria
- Success criteria are the checkable conditions an output must satisfy, stated inside the prompt so the model can verify its own work before finishing.
- Specificity
- Specificity is the degree to which a prompt names concrete details — numbers, proper nouns, named formats — instead of leaving them to the model’s discretion.
Retrieval and agents
- RAG (retrieval-augmented generation)
- RAG is a technique that retrieves relevant documents from an external store and places them in the prompt, so the model answers from that material rather than from memory.
- Embedding
- An embedding is a list of numbers representing a piece of text’s meaning, so that texts with similar meanings sit close together in that numeric space.
- Vector database
- A vector database is a store designed to hold embeddings and find the ones most similar to a query embedding quickly.
- Chunking
- Chunking is splitting documents into smaller passages before embedding them, so retrieval returns a relevant section rather than an entire file.
- Citation
- A citation is a reference in model output pointing to the specific source passage that supports a claim.
- AI agent
- An AI agent is a language model given tools and a goal, which decides for itself which actions to take and in what order until the goal is met.
- Tool use
- Tool use is a model’s ability to call external functions — searching, running code, querying a database — and incorporate the results into its answer.
- Function calling
- Function calling is a model feature that returns a structured request to run a named function with specific arguments, instead of returning prose.
- MCP (Model Context Protocol)
- MCP is an open protocol that lets language models connect to external tools and data sources through a common interface, rather than a bespoke integration per tool.
- Reasoning model
- A reasoning model is a language model trained to produce extended internal deliberation before answering, spending more computation on hard problems.
Safety
- Prompt injection
- Prompt injection is an attack in which instructions hidden inside content a model processes cause it to ignore its original instructions.
- Indirect prompt injection
- Indirect prompt injection is prompt injection delivered through content the model retrieves itself — a web page, an email, a document — rather than typed by the user.
- Jailbreak
- A jailbreak is a prompt crafted to make a model bypass its own safety training and produce output it would normally refuse.
- Guardrail
- A guardrail is a check placed around a model — before input reaches it or after output leaves it — that enforces a rule the prompt alone cannot guarantee.
- System prompt leak
- A system prompt leak is a model revealing its own hidden instructions when a user asks for them directly or indirectly.
Image prompting
- Image prompt
- An image prompt is a description given to an image generation model specifying the subject, setting, composition, lighting, and style of the picture to produce.
- Descriptor stack
- A descriptor stack is the comma-separated list of visual attributes that makes up an image prompt, ordered from subject through environment, composition, lighting, and style.
- Aspect ratio
- Aspect ratio is the proportional relationship between an image’s width and height, usually set by a model parameter rather than described in words.
- Seed
- A seed is a number that initialises an image model’s randomness, so that reusing the same seed with the same prompt reproduces the same image.
- Style reference
- A style reference is an existing image supplied to an image model so that new images adopt its look rather than its subject matter.
All terms A–Z
- AI agent
- Aspect ratio
- Assistant prefill
- Chain-of-thought prompting
- Chunking
- Citation
- Context stuffing
- Context window
- Delimiter
- Descriptor stack
- Determinism
- Embedding
- Few-shot prompting
- Function calling
- Golden dataset
- Grounding
- Guardrail
- Hallucination
- Image prompt
- Indirect prompt injection
- Jailbreak
- JSON mode
- Leading question
- LLM as judge
- Lost in the middle
- MCP (Model Context Protocol)
- Negative prompt
- One-shot prompting
- Overfitting a prompt
- Pattern matching
- Persona
- Prompt
- Prompt chaining
- Prompt decomposition
- Prompt drift
- Prompt engineering
- Prompt evaluation
- Prompt injection
- Prompt structure
- Prompt template
- RAG (retrieval-augmented generation)
- Reasoning model
- Recency bias
- Regression
- Role prompting
- Rubric
- Schema
- Seed
- Self-consistency
- Specificity
- Step-back prompting
- Stop condition
- Stop sequence
- Structured output
- Style reference
- Success criteria
- Sycophancy
- System prompt
- System prompt leak
- Temperature
- Template variable
- Token
- Tool use
- Top-p (nucleus sampling)
- User message
- Vague qualifier
- Vector database
- XML tags in prompts
- Zero-shot prompting