All Articles
How-toยท5 min read

How to Write Prompts That Actually Get You What You Want

Most disappointing LLM outputs come from vague prompts, not weak models. Here is a repeatable structure for prompts that get you usable results.

Part of: Generative AI for Beginners

When an LLM gives you a mediocre answer, the model is usually not the problem โ€” the prompt is. A vague ask gets a vague answer. Here is a repeatable structure that turns fuzzy requests into precise, usable output.

Step 1: State the Role and Goal

Tell the model who it is and what you actually want. "Write about databases" invites a rambling essay; a role plus a concrete goal narrows it dramatically:

You are a senior backend engineer.
Explain database indexing to a junior developer who
knows SQL basics but has never tuned a query.

Step 2: Give Context and Constraints

The model can't read your mind about length, audience, or format. Say it explicitly. Constraints are not limitations โ€” they are what make the output fit your need:

Keep it under 300 words.
Use one concrete example with a real query.
Avoid mentioning NoSQL โ€” this is about relational databases only.

Step 3: Show the Shape You Want

If you need a specific structure, show it. A one-line template beats paragraphs of description:

Respond in this format:
- What it is: <one sentence>
- Why it matters: <one sentence>
- Example: <code block>

Step 4: Iterate on the Output, Not Just the Prompt

Treat the first answer as a draft. Instead of rewriting the whole prompt, refine conversationally: "Good, but make the example use a composite index" gets you there faster than starting over.

Summary

Good prompting is mostly specificity. State the role and goal so the model knows its job, give context and constraints so the output fits your situation, show the format you want so you don't have to reshape it afterward, and refine the result conversationally instead of restarting. The difference between a frustrating answer and a great one is rarely the model โ€” it is how clearly you asked.

#GenAI#Prompting#LLM#Productivity

Want to go deeper?

Generative AI for Beginners

View Course