← Lessons

quiz vs the machine

Silver1050

Machine Learning

The Prompt Structure Anatomy

Breaking a prompt into the parts every reliable instruction shares.

4 min read · intro · beat Silver to climb

A prompt is not one blob

Beginners write a prompt as a single run on paragraph. Reliable prompts separate distinct components, each doing one job. Naming the parts lets you edit one without breaking the others.

The common parts

Most strong prompts contain some mix of:

  • Instruction that states the task in plain imperative words.
  • Context that supplies the facts, documents, or background the model needs.
  • Input data that is the specific thing to act on this time.
  • Output indicator that shows the wanted shape, such as a label or a starting token.

Order matters

Models attend to the whole prompt, but a clear order helps. A common pattern places the instruction first, then context, then the input, then a cue for where the answer goes. Putting the input last keeps it close to the place the model starts generating.

Why split it

Separating parts lets you swap the input while reusing the instruction, test one component at a time, and reuse a proven skeleton across many tasks.

Key idea

A prompt is built from named parts, instruction, context, input, and output indicator, and separating them lets you edit, test, and reuse each piece independently.

Check yourself

Answer to earn rating on the learn ladder.

1. What does the output indicator do?

2. Why place the input data last?