# What Prompt Engineering Is — Prompt Engineering

Source: https://www.geekswithgeeks.com/en/prompt-engineering/f-what

> Define prompting as designing inputs and testing them like software.

## Designing the input, measuring the output

A **prompt** is the text (and sometimes images or files) you send to a language model. **Prompt engineering** is the practice of designing that input so the model's output is useful, correct and consistent, then **testing** it on realistic examples and improving it. It is not magic words: models predict likely continuations, so a clear, complete, well-structured request makes the right continuation more likely. The skill combines clear writing, knowing what the model can and cannot do, and the engineering habit of changing one thing at a time and measuring.

## Instructions in, behaviour out

A prompt is the only lever you have over a model at run time, so its structure matters.

![Four parts: role, task, context, format.](assets/figures/prompt-engineering/section-1-map.svg) — Figure 1.1 — Role, task, context and format.

## Briefing a new colleague

Imagine handing a task to a smart new colleague who knows nothing about your company. Vague instructions give vague work; a clear brief with examples gives what you wanted.

## Treat prompts as code

Keep prompts in files, review changes, and test them. A prompt that only lives in someone's chat history cannot be improved reliably.

**Quiz:** What is prompt engineering, best described?

- [ ] Retraining the model weights
- [ ] Finding secret magic words
- [x] Designing and testing inputs so model output is useful and consistent
- [ ] Writing longer prompts always

*Answer:* Designing and testing inputs so model output is useful and consistent. It is a design-and-measure discipline, not a trick.
