CertBrain
CoursesBlog
Sign in
← Back to decks
Sign in to save your progress, vote, and build your own decks.Sign in

Anatomy of a Prompt

A prompt is the input you send a foundation model to get a response, and most prompts are built from a small set of parts: an instruction, context, input data, a description of the output you want and, for image models, a negative prompt. This lesson takes a prompt apart, so you can tell which…

9 cards
Study this deck

Anatomy of a Prompt

A prompt is the input you send a foundation model to get a response, and most prompts are built from a small set of parts: an instruction, context, input data, a description of the output you want and, for image models, a negative prompt. This lesson takes a prompt apart, so you can tell which part to fix when a response goes wrong, a skill the exam tests through short scenarios.

The instruction

The instruction is the task itself: "Summarize this review in one sentence", "Classify this email as personal or commercial", "Translate this paragraph into Spanish." It's the one part almost every prompt needs. AWS's prompt guidance stresses keeping it simple, clear and complete. If a classification task should pick from fixed labels, the instruction should name those labels, or the model will invent its own wording. AWS also suggests placing the question or instruction near the end of the prompt, after any long text, so the model knows what to do with everything it has just read.

Context and input data

Context is background that helps the model interpret the task, such as "The following text is from a customer support chat" or "You are answering questions for a bank's employees." It narrows the model's focus and steers its tone and vocabulary.

Input data is the material the model works on: the review to summarize, the email to classify, the document to answer questions about. Context and input are easy to confuse. A quick test: input data is what the instruction acts on, while context tells the model how to read it. Many prompts also include demonstration examples, which the next lesson on prompting techniques covers.

Output indicators

An output indicator describes the shape of the answer: its length, format or structure. "In one phrase", "as a bulleted list", "return only the year" and "wrap each name in name tags" are all output indicators. Without one, a model often returns a free-form answer that's longer or looser than you need, which is a problem when another program has to read the result. AWS's examples show that adding an output indicator alone can turn a rambling summary into the short phrase the user wanted.

Negative prompts

A negative prompt lists what you don't want in the result. It matters most for image generation. Stability AI's Stable Image Ultra in Amazon Bedrock, for example, has a separate negative prompt field: you describe the scene you want in the main prompt and list unwanted elements, such as "clouds, text, people", in the negative prompt. Image models handle words like "no" or "without" in the main prompt unreliably and may even draw the thing you mentioned. That's why exclusions go in the negative prompt instead. Text models have no separate field, but you can still state what to avoid ("don't mention competitors") as part of the instruction.

PartWhat it doesExample
InstructionStates the task"Summarize the review in one sentence"
ContextFrames how to read the task"This text is from a hotel review site"
Input dataThe material to work onThe review itself
Output indicatorSets the answer's form"Return only a star rating from 1 to 5"
Negative promptExcludes unwanted content"blurry, watermark, text"

On the exam

Expect a symptom and a choice of fixes. If the answer's content is right but its format is wrong, add an output indicator. If the model misreads what the text is, add context. If the model does the wrong task, sharpen the instruction. If an image keeps including something unwanted, use a negative prompt rather than writing "no ..." in the main prompt. And don't jump to fine-tuning when a clearer prompt would fix the problem.

Quiz me on this
A real estate firm asks a foundation model to summarize property inspection reports. The summaries are accurate, but they run to several paragraphs, and the firm needs exactly three bullet points it can paste into a listing. What should the firm add to the prompt?
  1. More of the inspection report text as additional context
  2. ✓ An output indicator specifying three bullet points
  3. A negative prompt that lists unwanted words
  4. A higher temperature setting for the model
A marketing team uses Stable Image Ultra in Amazon Bedrock to create product images. Their main prompt says "a coffee mug on a kitchen counter, no people, no text", yet many images still show people and printed words. What is the BEST way to fix this?
  1. Repeat "no people, no text" several more times in the main prompt
  2. Ask a text model to rewrite the prompt more politely
  3. Fine-tune an image model on images without people or text
  4. ✓ Move "people, text" into the negative prompt instead
In the prompt "This message is from a hospital patient portal. Classify it as Appointment, Billing or Clinical: 'My bill shows a charge I don't recognize.'", which part is the context?
  1. ✓ This message is from a hospital patient portal
  2. Classify it as Appointment, Billing or Clinical
  3. My bill shows a charge I don't recognize
  4. The three category names listed in the prompt
An insurance company sends a model a long claim file followed by the question "Was water damage reported?" Often the model answers a different question, about the claim amount, which appears early in the file. The company can't shorten the file. Which change is MOST likely to help, according to AWS's prompt guidance?
  1. Put the question at the start and the file after it
  2. Split each claim file into separate chunks and send each chunk on its own
  3. ✓ Rephrase the question clearly and keep it after the claim file
  4. Add a negative prompt listing the words "claim amount"
Instruction (prompt component)
The part of a prompt that states the task the model must perform, such as summarize, classify or translate.
Context (prompt component)
Background that frames how the model should read the task, such as where the text came from or who the audience is.
Input data (prompt component)
The material the instruction acts on, such as the review to summarize or the document to answer questions about.
Output indicator
A description of the answer's required form, such as its length, format or structure ("in one phrase", "as JSON").
Negative prompt
A list of things to leave out of a generated result; for image models such as Stable Image Ultra it's a separate field.