LLM Prompt Improvement Loop

Table of Contents +

In the previous tutorial, we learned what a prompt is.

We saw that a prompt is the input or instruction we give to an AI model.

Now let’s ask a very practical question:

What should we do when the first answer is not good enough?

This happens very often.

You may ask something in ChatGPT, Claude, Gemini, or any AI app, and the first answer may be:

  • Too broad
  • Too advanced
  • Too short
  • Too long
  • In the wrong format
  • Missing examples
  • Not based on the information you gave

That does not always mean the AI is useless.

Many times, it means our prompt needs improvement.

So in this tutorial, we will learn the prompt improvement loop using simple everyday examples.


✍️ What is the Prompt Improvement Loop?

The prompt improvement loop means we improve a prompt by testing it again and again.

The basic process looks like this:

Write a prompt

Read the answer

Find what is wrong

Improve the prompt

Test again

This is called a loop because we may repeat it multiple times.

In simple words:

We do not expect the first prompt to be perfect. We improve it step by step.

This process is also called prompt iteration.

Iteration simply means doing something again with small improvements.


🤔 Why Do We Need This Loop?

An LLM does not automatically know exactly what we want.

It uses the prompt, the available context, and its learned patterns to generate an answer.

If our instruction is unclear, the answer may also become unclear.

For example, if we ask:

Make a study plan.

the model has many possible directions.

It may not know:

  • Which subject we are studying
  • How many days we have
  • How many hours we can study daily
  • Whether we want revision or first-time learning
  • Whether the plan should be strict or flexible

So the problem is not only:

AI answer is bad

Sometimes the real problem is:

Prompt was not clear enough

That is why this loop is useful.


⚖️ How This Is Different From Prompting Basics

In the previous tutorial, we learned the basic idea:

A prompt tells the model what we want.

This tutorial is different.

Here, we already have a prompt and an answer.

Now our job is to inspect the answer and ask:

What is wrong with this answer?

Which small change can improve the next answer?

So this page is not mainly about defining prompts again.

It is about fixing weak results.


📌 First Find the Problem

Before changing the prompt, we should first name the problem clearly.

For example:

Problem: answer is too long
Change: add a word limit
Problem: answer is too formal
Change: ask for natural language
Problem: answer has no example
Change: ask for one everyday example
Problem: answer ignores the notice
Change: say "use only the notice"

This is important.

If we do not know what is wrong, we may randomly change the prompt and make it worse.


🔎 Example 1: The Answer Is Too Broad

Suppose we write this prompt:

Make a study plan.

This prompt is too open.

The model does not know what kind of study plan we need.

It may give a general plan like:

  • Wake up early
  • Study daily
  • Take breaks
  • Revise before exams

This advice is okay, but it is not specific.

Now let’s improve the prompt.

Better Prompt

Make a 7-day study plan for a class 10 student preparing for a science test. The student can study 2 hours daily. Keep the plan simple and include revision time.

Why is this better?

Now we have told the model:

  • Who the plan is for
  • Which subject matters
  • How many days are available
  • How much time is available each day
  • That revision should be included

The model now has a clearer direction.


🎭 Example 2: The Answer Is Too Formal

Suppose we ask:

Write a birthday message.

The model may write something very formal.

For example, it may sound like a greeting card or office email.

But maybe we want a friendly message for a close friend.

Let’s improve the prompt.

Better Prompt

Write a short birthday message for my close friend. Keep it warm, simple, and natural. Do not make it too formal.

Why is this better?

This prompt tells the model:

  • The message is for a close friend.
  • The tone should be warm.
  • The language should be simple.
  • The message should not sound formal.

Tone is important when we ask AI to write messages.


⚠️ Example 3: The Format Is Wrong

Suppose we ask:

Tell me what to buy for school.

The model may return a paragraph.

But maybe we wanted a checklist.

Let’s improve it.

Better Prompt

Make a school shopping checklist for a class 8 student. Use bullet points. Group items into books, stationery, bag items, and lunch items.

Why is this better?

Now the model knows:

  • It should make a checklist.
  • It should use bullet points.
  • It should group related items.
  • The list is for a class 8 student.

If the format matters, we should say the format clearly.


💡 Example 4: The Answer Has No Examples

Suppose we ask:

Explain saving money.

The model may give a definition.

But the answer may still feel dry.

For beginners, examples are very important.

Let’s improve the prompt.

Better Prompt

Explain saving money to a school student. Use a pocket-money example. Show how saving Rs. 20 every week can become useful later.

Why is this better?

Now the model has to explain using something familiar.

It can show the idea like this:

Weekly pocket money

Save a small amount

Money grows slowly

Use it for something important

Examples make abstract ideas easier to understand.


📏 Example 5: The Answer Is Too Long

Suppose we ask:

Explain healthy eating.

The answer may become very long.

It may talk about calories, vitamins, proteins, diet plans, exercise, water, sleep, and many other things.

That may be useful in a full article, but not when we need a quick answer.

Let’s improve the prompt.

Better Prompt

Explain healthy eating in 5 simple bullet points for a teenager. Keep each point one sentence long.

Why is this better?

This prompt controls:

  • Length
  • Format
  • Audience
  • Simplicity

When we want a short answer, we should mention the limit directly.


✂️ Example 6: The Answer Is Too Short

Sometimes the opposite happens.

Suppose we ask:

What is time management?

The model may answer:

Time management means using time properly.

That is correct, but it is not enough for learning.

Let’s improve the prompt.

Better Prompt

Explain time management to a student. Include what it means, why it matters, one daily-life example, and three simple tips.

Why is this better?

Now the model knows that we want more than a definition.

We are asking for:

  • Meaning
  • Importance
  • Example
  • Practical tips

This reduces the chance of a shallow answer.


⚠️ Example 7: The Answer Does Not Use Given Information

Suppose we paste a school notice and ask:

When is the holiday?

The model may answer generally if our prompt is not clear.

But we want the answer only from the notice we provided.

Let’s improve the prompt.

Better Prompt

Use only the school notice below to answer the question. If the notice does not mention the holiday date, say “The notice does not mention the date.” Question: When is the holiday? Notice: [paste notice here]

Why is this better?

This prompt gives the model a clear rule:

Use only the provided notice

It also gives a fallback:

If the answer is not present, say it is not mentioned.

This is useful whenever we want the model to answer from a specific document or message.


🕒 Example 8: The Answer Guesses Current Information

Suppose we ask:

Who won yesterday’s cricket match?

If the model does not have live information, it may guess or give an outdated answer.

That can be a problem.

Let’s improve the prompt.

Better Prompt

If you do not have live match information, do not guess. Tell me that current match results need to be checked from a live sports source.

Why is this better?

Now we are telling the model not to invent current information.

This matters because an LLM does not automatically know every latest event, score, price, release, law, or schedule.

For current information, an AI application usually needs a live tool or trusted source.


🪜 Example 9: The Answer Is Not Step-by-Step

Suppose we ask:

Tell me how to make tea.

The model may give a paragraph.

But maybe we want clear steps that someone can follow.

Let’s improve the prompt.

Better Prompt

Explain how to make tea in 6 simple steps. Use easy words. Mention when to add water, milk, tea leaves, and sugar.

Why is this better?

Now the model knows:

  • Use steps
  • Keep the language easy
  • Include the important items
  • Keep the process practical

For instructions, step-by-step format is often better.


🎛️ Example 10: The Model Changes Too Much

Suppose we ask:

Improve this leave application.

The model may rewrite everything.

But maybe we only wanted grammar and spelling fixes.

Let’s improve the prompt.

Better Prompt

Fix only grammar and spelling in this leave application. Do not change the reason, dates, tone, or meaning. Return only the corrected application.

Why is this better?

Now the model knows what should change and what should not change.

This is useful when editing:

  • Leave applications
  • Emails
  • Messages
  • Notices
  • Short paragraphs

If preserving wording matters, we should say that clearly.


🛡️ How Should We Review the First Answer?

After the model gives an answer, we should not accept it blindly.

Let’s check it like this.

1. Did it answer the actual question?

Sometimes an answer sounds good but misses the main question.

2. Is the level correct?

If the answer is for a beginner, it should not assume advanced knowledge.

3. Is the format correct?

If we asked for a table, list, message, or steps, we should check whether the model followed that format.

4. Are important details missing?

The answer may be correct but incomplete.

5. Is anything unsupported?

If the model states facts, we should ask:

Where did this information come from?

Did it come from the given text, a trusted source, or only from the model’s built-in knowledge?

6. Is it too long or too short?

Length matters because users may not read a messy answer.

7. Can we use the answer directly?

For instructions, we should check whether a beginner can actually follow them.

For important facts, we should verify them.


⚙️ How Do We Improve the Prompt?

When the answer is weak, change one or two things at a time.

For example, we can:

  • Add the audience.
  • Add a familiar example.
  • Add the output format.
  • Add a length limit.
  • Add missing context.
  • Add a source rule.
  • Add what not to do.
  • Add acceptance criteria.

Do not change everything at once.

If we change too many things together, we may not know what actually improved the answer.


🔁 A Reusable Before and After Pattern

Let’s use one complete before-and-after example.

Weak Prompt

Write an apology message.

Problem

This prompt does not say who the message is for, what happened, how formal it should be, or how long it should be.

So the answer may sound too formal, too casual, too long, or unrelated.

Better Prompt

Write a polite apology message to my teacher because I submitted homework late.
Keep it short.
Use respectful language.
Do not make excuses.

Why This Works

The improved prompt gives:

  • Situation
  • Audience
  • Tone
  • Length
  • Boundary

This is the prompt improvement loop in practice.


✍️ Keep a Small Prompt Change Log

When we improve prompts, it helps to write down what changed.

For example:

AttemptPrompt ChangeResult
1Asked: “Plan my day.”Answer was too general.
2Added college class timing.Plan became more useful.
3Asked for table format.Answer became easier to follow.

This is useful because we can see which change actually helped.

Without a small change log, we may forget what we tried.

For a simple personal prompt, this is not required.

But for repeated work, such as writing weekly reports or replying to many similar messages, this habit is useful.


⚠️ What Prompt Improvement Cannot Fix

Prompt improvement is useful, but it is not magic.

A better prompt cannot:

  • Add live information if the model has no live data.
  • Guarantee that every fact is correct.
  • Make a weak model perfect.
  • Replace information that was never provided.
  • Safely perform important actions without application checks.

So prompt improvement should work together with:

  • Trusted sources
  • Tools
  • Validation
  • Human review
  • Logging
  • Evaluation

This is very important when we build real AI applications.


📝 A Simple Practice Exercise

Let’s practise with this weak prompt:

Plan my day.

Before improving it, ask:

  • What work needs to be done?
  • How many hours are available?
  • Is this for school, office, or personal work?
  • Should the plan include breaks?
  • Should the output be a table or bullet list?

One improved version could be:

Make a simple day plan for a college student.
I have classes from 10 AM to 3 PM.
I need 2 hours for study, 1 hour for exercise, and 30 minutes for reading.
Use a table with time, activity, and notes.

Now the model has a much clearer instruction.


🧩 Key Points

Let’s summarise what we learned.

  • 1. The first prompt may not be perfect.

    That is normal.

  • 2. Prompt improvement is a loop.

    Prompt

    Answer

    Review

    Improve prompt

    Test again

  • 3. We can improve prompts by adding:

    • Task
    • Context
    • Audience
    • Requirements
    • Output format
  • 4. Simple examples make prompts much clearer.

  • 5. A better prompt does not guarantee truth.

    Important answers still need checking.


🧩 Where We Are Now

We now understand how to communicate with an AI model more clearly.

We also understand that prompting is not a one-time activity.

We write a prompt, test it, review the answer, and improve the prompt.

This skill is useful when we use AI tools directly and when we build AI applications.