Prompt engineering basics: how to get better answers from AI

Prompt engineering basics: how to get better answers from AI — Informatics Hub
Person typing a prompt into an AI interface
AI Engineering

Prompt engineering basics: how to get better answers from AI

Informatics Hub June 2025 8 min read

Most people who feel disappointed with AI tools aren't using bad tools — they're asking bad questions. The quality of what you get out of a large language model is almost entirely determined by the quality of what you put in.

Prompt engineering is the practice of writing inputs to AI models in a way that consistently produces useful, accurate, and well-structured outputs. This post covers the core principles, with concrete before-and-after examples you can apply immediately.

Why prompts matter so much

An LLM doesn't read your mind. It responds to the literal text you provide, using patterns from its training to generate the most appropriate response. A vague prompt produces a vague answer — not because the model is lazy, but because vagueness gives it nothing to anchor to.

Think of it like giving instructions to a very capable but very literal contractor. "Fix my house" will get you a confused stare. "Repaint the living room walls in warm white, fill the crack above the window, and replace the broken light fixture" actually gets the job done.
Developer working with AI tools on a modern laptop setup

The same AI model produces dramatically different results depending on how you ask

Principle 01
Be specific about what you want

The most common mistake is asking for something without specifying format, length, tone, or audience. Add those details and the quality difference is immediate.

❌ Vague
Write me something about automation.
✓ Specific
Write a 300-word blog introduction about workflow automation for small business owners with no technical background. Use a friendly tone. Start with a relatable problem they face.
Principle 02
Give the model a role

Starting your prompt with a role assignment significantly changes the style and depth of the response. The model draws on different patterns depending on the persona you give it.

❌ No role
Explain how APIs work.
✓ With role
You are a senior software engineer explaining a concept to a smart non-technical colleague. Explain how APIs work using a simple real-world analogy, then give one practical business example.
Principle 03
Provide context about your situation

The model knows nothing about you unless you tell it. More context produces more tailored, accurate, and genuinely useful outputs.

❌ No context
Help me write an email to a client.
✓ With context
I'm a freelance developer. My client asked for an update but we're two weeks behind due to a third-party API issue. Write a professional email that explains the delay honestly and gives a revised two-week timeline. Under 200 words.
Principle 04
Ask for a specific format

LLMs can produce bullet points, numbered lists, tables, JSON, code, or flowing prose. If you don't specify, you'll get whatever the model thinks fits — which might not be what you need.

❌ No format
Compare cloud hosting options.
✓ With format
Compare AWS, Google Cloud, and DigitalOcean for a small SaaS startup. Use a markdown table with columns: pricing model, ease of use for beginners, free tier, and best use case.
Principle 05
Treat it as a conversation, not a one-shot

The first response is almost never the final one. The best AI users think of prompting as a dialogue — get a first draft, then give specific feedback to refine it step by step.

✓ Good follow-up prompts
"Make the introduction shorter and more punchy."

"Remove the bullet points and rewrite as flowing paragraphs."

"The second point is unclear — explain it in simpler terms."

A reusable prompt template

Here's a structure you can adapt for almost any task:

Role: You are a [role].

Context: [relevant background about your situation]

Task: [exactly what you want — be specific]

Format: [how you want the output structured]

Constraints: [length, tone, things to avoid]
Person thoughtfully working at a clean desk with a laptop

Good prompt habits become second nature quickly — the results speak for themselves

What prompt engineering can't fix

Even the best prompt won't make an LLM reliably accurate on very recent events, niche technical topics, or things requiring real-world verification. Prompt engineering improves quality and structure — it doesn't change what the model fundamentally is.

Always verify factual claims from AI outputs before publishing or sharing them professionally. The model sounds confident regardless of whether it's correct.

Key takeaways

  • Vague prompts produce vague answers — specificity is the single biggest lever you have
  • Assigning a role to the model changes the style and depth of its response
  • Context about your situation dramatically improves how tailored the output is
  • Think of it as a conversation — iterate and refine rather than expecting perfection on the first try

Comments