Learn

Prompt engineering: shaping the input to get better output

Prompt engineering is the practice of deliberately shaping a model's input, the instructions, context, and examples you give it, to get more useful and reliable output. It changes what you say to the model, not the model itself.

At a glance

What it is
Shaping the input to a model to steer its output
What it changes
The prompt, not the model's weights
Why it works
Clear instructions and examples narrow what the model produces
When it is not enough
Reach for fine-tuning or retrieval when wording alone cannot fix it

What is prompt engineering?

Prompt engineering is the work of writing the input so the model gives you what you actually want. A model will answer almost any prompt, but the quality of the answer depends heavily on how you asked. Clear instructions, the right context, a worked example or two, and a request to reason before answering all push the output in a useful direction. None of that touches the model. You are changing what you say, not what the model is.

That is the appeal: it is the cheapest knob you have. No training run, no new hardware, no waiting. You edit text, run it again, and see if the output improved. On a self-hosted setup it pairs naturally with versioning, so every prompt change is a commit you can review and roll back.

Where does prompt engineering stop?

Wording can only work with what the model already knows. If the answer depends on facts the model never learned, no phrasing conjures them, and you reach for retrieval to supply the facts or fine-tuning to teach new behaviour. If the model is simply too small for the task, a better prompt will not rescue it.

It also shifts the odds rather than guaranteeing them. A good prompt makes the right answer more likely and the wrong one rarer, but it does not make testing optional. You still check the output, because a model that sounds confident and a model that is correct are not the same thing.

Prompt engineering can

  • Make instructions explicit so the model stops guessing what you meant
  • Add a few worked examples that anchor the format and tone you want
  • Cut a vague, rambling output down to a tight, usable one
  • Reduce wrong answers by telling the model to check before it claims

Prompt engineering cannot

  • Teach the model facts it never learned; that needs retrieval or training
  • Fix a model that is simply too small for the task
  • Guarantee a correct answer every time; it shifts the odds, not certainty
  • Replace testing; you still verify the output you get back

Related terms

← All terms Reviewed: June 2026