A promptPromptThe text you give a model to work on, from a short question to long instructions with a role, context, examples and a required format. The quality of the output follows the clarity of the prompt more than its length. is what you write to a language modelLarge language model (LLM)A program trained on a huge amount of text until it predicts the next word of any text. Answers, translations and code come out of that repeated prediction. It does not search the web or remember past conversations unless it is given that explicitly. to get work done. The model knows nothing about you or your project beyond the prompt and the conversation. Most weak results come from an incomplete prompt, not a weak model. Here are five elements that make a prompt clear.
1. The task: a clear verb
Start with a verb that says exactly what you want: "summarise", "classify", "write a unit testUnit testA small, fast test that checks one function gives the right output for a given input. Ask the agent to write tests first, since they are how it knows its code works.", "review this function". "Help me with this text" leaves the model to guess what help means.
2. The context: for whom and why
Say who will read the output and what it is for. A summary for a busy manager differs from one for a student revising. State any important constraint: the language and its version, that the text will be public, or a length limit.
3. The input: keep it apart from the instructions
Put the text the model works on in a clearly marked place, between triple quotes or simple tags, so it does not mix with your instructions. This also protects you: if the text says "ignore the above", it stays text to work on, not an order to follow.
4. Examples: show what you want
One or two examples are worth a paragraph of explanation. This is few-shot promptingFew-shot promptingPutting two to five examples of an input and its output in the prompt, so the model follows the same pattern. Varied, correct examples teach more than long instructions.. Pick varied examples so the model does not copy details you did not intend.
5. Output format: describe it precisely
If you want a table, name its columns. If you want JSONJSONA text format for exchanging data, with objects in curly braces, lists in square brackets, and text and number values. Every programming language reads it, and it is the usual format for API requests and structured model output., list the keys and their types. A well-defined output is easier to check and to use in your program.
Before and after
Weak:
Write about security.Clearer:
You are writing for beginner developers building their first web app.
Write a list of the five most common security mistakes they make,
each with one sentence explaining the mistake and one on how to avoid it.
No more than 150 words.The second names the reader, the task, the format and the length, so the model guesses less.
Common mistakes
- Contradictory instructions: "be brief" and then "explain every detail". Pick one.
- Negatives only: "don't be formal" is weaker than "write in a friendly, direct tone".
- Forgotten variables: if your template has
{{name}}, make sure every variable is filled before sending. - Trust without checking: a model can present an invented fact as true (a hallucinationHallucinationA model presenting wrong or invented information confidently, such as a reference that does not exist or a function a library does not have. It drops when the model is given sources, asked to admit when it does not know, and checked.). Check numbers, names and links before relying on them.
Try it
Take a prompt you use often, add the five elements one at a time, and compare the output after each. You will quickly learn which element matters most for your work. Talqeen's prompt builder starts from these same fields and checks the result without a model.