Prompt Engineering
The practice of designing and refining the text instructions (prompts) given to an AI model to elicit the most accurate, useful, and relevant responses for a given task.
Prompt engineering is the art and science of communicating effectively with language models. Since the output quality of an AI model depends heavily on how the input is phrased, prompt engineering has become a critical skill for anyone working with AI. A well-structured prompt can be the difference between a vague, unhelpful response and a precise, actionable one.
Key techniques in prompt engineering include providing clear instructions, specifying the desired output format, giving examples (few-shot prompting), assigning a role or persona to the model, and breaking complex tasks into sequential steps (chain-of-thought prompting). System prompts set the model's overall behavior and constraints, while user prompts contain the specific request. Advanced techniques include self-consistency (generating multiple responses and picking the most common answer), tree-of-thought reasoning, and retrieval-augmented generation.
Effective prompts share several qualities. They are specific about what they want, explicit about constraints and format, and provide enough context for the model to work with. Saying "Summarize this article in 3 bullet points, each under 20 words, focusing on financial implications" will consistently outperform "Summarize this." Including examples of desired output is often more effective than lengthy verbal descriptions of what you want.
Prompt engineering is sometimes seen as a temporary discipline that will fade as models improve, but in practice it remains essential. Even the most capable frontier models benefit from well-structured prompts, and the gap between a naive prompt and an optimized one can be dramatic in terms of accuracy, consistency, and cost efficiency. Many organizations now maintain prompt libraries and version-control their prompts alongside their code.
Explore more AI concepts in the glossary
Browse Full Glossary