liveBook · Manning

Prompt

As explained in Introduction to Generative AI, Second Edition

A prompt is the text or other input supplied to a generative model to specify or guide the output it should produce.

A prompt is the input given to a generative model to guide what it produces. It might ask a language model to answer a question, supply text to summarize, or describe an image to create. The wording matters: “Summarize this” leaves much open, while a request for a one-paragraph summary of three risks for a named audience gives clearer direction. section 2.14 section 7.1 section 4.7

A prompt can provide different kinds of guidance:

  • Instructions state the task, audience, tone, boundaries, or desired output format. section 7.1
  • Context supplies information the model can use, such as a document, search results, or conversation history. section 5.9 section 7.1
  • Examples demonstrate the desired task. A request without examples is zero-shot; one with a few examples is few-shot. Neither requires retraining the model. section 2.14

From request to example-guided prompt

A writer sorting articles could ask a model to assign each title to dog breeding, exoplanets, or Pittsburgh. If the results miss the intended pattern, the writer could add examples such as “The latest discovery of space telescopes”: Exoplanets. The examples guide the response without changing the model’s training. section 2.14

In a chat system, the user’s message may be only one part of the final prompt. A system prompt can set an overall response style or safety guidance; retrieved information and conversation history can also affect the reply. System prompts can even show an AI agent how to invoke tools. These instructions are useful but blunt: a small wording change can have unintended effects, and prompting may be less precise than post-training for a narrow behavior change. section 5.9 section 8.11 section 7.11

Figure 5.12 A sample composition of an LLM prompt deployed in the chat context (e.g., ChatGPT, Claude, Gemini)
A close-up of several words

AI-generated content may be incorrect.

The diagram separates the system prompt, surrounding context, and latest user message that can jointly shape a chat response. section 5.9

Prompts also carry risks. Entering a client contract into a dialogue agent could disclose confidential information, depending on how the service handles inputs. Instructions placed in a user message or external content can attempt to redirect a model; this is prompt injection. Clearer prompts can improve results, but they do not guarantee correctness, confidentiality, or safety. section 3.10 section 5.9 section 6.7

How Introduction to Generative AI, Second Edition covers it

How deep it goes
Defines prompts and explains instructions, context, examples, and chat components without implementation-level detail.
Examples
Uses article-topic sorting, executive-summary wording, confidential contract revision, and malicious instructions in external content.
What it assumes
Starts with plain-language definitions and everyday requests rather than requiring coding or machine-learning expertise.
What you can do after
Practice/perform clearer prompting with instructions and examples while recognizing privacy and injection risks.
How it connects
Connects prompt engineering to zero-shot and few-shot learning, post-training, prompt injection, and AI agents.

Also explained in

Compare how 50 books explain prompt →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Introduction to Generative AI, Second Edition. The section links point to the parts of the book it draws on.