Glossary
Prompt engineering
Designing and refining the instructions given to a language model to reliably get the output you want.
Also called: prompt design
Prompt engineering is the practice of crafting the instructions, examples, and context given to a large language model so that it reliably produces the intended output, without changing the model's underlying weights. It covers wording, structure, such as asking for output in a specific format, and technique, including providing a few worked examples, "few-shot" prompting, or asking the model to reason step by step before answering.
It differs from fine-tuning, which changes model behavior by retraining on new examples: prompt engineering works entirely at inference time and is faster and cheaper to iterate on, but is also more fragile, since a small wording change or a different model version can shift results. Effective prompts also manage the context window carefully, since irrelevant or excessive context can dilute a model's attention on what matters.
Prompt engineering matters because most production LLM use, including AI agent systems, is built on prompts rather than custom-trained models, and prompt quality is often the biggest lever available for output quality. Common pitfalls include writing prompts that work on a handful of manual tests but fail on realistic input variety, and skipping systematic LLM evaluation of prompt changes, which makes regressions easy to miss.
Last reviewed September 22, 2026