The basics

Prompt

In short

A prompt is the text, and sometimes images or files, that you give an AI model to tell it what you want. The model reads the prompt and generates a response, so how the prompt is worded shapes the answer.

Also called
AI prompt, Prompts
Topic
The basics
Level
Beginner
First described
Setting tasks for a language model purely through text prompts was shown at scale in OpenAI's GPT-3 paper, posted in May 20202.

For a language model, the prompt is the text it continues from. A 2021 survey of prompting describes how an input is turned into "a textual string prompt" with unfilled slots that the model then fills in1.

The approach took off with OpenAI's GPT-3 paper in 2020, where tasks and worked examples were "specified purely via text interaction with the model", with no retraining2. Including a few examples in the prompt is called few-shot prompting; including none is zero-shot1.

In a chat, each turn adds to what the model reads. User messages and replies accumulate in the context window, which Anthropic describes as the model's "working memory"3. Everything has to fit inside it, including the model's own answer3.

Prompt engineering is the practice of writing and testing prompts to get better results. Anthropic's guide covers techniques from clarity and examples to role prompting and prompt chaining4. It also notes prompting is not always the fix: latency and cost can sometimes be improved more easily by choosing a different model4.

Example

Typing "Summarise this letter from HMRC in three bullet points for someone with no tax knowledge" is a prompt. Adding a sample summary in the style you want turns it into a few-shot prompt.

Why it matters

The prompt is the main control most people have over what an AI tool produces, so small changes in wording can change the answer.

Questions people ask

What makes a good prompt?

Clear, specific instructions with enough context, and examples where useful. Anthropic's prompting guide covers techniques from clarity and examples to role prompting and breaking work into chained steps4.

What is prompt engineering?

Writing, testing and refining prompts to get better output from a model. Anthropic notes that some problems, such as speed and cost, are better solved by picking a different model4.

What is a zero-shot prompt?

A prompt that asks for a task without any worked examples. A few-shot prompt includes a handful. Prompting lets a pretrained model handle new tasks with few or no labelled examples1.

Related terms

Tools that use it

Sources

  1. Liu et al. (2021), Pre-train, Prompt, and Predict: A Systematic Survey of Prompting Methods in NLP, arXiv:2107.13586
  2. Brown et al. (2020), Language Models are Few-Shot Learners, arXiv:2005.14165
  3. Anthropic, Claude Platform Docs, Context windows
  4. Anthropic, Claude Platform Docs, Prompt engineering overview

Back to the glossary