AI basics
How to write good AI prompts
A good AI prompt states the task, context, format and constraints clearly. Learn practical steps, examples and common mistakes to get better answers.
A good AI prompt states what you want, gives the context the model needs, and says what the answer should look like. The clearer and more specific the request, the less the model has to guess, and the more useful the reply.
A prompt is simply the text you give an AI. Writing it well is sometimes called prompt engineering, though for everyday use it is just clear communication.
What makes a prompt good?
Strong prompts usually include four things:
- Task. What should the AI do? Use a clear verb: summarize, compare, rewrite, explain, list.
- Context. What does it need to know? Background, audience, and the text to work on.
- Format. How should the answer look: bullet list, table, two short paragraphs, code?
- Constraints. Length, tone, language, or things to avoid.
Bad prompt vs good prompt
| Weak | Better |
|---|---|
| "Tell me about volcanoes" | "Explain how volcanoes erupt in 3 short paragraphs for a 12-year-old, with one everyday analogy" |
| "Fix this" | "This Python function should return the largest number but returns None. Find the bug and show the corrected code" |
| "Write a message" | "Write a friendly two-sentence message welcoming a new member to a gaming community" |
The better versions remove guesswork about audience, length, and goal.
Step-by-step: build a prompt
- Start with the goal in one sentence.
- Paste in any source text the answer should rely on.
- Say who the answer is for.
- Specify the format and length.
- Add anything to avoid.
- Read the reply and refine with a follow-up.
Useful techniques
- Give an example. Show one sample of the style or format you want, and the model will imitate it.
- Assign a role. "Act as a patient math tutor" sets tone and level.
- Break big tasks into steps. Ask for an outline first, then each section.
- Ask for reasoning on hard problems. Requesting the steps often improves accuracy and lets you check the logic.
- Allow "I don't know". Telling the model to say so when unsure reduces hallucinations.
Common mistakes
- Being vague. "Make it better" does not say better how.
- Stuffing in too much. Irrelevant text can distract the model and uses up the context window.
- Asking many things at once. Split multi-part requests.
- Assuming it remembers. The model only sees what is in the current conversation. Restate key facts, or see what is AI memory.
- Accepting the first answer. Treat replies as drafts and iterate.
Do prompts work the same on every AI?
Roughly, but not exactly. Different models and apps respond a little differently, and some apps add their own hidden instructions. If a prompt does not work, try rewording it. This applies to chatbots and to image tools. For images, see what is AI image generation.
Prompting in Based
On Discord you can talk to Based by mentioning it or replying to its messages. Be specific, include the details it needs, and attach an image if you want to ask about it. To make an image, use /imagine with a description, for example /imagine a cozy library at sunset, watercolor style. Every slash command also works with the "." prefix, such as .imagine. See the image generation docs and the AI chat feature page. For general background, see Wikipedia on prompt engineering.
Frequently asked questions
What is a prompt in AI?
A prompt is the text or instruction you give an AI to tell it what to do, such as a question, a task, or a description of an image.
How do I write a better prompt?
State the task clearly, include the context, say what format and length you want, and add constraints. Then refine with follow-ups.
Should I use long or short prompts?
Use as much detail as the task needs and no more. Specific and focused beats long and cluttered.
Why does the AI ignore part of my prompt?
Prompts with many competing requests can get partly missed. Split them into smaller steps and put the most important instruction clearly up front.
Keep learning
- AI basics
What is an AI chatbot?
An AI chatbot is software you talk to in everyday language, powered by a language model. Learn how it works, how it differs from older bots, and its limits.
- AI basics
What are AI hallucinations?
AI hallucinations are confident but false or invented answers from a model. Learn why they happen, how to spot them, and how to reduce them.
- AI basics
What is a context window in AI?
A context window is the maximum amount of text an AI model can consider at once. Learn what tokens are, what happens when it fills up, and how to work within it.
- AI basics
What is generative AI?
Generative AI creates new content such as text, images, audio and code from a prompt. Learn how it works, what it can make and where it falls short.
- Voice and media
What is AI image generation?
AI image generation creates new images from text prompts using models like diffusion. Learn how it works, how to write good prompts, and its limits.
Try it in your server
Based is an AI Discord bot in 300+ servers. Every slash command also works with the "." prefix.