Prompt Engineering: What Is a Prompt?
A prompt is the message you type to a language model. It is an instruction, not a command to a database.
One prompt, three wordings
The same question, asked three ways, gives three different answers.
Write a reply to a customer who asks where order 1042 is.A vague prompt and a clear prompt
The vague wording leaves the model guessing. The clear wording tells it the job.
Write a short reply to Maya about order 1042. Order 1042 is shipped and out for delivery. Keep the reply under 40 words.Example
You are a support agent for ShopStack. Write a short reply to Maya. Her order 1042 is shipped and out for delivery. Keep the reply under 40 words and friendly in tone.Key points
- A prompt is the message you send to a language model.
- The model reads the prompt and predicts the most likely reply, word by word.
- A clear prompt gives a clear reply. A vague prompt gives a vague reply.
- Prompt engineering is choosing the words of the prompt so the reply is useful.
This example runs the clear prompt against the local model and shows the reply it gave.
Note
A prompt is not a search query. It asks the model to write, not to look something up.
Try it Yourself
Edit the code, then press Run.
Running is simulated Β· Rust Playground
Exercise
What is a prompt?