Defining Prompt Engineering
Prompt engineering is the practice of designing instructions and examples to guide LLMs to produce the specific format, tone, or task you need. It is the most direct way to control how an AI model behaves when interacting with your users or your data.
At its simplest, prompt engineering is the process of designing the instructions and examples you send to a model to control its behavior. Think of it as giving a highly intelligent but literal-minded intern a set of clear guidelines. If you just say, "Write a message," the result might be unpredictable. If you say, "Write a polite GST reminder in English for a client who is three days late, keeping it under 50 words," you have used prompt engineering to get a usable result.
For builders and business owners, this is the first and easiest way to make a general model work for a specific business task. Instead of building a whole new AI, you simply refine the input to change the output. Effective prompting helps manage the model's tone, format, and the complexity of the response it provides.
- Control Tone: Ensure the AI sounds professional, friendly, or urgent depending on the situation.
- Control Format: Force the model to output data in a specific way, such as a JSON object for a database or a bulleted list for a summary.
- Control Complexity: Guide the model to give a simple one-sentence answer or a detailed, multi-step explanation.
How Prompting Influences the Model
To understand why prompting works, you have to understand what an LLM actually is. You can learn more about the underlying technology in our guide on what is an LLM?
LLMs do not look up facts in a database like a traditional search engine. Instead, they predict the next token based on patterns learned during their massive training phase. A token is the basic unit of text a model reads and writes; it is often a short word or a piece of a word. When you ask a model to draft a message, it is producing the reply one token at a time, choosing the most likely next piece based on everything that came before it.
Prompting provides the context and constraints that steer these predictions toward a desired outcome. By providing specific instructions, you guide the model's "attention" to the most relevant parts of the input. This "attention" is a core part of the transformer architecture, which allows the model to weigh how much every word in your prompt matters in relation to every other word.
Prompting vs. RAG vs. Fine-Tuning
When building an AI application, you have three main ways to make a general model work for your specific business. Choosing the wrong one can lead to wasted money and unnecessary complexity. It is generally best to try them in this order: Prompting, then RAG, then Fine-Tuning.
| Method | What it changes | Best for... | Effort Level |
|---|---|---|---|
| Prompting | The instructions and examples you send | Changing format, tone, or simple tasks | Low |
| RAG | The documents you add to the context at question time | Answering questions from your own, current data | Medium |
| Fine-Tuning | The model's internal weights | Consistent style or very narrow, specialized skills | High |
Prompting is best for changing the format, tone, or performing simple tasks with low effort. For example, if you want a model to always respond in a specific way to customer queries, prompting is your first step.
RAG (Retrieval-Augmented Generation) differs from prompting because it adds your specific documents to the context. If you want a clinic's AI assistant to answer questions based on a specific doctor's schedule or a current fee list, you use RAG to provide those documents as context.
Fine-Tuning is the most intensive method. It actually updates the model's internal weights to help it learn new skills or styles. This is usually reserved for when you need a small model to behave very consistently in a specific format or when you need to teach a model a very niche way of communicating.
Best Practices for Better Results
To get the most out of your AI implementation, you should follow established patterns that have been proven to improve accuracy and reliability.
Use Few-Shot Prompting
Instead of just describing what you want, show the model. This is called "few-shot prompting." By providing a few examples of the desired input-output pairs, you give the model a pattern to follow. For instance, if you want to extract data from a WhatsApp message, show it three examples of a message followed by the structured data you want to extract.
Reduce Hallucinations with Source Material
To prevent the model from making things up, provide the source material directly in the prompt (often via RAG) and explicitly instruct the model to answer only from that text. You should also explicitly encourage the model to say "I don't know" if the answer isn't contained within the provided context. This is much safer than letting the model guess.
Use Chain-of-Thought for Reasoning
For complex reasoning or multi-step problems, use "chain-of-thought" prompting. This encourages the model to work through the problem step-by-step. This is particularly useful for mathematical calculations or logical deductions where the model needs to "think" before it arrives at a final answer.
Advanced Prompting and Reasoning
As you move beyond simple chat interfaces, you will encounter more advanced ways to use these models to drive business value.
Reasoning Models
Newer "reasoning models" are trained to use an internal chain of thought to catch mistakes before they reply. These models spend more "compute" (processing power) at the moment they are answering to ensure their logic is sound. Because they use more resources, they can be more expensive and slower, so use them for hard problems, not for simple tasks like "rewrite this message politely."
Tool Use and Agents
Prompting can be used to trigger "tool use," also known as function calling. This is where you describe a function to the model—such as check_stock(sku) or create_invoice(customer, items)—and the model responds with a structured request to call that function. When you put this in a loop, where the model can plan, call a tool, read the result, and decide the next step, you have created an AI Agent. Agents can handle multi-step jobs like reconciling payments or following up on unpaid invoices.
Structured Data and Temperature
For tasks where you need highly predictable, structured data—like extracting fields from a message to fill out a database—you should use low "temperature" settings. In LLM terms, "temperature" is a setting that decides how much variety is in the output. A low temperature (near 0) makes the model's output consistent and predictable, which is essential for technical or data-driven tasks.
Frequently Asked Questions
- Is prompt engineering a permanent skill?
- While the specific wording changes as new models are released, the ability to structure context and constraints remains a core skill for anyone building with AI.
- Can prompt engineering prevent hallucinations?
- It can significantly reduce them by providing source material (RAG) and instructing the model to admit when it doesn't know an answer, but it cannot eliminate them entirely. Always keep a human in the loop for legal, medical, or financial tasks.
- What is the difference between prompting and fine-tuning?
- Prompting changes the instructions you send to the model in the moment, whereas fine-tuning changes the actual weights (the internal parameters) of the model itself.
- How does prompting affect model cost?
- Longer, more complex prompts increase the number of tokens used. Since most providers charge based on the number of tokens, longer prompts can increase both latency and the cost per request.
- Can prompting be used for agents?
- Yes, prompting is used to describe functions to a model so it can respond with structured requests to call tools and perform multi-step jobs.

Questions people ask
Is prompt engineering a permanent skill?
While the specific wording changes with new models, the ability to structure context and constraints remains a core skill for building with AI.
Can prompt engineering prevent hallucinations?
It can reduce them by providing source material (RAG) and instructing the model to admit when it doesn't know an answer, but it cannot eliminate them entirely.
What is the difference between prompting and fine-tuning?
Prompting changes the instructions you send to the model, whereas fine-tuning changes the actual weights (the internal parameters) of the model itself.
How does prompting affect model cost?
Longer, more complex prompts increase the number of tokens used, which can increase latency and cost per request.
Can prompting be used for agents?
Yes, prompting is used to describe functions to a model so it can respond with structured requests to call tools and perform multi-step jobs.
