Specialty Digest

Global English editionLearners’ Study Dashboard — in development
The Knowledge Library for All

Prompt Engineering

nounPrompt Engineeringalso prompt design, prompting, prompt crafting

In one line

Prompt engineering is the practice of designing and refining the inputs given to a generative artificial intelligence model so that it produces more accurate, useful and reliable outputs.

Prompt engineering is the practice of designing and refining the inputs given to a generative artificial intelligence model so that it produces more accurate, useful and reliable outputs. A prompt may be a question, an instruction, a set of examples, a block of background material or a combination of these. Because large language models respond differently to different wording, structure and context, careful prompting can change the quality of results a great deal without any change to the model itself.

Background

Before 2020, getting a model to do a new task usually meant training or fine-tuning it. The GPT-3 paper showed that a sufficiently large model could perform tasks from a plain description and a few examples placed in the input, which made the text of the prompt a way of programming the model. Researchers soon identified methods such as few-shot prompting and chain-of-thought prompting. With the release of chat assistants and image generators, prompting became an everyday skill and a recognized job function.

What a prompt contains

Effective prompts often combine several elements, though not every task needs all of them.

  • Instruction: the task to be done, stated clearly.
  • Context: background facts, documents or data the model should use.
  • Role or persona: who the model should act as, covered under role-based prompting.
  • Examples: sample inputs and outputs that show the desired pattern.
  • Constraints: length, tone, audience, forbidden content or required sources.
  • Output format: a table, a list or a defined structure, see structured output.

In products, a hidden system prompt sets general behavior, and the user prompt carries the individual request.

Core techniques

  1. Be specific: state the goal, audience and success criteria rather than leaving them for the model to guess.
  2. Give examples: zero-shot prompting uses no examples, while few-shot prompting adds a handful.
  3. Ask for reasoning: requesting steps can raise accuracy on logic and mathematics problems.
  4. Break tasks down: split a big job into stages with prompt chaining.
  5. Provide context: include source text so answers are based on it, see contextual prompting.
  6. Specify the format: ask for a particular structure so that results can be used by other software.
  7. Iterate: test, read the output, adjust wording and repeat, which is the heart of the practice.

Prompting for different media

For images, prompts describe subject, style, lighting, composition and sometimes things to avoid, as in a negative prompt. For code, effective prompts give the language, the constraints, existing code and tests. For audio and video, prompts may include mood, duration and sequence. Each model has its own conventions, so what works well in one may need adjustment in another.

Evaluation and optimization

Serious prompt work is measured. Teams assemble test sets, define metrics such as accuracy, format validity or user ratings, and compare prompt versions. Some tools search for better prompts automatically, a topic covered under prompt optimization. Prompts are stored in version control and treated as part of the software, because small edits can change behavior.

Risks and limits

  • Fragility: a rewording can change results, and a prompt tuned for one model may not transfer.
  • No guarantee: prompting cannot remove hallucination.
  • Prompt injection: untrusted text can carry instructions that override the intended ones, see prompt injection.
  • Overreliance: elaborate prompts can hide the need for better data, tools or fine-tuning.
  • Sensitive data: prompts may be logged, so confidential information needs care.

Is it a profession?

The job title of prompt engineer became popular in 2023, and some organizations hired for it. As models improved at following plain requests, many of the skills were absorbed into broader roles such as software engineering, product design and domain expertise, and the focus has shifted toward designing whole contexts, tools and evaluation, sometimes called context engineering. Clear writing, subject knowledge and systematic testing remain the core abilities.

A worked example

A weak prompt reads, write about our product. A stronger version says: you are a marketing writer for a small software company; write a 120-word product description for project managers; use a friendly tone; mention the calendar feature and the free trial; and end with one call to action. The second prompt names the role, audience, length, tone, content and structure, so the output needs less editing. A team then tests both versions on ten products and keeps the better one.

Common mistakes

Beginners often write prompts that are too vague, pack several unrelated tasks into one request, omit the audience or purpose, or assume that the model knows private context. Another frequent error is accepting the first output without checking it. Contradictory instructions, such as asking for both a very short and a very detailed answer, produce unpredictable results. Fixing these problems usually means stating one goal at a time, supplying the missing context and reviewing the output against explicit criteria.

Prompt libraries and templates

Organizations keep collections of tested prompts so that colleagues do not start from scratch. A reusable prompt template has fixed instructions and placeholders for variables such as the customer name or document text. Libraries record the purpose, the model used, the date, sample inputs and outputs and the evaluation results, which makes it possible to update prompts safely when models change.

Ethics and responsible use

Prompting raises ethical questions about bias, transparency and misuse. Prompts can steer a model toward stereotypes or away from them, and instructions can be written to produce deceptive material. Responsible practice includes testing for biased outputs, disclosing the use of AI where it matters, avoiding the entry of personal data without permission and following the usage policies of the model provider.

Learning prompt engineering

People learn the skill by practicing on real tasks, reading provider guides, studying public prompt collections and comparing outputs side by side. A useful habit is keeping a notebook of prompts that worked and failed, with notes on why. Courses, community forums and open research surveys help, and domain experts often get the best results because they know what a good answer looks like in their field and can judge outputs accurately.

FAQs

Do I need coding skills for prompt engineering? No. Clear writing and testing are the main skills, although developers use code to automate and evaluate prompts.

Is there one best prompt format? No. The best prompt depends on the model and the task, so testing matters.

Will prompt engineering become obsolete? Models need less coaching than before, but designing context, instructions and evaluations remains important.

Key facts

  • The 2020 GPT-3 paper by Brown and colleagues showed that a large language model can perform new tasks from instructions and a few examples placed in the prompt.1
  • Wei and colleagues showed in 2022 that asking a model to reason step by step improves performance on arithmetic and reasoning problems.2
  • A 2024 survey by Schulhoff and colleagues catalogued more than 50 text-based prompting techniques.3

Related concepts

Quick checkWhat is prompt engineering?Show answer

It is the practice of designing and refining the instructions, context and examples given to an AI model so that it produces better, more reliable outputs.

Sources

  1. Brown et al., Language Models are Few-Shot Learners, https://arxiv.org/abs/2005.14165
  2. Wei et al., Chain-of-Thought Prompting Elicits Reasoning in Large Language Models, https://arxiv.org/abs/2201.11903
  3. Schulhoff et al., The Prompt Report: A Systematic Survey of Prompt Engineering Techniques, https://arxiv.org/abs/2406.06608

Editorially reviewed by Specialty Digest Editorial TeamLast reviewed November 17, 2026Researched and drafted with AI assistanceReport an issue