LLM Prompting Basics
Table of Contents + −
In the previous tutorial, we learned about model knowledge and knowledge cutoff.
We now know that an LLM has learned patterns during training, but it also needs input to know what we want it to do.
That brings us to a very practical concept:
How do we communicate with an AI model?
The answer is through a prompt.
✍️ What is a Prompt?
A prompt is the input or instruction we give to an AI model.
For example:
“Explain photosynthesis in simple words.”
That is a prompt.
The model receives it and generates a response.
That’s the basic idea.
🤔 Why Do We Need Prompts?
An AI model can perform many different tasks.
The same model could:
- Explain something
- Summarise text
- Translate a sentence
- Write an email
- Generate code
- Answer questions
- Extract information
But the model needs to know what you want it to do.
For example, suppose you provide:
“The Earth revolves around the Sun.”
That’s information.
Now compare it with:
“Explain the following sentence in simple English: The Earth revolves around the Sun.”
Now you’re giving the model an instruction.
The instruction tells the model what to do with the information.
✍️ Prompt = Instruction + Information
A prompt doesn’t have to contain only an instruction.
It can contain different kinds of information.
For example:
Consider:
“Summarise the following text in three sentences: [text]”
Here:
Together they form the prompt.
💡 A Simple Example
Imagine you have this text:
“The Earth takes approximately 365 days to complete one orbit around the Sun.”
You could ask:
“Explain this in simple words.”
The model understands that you don’t want it to simply repeat the sentence.
You want an explanation.
So it may respond with something like:
“The Earth takes about one year to go around the Sun.”
The prompt tells the model what kind of response you want.
🤔 Instructions Matter
Compare these two prompts.
Prompt 1
“Python.”
This doesn’t tell the model exactly what you want.
Prompt 2
“Explain what Python is to a beginner in simple English.”
This gives the model much more direction.
versus:
This is why learning how to write good prompts is useful.
✍️ Prompting Is Communication
Think about talking to another person.
If you say:
“Make it better.”
they might ask:
“What should I improve?”
But if you say:
“Rewrite this paragraph using simple English and keep it under 100 words.”
your requirement is much clearer.
Prompting works in a similar way.
The clearer your instructions, the easier it is for the model to understand what you want.
However, a clear prompt still cannot guarantee a correct answer.
✍️ What Makes a Good Prompt?
There isn’t one perfect structure for every situation.
But a useful prompt often contains some combination of:
For example:
“Explain photosynthesis to a school student. Use simple English and give one everyday example.”
Let’s break it down.
Task
Explain photosynthesis
Audience
A school student
Requirement
Use simple English
Additional requirement
Give one everyday example
All of these help guide the response.
📌 Giving the Model a Role
Sometimes we can tell the model what role or perspective to use.
For example:
“Act as a beginner-friendly mathematics teacher.”
Then:
“Explain fractions using a simple example.”
The prompt now gives the model additional guidance about how the response should be written.
Conceptually:
A role is optional. You don’t need one for every prompt.
💡 Giving Examples
Another useful technique is providing examples of what you want.
Suppose you want the model to classify messages.
You could provide examples:
The examples show the model the pattern you want it to follow.
This is commonly called few-shot prompting.
If we provide no examples, it is often called zero-shot prompting.
We’ll study these terms in more detail later.
For now, remember:
Examples can help communicate the desired pattern to the model.
📌 Telling the Model What the Output Should Look Like
Suppose you ask:
“Give me information about India.”
The model has many possible ways to answer.
But you could say:
“Give me five facts about India as a numbered list.”
Now the expected output is clearer.
You can ask for formats such as:
- A list
- A table
- JSON
- A paragraph
- Step-by-step instructions
The exact format depends on what the model and application support.
⚖️ Prompt and Context Are Different
We just learned about context.
Don’t confuse prompt and context.
A prompt is what we provide as an instruction or input.
Context is the broader information available to the model for the current request.
For example:
A prompt can therefore become part of the context.
The terms are related, but they are not interchangeable.
⚠️ Prompting Does Not Teach the Model Permanently
Suppose you tell the model:
“From now on, explain everything using very simple English.”
This instruction can influence the current interaction.
But simply putting an instruction in a prompt does not normally retrain the model.
Remember:
not:
⚠️ Prompting Does Not Add New Knowledge
Suppose you ask:
“Tell me about a company that was created yesterday.”
If the model has no information about that company, simply asking the question doesn’t magically give it that information.
This connects directly to our previous lesson.
Prompt ≠New KnowledgeIf the model needs information it doesn’t have, that information may need to be provided through context or another system.
✍️ A Prompt Is Not a Guarantee
A very detailed prompt can still produce a wrong answer.
For example:
“Give me the exact answer and do not make any mistakes.”
This doesn’t guarantee correctness.
Why?
Because prompting controls the instructions given to the model, but it doesn’t magically change the model’s underlying knowledge or reasoning ability.
So:
but:
🌡️ Prompting and Temperature
We already learned about temperature.
These two concepts affect different things.
Prompt
Tells the model:
What do I want you to do?
Temperature
Influences:
How the model selects among possible generated tokens.
So:
They work together during generation, but they are different concepts.
💡 A Complete Example
Let’s create a simple prompt:
“Explain what a computer is to someone who has never used one. Use simple English and give three examples of things a computer can do.”
We can break it down:
This is a much more useful instruction than simply saying:
“Computer.”
✍️ Prompt Engineering
You may hear the term:
Prompt Engineering
Prompt engineering means designing and improving prompts so that an AI model produces a more useful result for a particular task.
It can involve:
- Writing clear instructions
- Providing relevant context
- Giving examples
- Specifying output format
- Defining constraints
- Testing different prompts
It is not magic.
It’s essentially about communicating the task clearly to the model.
🤔 Do We Need Special Prompting for Every AI?
Not necessarily.
Simple tasks often need very simple prompts.
For example:
“Translate this sentence into Hindi.”
That’s already a good prompt if the task is straightforward.
Prompt engineering becomes more important when the task is:
- Complex
- Multi-step
- Highly structured
- Sensitive to formatting
- Repeated many times
💡 The Basic Prompting Formula
For now, keep this simple structure in mind:
What should the model do? +What information does it need? +What requirements should it follow? +What should the output look like?You don’t always need every part.
But thinking this way helps you create clearer prompts.
🧩 Key Takeaways
-
What is a prompt?
The input or instruction given to an AI model.
-
Why is it important?
It tells the model what we want it to do.
-
What can a prompt contain?
It can contain:
- Instructions
- Information
- Context
- Examples
- Requirements
- Output-format instructions
-
Does a prompt retrain the model?
No.
-
Does a good prompt guarantee a correct answer?
No.
-
What is prompt engineering?
Designing and improving prompts to get more useful and reliable outputs from an AI model.
🧩 Where We Are
Now we understand the basic interaction:
The next important concept is how a model can follow examples and instructions without being retrained.
That leads naturally into: