Glossary
AI

Prompt Engineering

Also: Prompting, Prompt Design, LLM Prompting

Prompt engineering is the practice of designing and refining text inputs to guide large language models toward accurate, relevant, and reliable outputs.

What It Is

Prompt engineering is the practice of crafting, structuring, and iterating on the instructions (prompts) given to a large language model (LLM) or other generative AI system to obtain useful, accurate, and consistent results. A prompt can be a simple question, a detailed set of instructions, examples, or a combination of context, constraints, and formatting rules. Because models respond to the exact wording, order, and structure of input, small changes in a prompt can produce very different outputs.

Why it matters

Generative models do not read minds: they predict text based on patterns and the input they receive. Good prompts reduce ambiguity, lower the chance of incorrect or fabricated answers (hallucinations), and make outputs reproducible. For professionals, this matters because:

  • It improves output quality without retraining or fine-tuning a model.
  • It is cost effective: better prompts often replace expensive custom development.
  • It supports consistency across teams when prompts are templated and version controlled.
  • It is vendor neutral: the core skills transfer across models and providers.

How it is used in practice

Common techniques include:

  • Role and context setting: telling the model who it is and what audience to write for.
  • Few-shot prompting: providing example input and output pairs to demonstrate the desired pattern.
  • Chain of thought: asking the model to reason step by step for complex tasks.
  • Output formatting: requesting JSON, tables, or bullet lists for downstream use.
  • Constraints: setting limits on length, tone, or sources to use.
  • Iteration and testing: comparing variations against real cases and measuring results.

In applied settings, prompts are often stored as reusable templates with variables, evaluated systematically, and integrated into products or workflows.

Concrete Example

A weak prompt: *"Summarize this report."*

An engineered prompt: *"You are a financial analyst. Summarize the quarterly report below in 5 bullet points for an executive audience. Highlight revenue change, key risks, and one recommendation. Use plain language and avoid jargon. Report: [text]."*

The second version specifies role, audience, length, structure, focus, and tone, producing a far more usable result.

Prompt Engineering LoopPromptrole, context,examples, formatLLMprocesses inputOutputanswer / formatEvaluatetest & comparerefine prompt
Prompt engineering is an iterative loop: design a prompt, run the model, evaluate the output, then refine.

Frequently asked questions

What is prompt engineering?

Prompt engineering is the practice of crafting, structuring, and iterating on the instructions given to a large language model to get useful, accurate, and consistent outputs. Because a model responds to the exact wording, order, and structure of the input, small changes in a prompt can produce very different results. It also goes by prompting, prompt design, or LLM prompting.

Why does prompt engineering matter if the model is already trained?

Because a generative model predicts text from the input it receives, it cannot infer what you left unsaid. Better prompts reduce ambiguity, lower the risk of fabricated answers (hallucinations), and improve output quality without retraining or fine-tuning. That makes prompting the cheapest lever available: a well-written instruction often replaces custom development.

What is the difference between prompt engineering and fine-tuning?

Prompt engineering changes the instructions sent to the model; fine-tuning changes the model itself by training it further on your data. Prompting requires no training pipeline, produces results immediately, and the skills transfer across models and providers. Fine-tuning is a heavier investment that only makes sense once prompting has been pushed to its limits.

Which prompting techniques should I learn first?

Start with role and context setting (telling the model who it is and for which audience it writes), then output formatting (asking for JSON, a table, or bullet points) and explicit constraints on length, tone, or sources. Next come few-shot prompting, where you supply example input/output pairs to demonstrate the pattern, and chain of thought, where you ask the model to reason step by step on complex tasks. Iteration and testing against real cases tie them together.

What does an engineered prompt look like compared with a weak one?

A weak prompt is "Summarize this report." An engineered version reads: "You are a financial analyst. Summarize the quarterly report below in 5 bullet points for an executive audience. Highlight revenue change, key risks, and one recommendation. Use plain language and avoid jargon. Report: [text]." The second specifies role, audience, length, structure, focus, and tone, which is why the output is usable straight away.